Theodore Tso wrote:
Thanks!On Thu, Jul 24, 2008 at 11:47:16AM -0400, Charles Riley wrote:Hi, What does the "expand_dir" command do in debugfs? All the information I can find on it just says "Expand the directory filespec" I googled the archives and can't find a post where someone actually used it to give me some context. If I try it in debugfs (image opened ro) it seems to want to write to the image.It adds an extra (empty) directory block to a directory inode. This something like this is used to recreate a lost+found directory with extra empty directory blocks so that e2fsck can reattach orphaned inodes without needing to allocate blocks from the filesystem (which might not be available if the filesystem is 100% full), for example. It's not normally useful for most debugfs users. (Heck, debugfs wasn't intended to be useful for most ext3 users; it's really designed for ext3 wizards that need to untangle badly corrupted filesystems, and/or ext3/4 developers that are debugging new ext4 code, and/or ext3/4 developers creating deliberately corrupted filesystems for e2fsprogs's regression test suite.) - Ted
I've been playing with it quite a lot, in preparation for repairing the 1.5TB filesystem I posted about previously. Just to be on the safe side, I wanted to see what would happen using various methods of fixing things.. So I recreated the directory structure (on a much smaller scale) on a test image and used debugfs to duplicate the state of the broken filesystem. The more I learn about the lower level workings of the filesystem, the more fascinated I become and the more I want to learn.
It just occurred to me that I have no life =)