Partition recovery - help me retrieve my data
I'm in trouble. I am trying to recover my main data partition.
Here's how it happened: sdb1 - 680gb primary partition, ext4, around 300gb of data on it sdb2 - 60gb primary partition, ext4, for backing up system from sda1 with rsync While doing rsync backup on sdb2, I run gparted, which indicated that it cannot read partition table on sdb and displayed the whole of it as unallocated. I know that when I run gparted 30 earlier, the partition was still vissible. Nevertheless, I thought that's because of rsync and I thought reboot would fix that, because sdb1 was still mounted, and I was accessing all the data on it with no issues. When rsync was done, I rebooted an that was the last time I saw my data. Automounting during boot gives me: Code:
superblock could not be read or does not describe correct ext2 filesystem... Code:
$ sudo fsck.ext4 -p -b 98304 -B 4096 /dev/sdb Code:
$ sudo e2fsck -b 8193 /dev/sdb I then went into testdisk and as I saw it detected sdb1 and sdb2 correctly, I selected "Write" on the partition table. Since then on, gparted sees both partitions, but it sees sdb1 as empty. I then did this: Code:
$ sudo fsck -n /dev/sdb1 It finds the partition (partition type is automatically selected as None) but it finds no files on sdb1, even after deep search. It does find data on sdb2, but that's just system partition backup I don't care about at this point. Also, just now I run this Code:
]$ sudo fsck.ext4 -v /dev/sdb1 And some other commands I tried: Code:
$ sudo parted /dev/sdb p Code:
$ sudo dumpe2fs /dev/sdb1 | grep superblock I would really appreciate some help here. I had online backup of ~10 GB of the most important data of it, but there still is on this lost partition at least another 10-20 GB of really vital data, the loss of which would be quite a blow. |
Looks like you've done your best - may be beyond the skills of us mere mortals.
Maybe try photorec (same people as testdisk) - you may get a bunch of fragments you'll need to post-process. May be better than nothing. Make sure you recover to a different disk. |
One tip when attempting to recover data is to not use the original copy to do the data recovery. Put the hard disk in a different machine and use dd to create an image of the partitions that you need to recover. Do all of your work on the image, that way you don't damage the contents of the partition more when trying to work with it.
|
I have already done the copy, and tried mounting it, but it failed with the same error, as mounting the pertition:
Code:
$ sudo mount -t ext4 -o ro,offset=32256 /dev/sdb /mnt/Disk_D Code:
$ dmesg | tail Here is some output from testdisk while doing deepsearch on partition: Code:
Disk /dev/sdb - 750 GB / 698 GiB - CHS 91201 255 63 Code:
ext4 0 32 33 83175 145 42 1336213504 I also run photorec just to have a look, and it seems to be finding all the files, but of course photorec recovery is a massive mess so I would only like to use it as a last resort. |
I'm sorry but there's no other way to put it: you fscked up royally:
- you deliberately ran gparted completely unnecessarily and on a disk with pending write ops, - you then ran fsck on a disk instead of a partition, then - you ran e2fsck on an ext4 (!), then - you let testdisk write data to disk and then - you completely ignored the warning about super blocks and reallocated meta data! *On top of that you don't tell us exactly at which stage you decided to copy the disk. Now I don't know your definition of "a last resort" but I'd say you've reached that point... |
That may well be, but that's not exactly like that:
- I run gparted, to check partition info of another disk. It did not write anything - I run fsck as I found it in the internet - same goes for e2fsck - testdisk wrote data to partition table, not the disk itself - how exactly did I ignore warnings of superblocks? The dd copy of the disk was done after testdisk |
Quote:
Code:
Note: if several inode or block bitmap blocks or part Quote:
Quote:
*For testdisk attach or post the log file. |
Quote:
Quote:
Code:
fdisk -l /dev/sdb Code:
/dev/sdb: LBA, HPA, LBA48, DCO support Code:
kpartx -lv /dev/sdb |
Quote:
Which means you don't need my help. Good luck! |
I suppose that was sarcasm. I have to work on sdb(1) because the image is compressed and all I can do with it is to restore it back. I have not enough free space anywhere to be able to work on a 670GB uncompressed partition image.
Anyway, I bit the bullet and I run Code:
fsck -b 32768 /dev/sdb1 -y -C0 Data size went from 330GB to 190GB and all of it was in lost+found, out of which I copied off the disk ~80GB. The rest was a numerical mess. So I now gonna restore the image backup back on the disk and go back to square one trying to retrieve at least part of the rest. I look forward to your advices. |
You might have some success restoring the image and using debugfs to dump files. You might also be able to use that to look inside the tattered remains of directories to associate inode numbers that e2fsck used as names in lost+found with their original file names. You will almost certainly have to copy one of the backup super blocks to the primary super block position first.
Note that the objection to using e2fsck on an ext4 file system was unfounded. fsck.ext4, fsck.ext3, fsck.ext2, and e2fsck are all hard links to the same program. But, every time you said "yes" to e2fsck you were compounding the problem and making recovery less likely. |
All times are GMT -5. The time now is 08:27 AM. |