list directory in ext4 filesystem
Is there any way to display the contents of a directory in an ext4 filesystem? I don't mean an ls, I mean a byte by byte inspection of the actual directory structure. I have what is apparently a rather large directory, which is also empty: $ ls -ld files/ drwxr-xr-x 2 motion motion 3215360 May 9 00:55 files/ $ ls -l files/ total 0 od for example won't open it: $ od files od: files: read error: Is a directory 0000000 it's on the root filesystem which is supposedly clean: $ sudo e2fsck -n -v /dev/root e2fsck 1.42.5 (29-Jul-2012) Warning! /dev/root is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. root: clean, 90733/897600 files, 1419737/3583744 blocks (it's a rather old SD-card-based system I'd rather not reinstall) I'm tempted to just delete the directory and recreate it, but I'd like to understand what happened first if I can.
Hello, On Fri, 20 May 2022, Dave Howorth wrote:
Is there any way to display the contents of a directory in an ext4 filesystem? I don't mean an ls, I mean a byte by byte inspection of the actual directory structure.
man debugfs
I have what is apparently a rather large directory, which is also empty:
$ ls -ld files/ drwxr-xr-x 2 motion motion 3215360 May 9 00:55 files/ $ ls -l files/ total 0
On ext*, directories grow as they need more space for directory entries, but do not get "pruned" when that reason does not exist anymore. Afterall, a directory on ext is just a file with some special handling ;) HTH, -dnh -- Hardware extracts your blood. Software extracts your sanity. -- Greg Andrews
participants (2)
-
Dave Howorth
-
David Haller