use master hd to retrieve files from broken slave hd??
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
use master hd to retrieve files from broken slave hd??
Hi!
I wasn't sure where to post this one so I chose to post it here.
My hard drive just crashed. I had fedora core 5 installed on it and I could manage to save some of my files with the malfunctioning distro but now this is jus impossible. I tried running Knoppix but it didn't even work. So mow I'm trying a last deperate move.
I installed an older hd that I had been keeping just in case (lucky me). I installed it as the master hd and moved the broken one as the slave and I've set the BIOS accordingly. I was hoping that running a linux distro on that hd would allow me to retrieve the remaining data ont the broken one but all my attempts have failed so far. I've tried Knoppix, Ubuntu, FC3, FC5, Mandriva 2006, always I got a message telling me that hdb1 has a problem (except for mandriva and Ubuntu that just jammed without telling me anything). I want it to run on hda.
Is there something that I'm doing wrong? Can somebody help me please?
First, what do you mean by "crashed"? If the drive has physically failed in some way, then you are not going to access it with any program. Does the drive run when you turn on the computer? Does it make any unusual noises?
If there is evidence that there has been a physical failure, then you probably have no option but to take it to a recovery service**. Otherwise:
Using a live CD distro, boot up the machine, enter the BIOS setup, and verify that the BIOS recognizes that the drive is there. (You can also maybe do this just be watching the messages during boot.) Continue to boot to the live CD. Once that is running, open a terminal and type "fdisk -l" (without the quotes). That should show that you have two drives. Post the output here.
Assuming that the system is seeing the drive, then doing something like fsck might be the next step.
BUT--Before going too far: If the data is really valuable, consider first cloning the "bad" drive--and then physically removing it from the system. Then you can freely tinker with the clone without risking further loss of data.
**I won't recommend this, but here is one story:
Periodically, my laptop would fail to start up. Usually, just trying again would get it going. Finally one day no amount of on-off cycling would get it to start up. Eventually, I noticed that the drive was not spinning. I shut down the power and gave the thing a solid smack in the approximate location of the drive. It then started up just fine.
The next morning, I turned in to our IT people with instructions to replace the drive. Luckily, no data was lost.
BUT--Before going too far: If the data is really valuable, consider first cloning the "bad" drive--and then physically removing it from the system. Then you can freely tinker with the clone without risking further loss of data.
Close.
You need (at least) TWO copies. One to play with, and one to restore that from when your playing goes amiss.
I finally managed to have a distro working in that compurter; I'm using Knoppix in text mode.
No I don't think that it was a physical crash. It's not making any weird noise and when Knoppix boots it recognizes the broken hd as hdb. I thinmk it's rather a matter of corrupt sectors. When I do the fdisk -l command here's what I get:
PHP Code:
Disk /dev/hda: 6448 MB, 6448619520 bytes 240 heads, 63 sectors/track, 833 cylinders Units = cylinders of 15120 * 512 = 7741440 bytes
Device Boot Start End Blocks Id System /dev/hda1 * 1 14 105808+ 83 Linux /dev/hda2 15 833 6191640 8e Linux LVM
Disk /dev/hdb: 40.0 GB, 40060403712 bytes 255 heads, 63 sectors/track, 4870 cylinders Units = cylinders of 16065 * 512 = 8225200 bytes
Device Boot Start End Blocks Id System /dev/hdb1 * 1 13 104391 83 Linux /dev/hdb2 14 4870 39013852+ 8e Linux LVM
So obviously this drive is working. Now my question is what is the next step? How can I clone that broken drive (hdb)? Are there special commands that I have to do to see the data that's stored on it?
Did you try the simple step first? Boot a LiveCD (Knoppix, etc.) and run fsck on the filesystem(s) on your "bad" disk. See what that tells you. I would not tell fsck to automatically attempt to repair things just yet. Just try to diagnose. Writing to a corrupt filesystem can make things worse, so don't attempt it without some serious thought and analysis first.
Here's a thread about a similar problem from a while back. That was apparently a hardware failure though. You may or may not have that. We don't know yet.
Read the whole thread, but don't miss checking out the links for ddrhelp and ddrescue in post #7 (the last post in that thread currently). You may or may not end up needing those programs.
Since your problem may be only filesystem corruption with no hardware problems, you might be able to get by using only the dd command to clone the drive. If your problem appears serious, and/or your data is important to you, I would clone the drive and then attempt repairs on the clone. Leave the original alone. If dd fails and you are forced to try ddrescue and ddrhelp to clone, then that qualifies as "serious"!
Yeah, sorry. I had more important stuff to take care of and I put that aside for a while.
I bough a new 80G hd and installed it as the new master drive. Ok so I did as you suggested haertig and using Knoppix, I ran fsck on the broken drive (after making sure that it was unmounted of course) and I got the following:
# fsck /dev/hdb2
fsck 1.39-WIP (09-Apr-2006)
e2fsck 1.39-WIP (09-Apr-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/hdb2
The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or sometthing else), then the superblock is currupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
This partition is supposed to be a ext3 filesystem and when I run the e2fsck -b 8193 /dev/hdb2 command, I get the same message as the one in teh second box. And it doesn't change a thing even if I use fsck.ext3.
There is more than one (backup) superblock; try mke2fs with "-n" to find out where they are located. Try a few of them - if they all fail, you're probably out of luck.
Ok, so here how things are. I've done the mke2fs command and here's what I got:
Code:
mke2fs -n /dev/hdb2
mke2fs 1.39-WIP (09-Apr-2006)
OS type: Linux
Block size=4096 (log=2)
4882432 inodes, 9753463 blocks
487673 blocks (5,00%) reserved for the super user
First data block=0
298 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654200, 4096000, 7962624
I've done the e2fsck -b <superblock number> /dev/hdb2 command for each of the numbers above and I always got the same message:
Quote:
fsck.ext2: Bad magic number in super-block while trying to open /dev/hdb2
The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or sometthing else), then the superblock is currupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
So should I conclude that my hd is doomed?
Maybe I should try to use dd_rescue and dd_rhelp anyway; unless there is a risk of screwing up my new hd as well.
Hopefully just a filesystem problem - copying it to another drive won't harm the target drive.
Haven't tried it, but ddrescue looks like a good utility. Note this is different to dd_rescue.
When you finally give up, just reformat the partition, and see if it shows any underlying problems.
How old is the HDD? What brand/manufacturer is it? You could try going to the manufacturer's website and see if they have any low level diagnostic tools. Seagate has one such downloadable tool, named "SeaTools". You either write it to a floppy or a CD, and then boot from that CD/floppy and run the (non-destructive) diagnostic. This might help you determine if you have a hardware (disk) or a software (filesystem) problem.
I'm sorry I Haven't given any sign of life for a while but final exams are simething we can't mess with, right?
Ok, first of all I want to thank each and everyone of you for the help you've kindly given me.
Now back to my problem. I started to try some of the latest advices like those great forensic distros (I've tried Helix) and I've also tried the HD maker's diagnosis tool (Samsung's Hutil which is supposed to work with the SP4002H model). However, no matter how many times I tried there always was a bug that prvented the things from working.
Sick and tired, I've decided to give up, remove that darn HD and do a Linux install on my new drive (80 Gb Western Digital's WD800JB model). Only now there's a new problem because no mattere which distro I try it doesn't work!
FC5: This one was a true bliss on that computer before it crashed. But when I installed it, the installer told me that it had encountered a bug at the very last minute when I inserted the 5th CD and it went all kaflooey.Then, when I subsequently tried to install again, it crashed in the middle of the process.
Ubuntu: It jammed while booting from the CD.
Knoppix: Same thing. It starts loading the graphical interface then stop and gives me the following message
Quote:
Xwindow session terminated with errors
Please check and retry 'etc/init.d/xsession start'
The problem is that I can't manage to make my distros work in graphical mode!
Makes me wonder now what really is malfunctionning.
Check the RAM in the system.. Bad RAM will cause errors from just about any action on a system.. from Read errors reading files from a CDROM to corrupting files written to the hard drive, to causing files to fail their crc checks..
I would start by testing the memory very thoroughly..
check out memtest86+ a bootable iso for testing RAM. then go on from there if that passes..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.