• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1626
  • Last Modified:

bad superblock - reiserfs

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?!
0
hldn
Asked:
hldn
  • 5
  • 5
1 Solution
 
jlevieCommented:
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.
0
 
hldnAuthor 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?
0
 
jlevieCommented:
That's a lot of bad blocks to have show up on a drive and it may mean the drive is close to complete failure. dd_rescue will probably transfer what it can read to another disk, but making sense out of the result is still iffy. If the data is really valuable I'd try replicating it on a replacement drive and then trying to repair that file system. I certainly wouldn't do anything that would write to this drive as it may just make things worse.

About all you can to to protect against this sort of failure in the future is to institute regular backups of the data, preferrably to tape media. You might also consider placing two drives in the configuration and using RAID 1 to mirror the data. The latter will protect against a single disk failure and a good backup strategy with history will protect against file system errors that would affect both parts of a RAID 1 mirror.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
hldnAuthor 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.
0
 
jlevieCommented:
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.
0
 
hldnAuthor Commented:
good deal.. thx a bunch friend.
0
 
hldnAuthor 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?
0
 
jlevieCommented:
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.
0
 
hldnAuthor Commented:
warg.. thats what i figured.. was just hoping there was an easier way.. thanks again though.
0
 
jlevieCommented:
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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now