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.
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.
...
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 # ...
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 ...
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 ...
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 ...
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, "...
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 ...
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 ...
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;
...
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 ...
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.
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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 <...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
debugfs × 34ext4 × 11
filesystems × 8
inode × 7
linux × 4
kernel × 4
files × 3
timestamps × 3
data-recovery × 2
android × 2
sysfs × 2
ext3 × 2
tracing × 2
ftrace × 2
bash × 1
debian × 1
ubuntu × 1
command-line × 1
arch-linux × 1
linux-kernel × 1
directory × 1
lvm × 1
virtual-machine × 1
backup × 1
kernel-modules × 1