LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 11-14-2006, 01:50 PM   #1
Iltbreg
Member
 
Registered: Feb 2006
Location: Canada
Distribution: Fedora, Mandriva
Posts: 191

Rep: Reputation: 31
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?


Thank you for your time.

Last edited by Iltbreg; 11-14-2006 at 01:53 PM.
 
Old 11-14-2006, 02:58 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 11-14-2006, 04:37 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,143

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by pixellany
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.
 
Old 11-14-2006, 06:04 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by syg00
Close.
You need (at least) TWO copies. One to play with, and one to restore that from when your playing goes amiss.
OK--Another coat of paranoia never hurt anyone....
 
Old 11-15-2006, 06:36 PM   #5
Iltbreg
Member
 
Registered: Feb 2006
Location: Canada
Distribution: Fedora, Mandriva
Posts: 191

Original Poster
Rep: Reputation: 31
Thanks for answering.

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/hda6448 MB6448619520 bytes
240 heads
63 sectors/track833 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/hdb40.0 GB40060403712 bytes
255 heads
63 sectors/track4870 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?
 
Old 11-15-2006, 07:00 PM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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.

http://www.linuxquestions.org/questi...hlight=ddrhelp

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"!
 
Old 12-01-2006, 12:48 PM   #7
Iltbreg
Member
 
Registered: Feb 2006
Location: Canada
Distribution: Fedora, Mandriva
Posts: 191

Original Poster
Rep: Reputation: 31
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:

Quote:
# fsck /dev/hdb1
fsck 1.39-WIP (09-Apr-2006)
e2fsck 1.39-WIP (09-Apr-2006)
1boot: clean, 36/26104 files, 17738/104388 blokcs
Quote:
# 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.

Last edited by Iltbreg; 12-01-2006 at 12:56 PM.
 
Old 12-01-2006, 06:05 PM   #8
Iltbreg
Member
 
Registered: Feb 2006
Location: Canada
Distribution: Fedora, Mandriva
Posts: 191

Original Poster
Rep: Reputation: 31
Sorry for double posting, but here's what's in fstab (if it can be of any use):

Code:
cat /etc/fstab

/proc     /proc     proc    defaults   0 0
/sys      /sys      sysfs   noauto     0 0
/dev/pts  /dev/pts  devpts  mode=0622  0 0
/dev/fd0  /media/fd0  auto    user,noauto,exec,umask=000   0 0
/dev/cdrom  /media/cdrom   auto   user,noauto,exec,ro   0 0
/dev/hdc  /media/hdc   auto   user,noauto,exec,ro   0 0
#Added by KNOPPIX
/dev/hdb1  /media/hdb1   ext3   noauto,users,exec   0 0
#Added by KNOPPIX
/dev/hdb2  /media/hdb2   auto   noauto,users,exec   0 0
#Added by KNOPPIX
/dev/hda  /media/hda   auto   noauto,users,exec   0 0
 
Old 12-01-2006, 06:42 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,143

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 12-02-2006, 07:51 PM   #10
Iltbreg
Member
 
Registered: Feb 2006
Location: Canada
Distribution: Fedora, Mandriva
Posts: 191

Original Poster
Rep: Reputation: 31
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.
 
Old 12-02-2006, 09:25 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,143

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 12-02-2006, 10:06 PM   #12
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Personally I would have used a Live distro that was put together for forensics work. it would have more tools available for file recovery attempts..

http://www.livecdlist.com/?pick=All&...ics&sort=&sm=1

Or the Secure DVD which gives the choice of any of 10 different forensics live cd's at boot...

http://www.securedvd.org/about.html


Best of luck to ya..
 
Old 12-03-2006, 03:52 PM   #13
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by Iltbreg
So should I conclude that my hd is doomed?
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.
 
Old 12-19-2006, 02:17 PM   #14
Iltbreg
Member
 
Registered: Feb 2006
Location: Canada
Distribution: Fedora, Mandriva
Posts: 191

Original Poster
Rep: Reputation: 31
Hi!

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.


Best regards

Last edited by Iltbreg; 12-19-2006 at 02:26 PM.
 
Old 12-19-2006, 06:11 PM   #15
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
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..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Master and slave? Siiiiiii Linux - Hardware 4 05-27-2006 03:53 PM
Linux harddisk converted from master to slave. What files to change? jagot Linux - Hardware 6 03-05-2006 11:59 AM
Running Fedora 4 on primary master and cant acsess my xp files on primary slave roxberry1 Linux - Newbie 5 01-29-2006 11:37 AM
Slave to Master? s9722 Linux - General 6 02-23-2004 10:34 PM
Moving files from Master to Slave drives ch4s3r Linux - Software 11 10-23-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration