# ext4 filesystem corruption with gentoo sources 2.6.32-r7

## Circuitsoft

I'm afraid I left my laptop on for several days without paying attention to it. When I got back to it, the root filesystem had remounted itself read-only and fsck.ext4 barely recognized it and had complaints about every inode. Running xxd on it and looking art the first couple hundred bytes looked like a directory of something under /usr/share/pixmaps - there were several .png file names.

At this point, I see no way to recover any data. Am I completely screwed?

----------

## BradN

You could try first making a backup of the partition and trying fsck.ext4 on that, but if that doesn't get you anywhere, there are recovery programs that work solely on the basis of (mostly) contiguous storage and identifying file data directly - I recommend PhotoRec as I've used it and it works well on most filesystems except reiserfs (due to tail packing).  You will lose all the filenames but at least you should be able to get most of the data.  In the case of reiserfs, their own fsck utility can recover all but the most horribly corrupted filesystems anyway by scanning the disk for filesystem structures.

http://www.cgsecurity.org/wiki/File_Formats_Recovered_By_PhotoRec (it does work on files other than images)

http://www.cgsecurity.org/wiki/TestDisk_Download

----------

## cach0rr0

can you remove the journal and mount it? you may find recovery tools do better with ext2 (which, ext4 mounted without a journal is more or less ext2 - pedantry aside)

----------

## d2_racing

It's the second time that I see that kind of problem in one month.

Maybe a little wiki could do the job.

----------

## Hu

 *cach0rr0 wrote:*   

> can you remove the journal and mount it? you may find recovery tools do better with ext2 (which, ext4 mounted without a journal is more or less ext2 - pedantry aside)

 Not to engage in unnecessary pedantry, but it is not quite correct to say that ext4 without a journal is almost ext2.  This statement applies for ext3/ext2, but when ext4 is considered, you must also consider the new filesystem features such as extents, which record the storage in a way that the ext3 code cannot understand.  As a result, tools designed to recover ext2/ext3 may behave poorly if they encounter directory entries for files stored using extents.

----------

