I have an ext3 disk from my NAS. I took this drive out of the NAS and mounted it under my Debian Wheezy system.
When I ran fsck it told me that the superblock was bad.
I don't haver a full log, but the exact error message was fsck.ext3: Bad magic number in super-block while trying to open
So, after reading up a little I attempted to restore the superblock from backup using the command:
sudo e2fsck -b 32768 /dev/sda2
After rebooting it appears that the drive is empty, and all of my folders are gone! What's more - my drive was originally in ext3 format but now it is detected as ext2. Is there an ext3 specific way to restore the superblock?
What is the best way to restore this drive's previous partition table / directory structure without risking making it worse?
dd
the entire drive's content elsewhere. For example,dd if=/dev/sdb of=~/sdb.copy bs=1M
That way, even if you do mess up further, you can at least get back to what you have now. The data is almost certainly still there.