Linux – ext4 directory lists as a file

ext4filesystemsinodelinuxraid

I'm working with a large (8TB) EXT4 filesystem in linux. After a power outage, the filesystem wouldn't mount. fsck is taking weeks to complete, but i ran testdisk and i'm able to see my partition and the files and directories of the root. the problem is the directory that contains most of the data on the disk is in a certain folder that when listed in testdisk lists as a directory. The "D" at the beginning of the file permissions is not set. Is there any way to fix this or browse to the directory? Can i search for the directories that sit below this unusable directory? thanks for your help!

Best Answer

Try running debugfs on the filesystem. Navigate to the parent directory, then use stat to view the inode content and modify_inode to modify it.

Note that this may or may not help — if the mode bit has changed, there's a chance that other bytes in the inode are corrupt, including the location of the directory data.

Otherwise, fsck may (or may not, recovery is always highly chancy) find the lost directory data and file it under /lost+found.

Related Question