Solved

bad superblock - reiserfs

Posted on 2004-03-22
10
1,610 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?!
0
Comment
Question by:hldn
  • 5
  • 5
10 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 10659177
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
 

Author Comment

by:hldn
ID: 10660157
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
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
ID: 10660501
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
 

Author Comment

by:hldn
ID: 10661508
>> 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
 
LVL 40

Expert Comment

by:jlevie
ID: 10661623
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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:hldn
ID: 10661668
good deal.. thx a bunch friend.
0
 

Author Comment

by:hldn
ID: 10688919
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
 
LVL 40

Expert Comment

by:jlevie
ID: 10690381
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
 

Author Comment

by:hldn
ID: 10692171
warg.. thats what i figured.. was just hoping there was an easier way.. thanks again though.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 10692354
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now