We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

bad superblock - reiserfs

hldn
hldn asked
on
Medium Priority
1,650 Views
Last Modified: 2013-12-15
i've got a 200gb hdd in a gentoo box formatted with rfs.. i've had it in there about 6 months and use it to store large video files.. i've never had any problems until the last couple days, now trying to mount it i get 'mount: wrong fs type, bad option, bad superblock on /dev/hdb1, or too many mounted file systems'  fsck gives me 'bread: Cannot read the block (16): (Input/output error).

i have absolutely no idea what to do from here, and would really like to not lose any data stored on that disk.. what should i do?!
Comment
Watch Question

Top Expert 2005

Commented:
Obviously the file system on this disk is pretty badly damaged. Depending on how bad the damage is and what the cause was it might be possible to fsck the FS using an alternate superblock. But before attempting that I'd use 'fdisk -l /dev/hdb1' to make sure that the partition table was still valid and I'd also use 'badblock -n /dev/hdb1' to see if there's been a disk failure.

Author

Commented:
fdisk -l /dev/hdb

gives me:

Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1             1     24792 199141708+  83  Linux

and last night i ran badblocks and it gave me this:

64
65
66
67
32840
32841
32842
32843
30268976
30268977
30268978
30268979
38301648
38301649
38301650
38301651
39240916
39240917
39240918
39240919
40867684
40867685
40867686
40867687
122237932
122237933
122237934
122237935
168750132
168750133
168750134
168750135
175960780
175960781
175960782
175960783

is there any hope for getting my data back? i tried googling for info, and came across dd_rescue.. could that be a possibility? yeah i'm pretty new and i've never had to deal with a problem like this before..  also, what could have caused this? any way to prevent it from happening again?
Top Expert 2005
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
>> If the data is really valuable I'd try replicating it on a replacement drive and then trying to repair that file system

welp.. i suppose i'll do that.. what's the best way to go about that?   sorry if i sound like i have no idea what i'm doing, but that's because i don't.. thanks for all your help, btw.
Top Expert 2005

Commented:
dd_recover would be the most appropriate tool to attempt the replication with. If it is able to transfer all readable blocks to a new drive it might be possible to use fsck to repair the result.

Author

Commented:
good deal.. thx a bunch friend.

Author

Commented:
okay..

dd_rescue /dev/hdb1 /dev/md0
reiserfsck /dev/md0
reiserfsck --rebuild-tree
mount /dev/md0 /mnt/raid

and now /mnt/raid contains a lost+found dir with a large number of files in it..  what should i do from here?
Top Expert 2005

Commented:
Okay, you've made a copy and repaired that copy so it is now mountable. The damage was fairly great since you wound up with "a lost+found dir with a large number of files in it...". Now what we want to do is to try to recover as much from this copy as possible and the files in lost+found represent files or fragments of files that were present in the damaged file system that didn't have corresponding directory inodes and/or directory data. Since the directory information was lost fsck created names for each in the lost+found directory.

You'll have to examine each file in lost+found and try to figure out what it's orginal name was from what the file contains. Executing 'file /lost+found/file-name' may help to figure whether to examine the contents with a text editor, media player, or whatever. As you figure out what a file is you can move to to where it should be and set the correct name.

Author

Commented:
warg.. thats what i figured.. was just hoping there was an easier way.. thanks again though.
Top Expert 2005

Commented:
Well, that was the bad news. The good news is that it sounds like the bulk of your data survived and on a 200GB disk that in and of itself is a good thing. It could have been a lot worse. I've seen that happen where no amount of fiddling with the copy resulted in the recovery of the file system.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.