Skip to main content
13 votes
Accepted

How come that inodes of directories store filenames in ext4 filesystem?

Directory entries are stored both in inode.i_block and the data blocks. See "Inline Data" and "Inline Directories" in the document you linked to.
Johan Myréen's user avatar
10 votes

How come that inodes of directories store filenames in ext4 filesystem?

cat outputs file contents, i.e. data blocks. Similar to /bin/cat. The cat command would not be useful if it wrote the bytes of the inode structure to the terminal. Compare inode_dump and stat. ...
sourcejedi's user avatar
  • 53.5k
7 votes
Accepted

Copying or restoring crtime for files/directories on ext4fs filesystem

I've actually solved it on my own. You never know what you can do till you try :-) It must be safe to run even when all the filesystems are mounted read-write. #! /bin/bash dsk_src=/dev/sdc4 # ...
Artem S. Tashkinov's user avatar
6 votes

How come that inodes of directories store filenames in ext4 filesystem?

A directory's data contains dirent entries. Each directory entry contains a filename and a pointer to an inode. An ext4 inode can contain the data contents of a small file for efficiency, so that it ...
Chris Davies's user avatar
5 votes
Accepted

debugfs not working | file not found by ext2_lookup

debugfs’s stat command expects a path name, or an inode number “quoted” using angle brackets; you might as well use stat milad/a instead: sudo /sbin/debugfs -R 'stat milad/a' /dev/sda6 The file path ...
Stephen Kitt's user avatar
4 votes

How come that inodes of directories store filenames in ext4 filesystem?

I don't think the debugfs cat command shows the contents of the inode itself, though I think the language in the man page is confusing. Numerous places, the man page refers an "inode filespec" which I ...
Jeremy Dover's user avatar
4 votes
Accepted

rmdir failed to remove empty directory

I straced ls and got more information to dig (stripped non-important syscalls): open("empty_dir", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 getdents(3, /* 3 entries */, 32768) = 80 write(1, "...
bfuvx's user avatar
  • 111
4 votes
Accepted

Creation time anomaly

The ctime and crtime cannot be tampered with, the atime and mtime can be set by user processes to arbitrary values using the utime() or utimes() (or utimensat() for nanosecond precision) system calls ...
Stéphane Chazelas's user avatar
3 votes
Accepted

Reading stale file data with debugfs cat

It is due to caching. You have at least two options. Use the -D flag: -D Causes debugfs to open the device using Direct I/O, bypassing the buf‐ fer cache. Note that some Linux devices, notably ...
ibuprofen's user avatar
  • 3,050
2 votes

debugfs and "Bad magic number"

As for the command debugfs -R 'stat <33567136>' /dev/sda1 failing when trying to fetch the info from inode 33567136: I suspect you are just following blindly the tutorial you are linking; ...
Rui F Ribeiro's user avatar
2 votes

/sys/kernel/debug/dynamic_debug/control not writable, follow xhci_hcd debug guide

So this does not solve the problem on how to write to /sys/kernel/debug/dynamic_debug/control, but solves my problem on how to follow the tutorial/guide above. In the guide it says you can enable ...
aiutopia.dev's user avatar
1 vote
Accepted

Why can the mount points of debugfs and sysfs be overlapped?

Every directory can be a mountpoint, like / is a mountpoint, and /sys is too, or often /home is a separate mountpoint.
user unknown's user avatar
  • 10.8k
1 vote

Why debugfs is mounted on /sys/kernel/debug?

To keep things clean and avoid spreading information into another root subdirectory. /sys is an interface to the kernel, so it makes sense that debugfs (which is a RAM-based filesystem designed for ...
dr_'s user avatar
  • 32.4k
1 vote
Accepted

Weird debugfs behavior

The simplest option to clean things up is to check the file system: e2fsck -f /dev/vda1 What’s wrong is that you’ve ended up with a directory entry containing forward slashes, which shouldn’t happen. ...
Stephen Kitt's user avatar
1 vote

Copying or restoring crtime for files/directories on ext4fs filesystem

If you have a modern tar archive that includes all time stamps, you can do this with star -xp -ctime ... in case you call star as root. Note that this leẗ́s star cause time storms and should not be ...
schily's user avatar
  • 19.7k
1 vote

Batch processing a ddrescue mapfile with debugfs

I had to do this today after my rpi3b+ SD card died. I ended up writing a python script doing what you did in your bash script above, except it will spit out the file paths automatically. You can ...
zkrx's user avatar
  • 11
1 vote

Batch processing a ddrescue mapfile with debugfs

I believe I have found a solution for my problem. However, I am still curious if anyone can come up with a more elegant solution or possibly find a mistake in my solution. As it turns out, I could ...
lanoxx's user avatar
  • 1,058
1 vote

rmdir failed to remove empty directory

In my case, it was because the filesystem was mounted as a cifs smb/samba share with these global options: [global] vfs objects = catia fruit streams_xattr fruit:aapl = yes That provides ...
Guillaume's user avatar
1 vote

rmdir failed to remove empty directory

Within debugfs you can delete the file. You do not even need the file name (which may be relevant if there are problems with special chars as francois P guessed in the comments): kill_file <...
Hauke Laging's user avatar
  • 94.6k

Only top scored, non community-wiki answers of a minimum length are eligible