Could use help recovering a problem partition
Hello,
First a thank you for this fantastic toolkit.
To explain the situation best I can:
Old PC's PSU was going. Old PC had a more recent 500GB hard drive.
Its hard drive was very simply partitioned thus:
sda1 swap; sda2 / for the OS; sda3 /home for user files (ext3).
I built a new computer. Installed my usual OS (Kubuntu). As for data on the old PC's hard drive I have no removable, external hard drive or anything, just some DVDRs. I made sure I had essential stuff backed up, business related etc, till DVDRs were used up. Left was years of pics, vids, car repair stuff etc.
Not knowing any better, being a clodhopper, I installed the old PC's hard drive as a second in the new PC (making sure BIOS was to boot correct new hard drive) to finish copying the rest then use the drive as extra space. Very naive. With no hint and input from me (maybe no surprise to you) Kubuntu took the old PC's 475GB sda3 /home partition as its new seriously big swap. Yours truly, horrified, unmounted it immediately and searched for help. I was recommended to use parted. The partition with the drive was:
/dev/sbd3 File System: unknown 442.46GB Used: --- Unused: --- no flags
Was advised to try testdisk for a start on Ubuntu Rescue Disk. I found a used old PSU to get the old PC working, reinstalled the hard drive in question and ran Rescue Disk. Then ran testdisk.
It found two partitions, the old swap and partition with the old / root which has the old Kubuntu OS install. Deeper search on that did find the partition needed:
P Linux Start: 3041 0 1 End: 60800 254 63 Size: 927914400 [home]
which appears correct! At the bottom I can see it also says about it:
EXT3 Large file Sparse superblock Backup superblock 475GB / 442GiB
Not sure what to do now. I had it write that new, seemingly correct partition table, edited /etc/fstab to make sure it was right in the old Kubuntu install, then tried booting; Kubuntu did boot and started checking disks; root partition checked out; it reported "serious" errors with the /home partition. I went no further, shut down and am seeking help. You can see I am definitely a novice to these matters. :-) What should I do next?

Try mounting the partition
Try mounting the partition with an alternate superblock.
sudo dumpe2fs /dev/sdb3 |grep superblock
(Use the correct device name, not "/dev/sdb3" unless that is indeed the correct device...
$ dumpe2fs file |grep superblock
dumpe2fs 1.41.4 (27-Jan-2009)
Primary superblock at 0, Group descriptors at 1-1
Backup superblock at 32768, Group descriptors at 32769-32769
Backup superblock at 98304, Group descriptors at 98305-98305
Backup superblock at 163840, Group descriptors at 163841-163841
Backup superblock at 229376, Group descriptors at 229377-229377
Multiply those numbers by four since ext3 uses 4k blocks. Try using the higher ones first.
>>> 229376*4
917504
mkdir mnt
sudo mount -r -o loop,sb=917504 /dev/sdb3 mnt/
If you can't even see where the superblocks are, then the filesystem is very badly damaged. Use file carving to recover your files. If it won't mount and needs to be repaired, image the drive first so that you don't screw anything up.
To use an alternate superblock for fsck, do not multiply the value you got by 4.
Example:
sudo fsck -b 229376 /dev/loop0
Good luck!
Thank you andrew for the
Thank you andrew for the detailed help.
I ran dumpe2fs command and it reported:
Bad magic number when trying to open superblock /dev/sda3 (apparent current location of partition in question)
couldn't find valid filesystem superblock
Testdisk's "locate backup superblocks" utility did find some 10 superblocks (if that's a useful thing here). I multiplied the highest (4096000 x4= 16384000) and tried the mount commands you gave:
sudo mkdir mnt
sudo mount -r -o loop,sb=16384000 /dev/sda3 /mnt
mount reported: 'you must specify the filesystem type'
Just a syntax error/omission or bad news?
btw, lessoned learned, I ordered an external enclosure/drive (the expenses on computer gear never seems to stop...) for future backup use and to possibly be able to "image" this drive if needed, should be here within the week. Again, I appreciate these tools and the kind help.
Chris