?
Solved

bad superblock - reiserfs

Posted on 2004-03-22
10
Medium Priority
?
1,622 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

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
 

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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

762 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