Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

bad superblock - reiserfs

Posted on 2004-03-22
10
Medium Priority
?
1,625 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

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.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

636 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