I recently damaged an ext4 partition by accident (mistakenly forced
a RAID sync with another partition onto it, which I realized after
about 3% completion). As a result the beginning of the ext4 partition
seems to be overwritten with garbage and refuses to mount.
As you might guess, I'd now like to get as most of my data back (from
the part which hasn't been overwritten, of course :)).
Maybe somebody knows a good method to just "repair" the ext4-structure
from the remaining part of the partition?
Background information:
Operation system: Debian GNU/Linux 6.0.4 (Squeeze)
Kernel: Linux 2.6.32-5
Architecture: x86-amd64
e2fsprogs: 1.41.12
Filesystem type: ext4, with default settings (mkfs.ext4 /dev/xyz)
Filesystem size: Around 1TB, filled with around 800GB of data.
Filesystem content: From a lot of ASCII stuff up to files with several
GB in size and arbitrary non-standard type.
What I've tried so far:
* First of all, though the source drive is physically fine, I work on
images of the partition on a spare drive, to experiment with. Everytime
I make unrecoverable errors to that image, I recopy the original.
* "dumpe2fs -b $SBERR /dev/loop0" does NOT work, for SBERR={32768, 98304,
163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000,
7962624} ( see https://pzt.me/1l55 )
* "dumpe2fs -b $SBOK /dev/loop0" DOES (partly) work, for SBOK={11239424,
20480000, 23887872, 71663616, 78675968, 214990848} ( see https://pzt.me/6txz )
* "mkfs.ext4 -S /dev/loop0" results in a completely empty filesystem
* "fsck.ext4 -b $SBOK -B 4096 -v -n /dev/loop0" shows a lot of errors.
Filesystem isn't mountable afterwards ( see https://pzt.me/42yk and
https://pzt.me/3frg )
* "fsck.ext4 -b $SBOK -B 4096 -v -y /dev/loop0" recoveres after a long time.
Filesystem is mountable. Root is empty besides lost+found folder, which
contains about 300GB mostly useless data: Millions of files with wrong
permissions, useless names and some random content.
* photorec from the testdisk package recoveres, luckily!, about 500GB of
data. Though the content seems to be pretty reasonable, no filenames
are recovered, since photorec operates without using filesystem knowledge.
Do you see any chances (besides consulting professional recovery companies)
getting the filenames back? I looked into the ext4 specs a bit to figure out
where this information is stored on disk, but before I step with hexedit
through a terabyte of data, I'd rather try some solutions which are maybe
already out there.
Any help is appretiated.
Thanks in advance, Rudolf.
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1328804993.343...@web132403.mail.ird.yahoo.com
[ext4 partition overwritten with garbage at the beginning]
>> * photorec from the testdisk package recoveres, luckily!, about 500GB of
>> data. Though the content seems to be pretty reasonable, no filenames
>> are recovered, since photorec operates without using filesystem
>> knowledge.
>>
>> Do you see any chances (besides consulting professional recovery companies)
>> getting the filenames back?
>
> There was an ext3grep tool that some people had success with, but when I
> looked at it, it was still fairly complex to use.
Thanks for the hint, but the problem with ext3grep is that it seems to
rely on an intact filesystem structure. It even has no option to set
another superblock besides the default one and fails with all commands
I tried ( see https://pzt.me/8q6k ).
Bye, Rudolf.
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1328822543.658...@web132404.mail.ird.yahoo.com
> I have written some tools in the past to recover the file structure of
> an over-formated ext3/ext4 device based on directory blocks.
> With some tweaks it should be able to assign the file#inode_numbers in
> lost+found to a directory structure.
> Problem is that I'm rather busy with too many other projects already. Do
> you know C and could you add some code on your own for the lost+found
> assignment? I can assist you, but it is unlikely that I find much time
> do it myself...
I'm not that fluent in C, but I could just give it a try. Since it's my
own data and this recovery for personal "fun" I can't do something bad
with it :) So, if you could share the code I'd be happy!
Thanks, Rudolf.
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1328893673.790...@web132401.mail.ird.yahoo.com
>> I recently damaged an ext4 partition by accident
[...]
>> Maybe somebody knows a good method to just "repair" the
>> ext4-structure from the remaining part of the partition?
>
> Have you tried just simply running e2fsck, specifying an alternate superblock?
Yes of course I tried, as I wrote in my original post ($SBOK is one
of the intact superblocks at 11239424, 20480000, 23887872, 71663616,
78675968 and 214990848).
With "all answers: no":
>> * "fsck.ext4 -b $SBOK -B 4096 -v -n /dev/loop0" shows a lot of errors.
>> Filesystem isn't mountable afterwards
# fsck.ext4 -b 214990848 -B 4096 -v -n /dev/loop0
e2fsck 1.41.12 (17-May-2010)
One or more block group descriptor checksums are invalid. Fix? no
Group descriptor 0 checksum is invalid. IGNORED.
Group descriptor 1 checksum is invalid. IGNORED.
...
Group descriptor 7451 checksum is invalid. IGNORED.
Group descriptor 7452 checksum is invalid. IGNORED.
/dev/loop0 contains a file system with errors, check forced.
Resize inode not valid. Recreate? no
Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory. Clear? no
Inode 5 should not have EOFBLOCKS_FL set (size 2642074971391648798, lblk -1)
Clear? no
...
# mount -o ro /dev/loop0 /mnt
mount: /dev/loop0: can't read superblock
# dmesg
[504508.215515] EXT4-fs error (device loop0): ext4_iget: bad extended attribute block 1920620055 in inode #2
[504508.215530] EXT4-fs (loop0): get root inode failed
[504508.215534] EXT4-fs (loop0): mount failed
With "all answers: yes":
>> * "fsck.ext4 -b $SBOK -B 4096 -v -y /dev/loop0" recoveres after a long time.
>> Filesystem is mountable. Root is empty besides lost+found folder, which
>> contains about 300GB mostly useless data: Millions of files with wrong
>> permissions, useless names and some random content.
> I'd do this by making a copy of the file system first, of course….
For sure! :) I solely work on copies.
Thanks, Rudolf.
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1328899012.922...@web132404.mail.ird.yahoo.com
In an offlist reply someone recommended me ext4magic (see
http://developer.berlios.de/projects/ext4magic ).
Like magic it recovered complete directory hierarchies with filenames,
timestamps, even ownership and permissions for more than 300GB of the
deleted data.
I can recommend this to everybody who accidently destroyed parts of
his filesystem. In contrast to fsck ext4magic doesn't try to repair,
but just extracts the data completely in read only mode (feelslike
"tar xf" actually :).It's easier to use and understand and way more
effective when it comesto recovery. ext4magic shouldn't be missing
in any good recovery collection.
Thanks to all helping me out in this case.
Have a nice weekend, Rudolf.
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1328981610.632...@web132402.mail.ird.yahoo.com