LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-27-2004, 06:51 AM   #1
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Rep: Reputation: 15
How to get data off a drive that once held the operating system.


Hi,

A few days ago I had inadvertently deleted the entire /lost+found, /sbin, /tmp and /lib directories from my RH 7.2 system which resided on /dev/sda. (I can explain this stupidity, if you really need to know.)

There were a total of four drives in the system, all easily accessible from the front panel. I removed all four drives and placed the drive from position /dev/sdd to position /dev/sda and was successful in installing RH Enterprise AS 3.0 on that drive. The new system works perfectly.

But, I needed to get data off the drive that held RH 7.2. So, after the new system was working, I shut off the machine and slipped the RH 7.2 drive into position /dev/sdd. But, when I tried to boot, I got a bunch of red "[FAILED}" messages. Many of them said that certain files in /etc were read-only. So, I shut down the system and removed the the old RH 7.2 drive. I rebooted into RH Enterprise and everything appears to be working fine.

Question 1: Did I do any damage to my new system installation?

Question 2: How do I safely get valuable information off the drive that holds the old RH 7.2?

Peter
 
Old 12-27-2004, 08:20 AM   #2
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
well...could it be that your pc. tries to boot from sdd when there's a drive there ? ( would be strange eh... ).

what you can do , is use a rescue or live-cd ( or maybe an install-cd from FC3 ), and boot from there to a command-line.
then mount both disk-partitions to transfer data from one to the other.

( your new install will be ok i guess )

egag
 
Old 12-27-2004, 09:34 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
You might be able to effect a fix quite easily. Edit your /etc/fstab in RHE, and remove any reference to /dev/sdd. That way, when you try to boot with the RH 7.2 disk in place, grub won't try to mount it (thus generating all the failed messages). Once booted, put the line back into fstab, make sure the mount point given in fstab exists, then mount the device with the mount command. That gives you access to the files there, but doesn't try to boot that partition.
 
Old 12-27-2004, 12:40 PM   #4
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
Right now I am at the point where I have booted from the linux install CD and am trying to mount my drives so I can edit them. I haven't been able to figure out how to mount a drive from the command prompt. Can someone help?

Peter
 
Old 12-27-2004, 02:32 PM   #5
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
Well, I got a little further. I was able to mount the vfat /boot/efi partition of the old RH 7.2 hard drive. None of the other partitions could be mounted. I think the others are ext3, but they may be ruined for mounting.

It would have been great if I had control of the /boot/efi partition in order to disable it. But, I was thwarted. As soon as that partition was mounted, none of the shell commands provided in rescue mode would work. These shell commands are all controled by the program on the CDROM /usr/bin/collage. However, once the /boot/efi partition of the /dev/sda drive was mounted, the commands rm, mv, ls and many others were not to be found. The faulty old drive had taken control.

Peter
 
Old 12-27-2004, 03:28 PM   #6
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
you should be able to mount the other partitions with :

#mount -t ext3 /dev/sddx /<mountpoint > ( x = 1,2,3...etc; mountpoint= an empty directory )
did you try such a command ?
( or how did you mount it ...?)

and i think it's not possible for the old drive ( or the OS on it ) to take control.

egag
 
Old 12-27-2004, 05:27 PM   #7
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
Hi egag,

I was able to mount the /boot/efi partition of the RH 7.2 drive (in the top drive slot) with:

#mount -t vfat /dev/sda1 /mnt

As soon as that partition was mounted. I could not use any of the following commands: ls, rm, mv, find, .... The error message 'file /usr/bin/ls could not be found" was exactly the same as I got when I had inadvertently erased the /sbin, /tmp and /lib directories from the RH 7.2 drive. In fact, it was the erasing of the /lib directory that first created the loss of the "ls" command.

I re-booted to rescue mode and tried the following:

#mount -t ext /dev/sdax /mnt where x=2(usr), 6(var) and 4(/)
#mount -t ext2 /dev/sdax/mnt
#mount -t ext3 /dev/sdax /mnt

Unfortunately, none of these worked. The error message was "no such device".

The only thing of which I am not sure (but I will check) is to see if /mnt is empty. I'll let you know if that makes a difference.

Peter
 
Old 12-27-2004, 05:39 PM   #8
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
...and maybe take a look at the output of " #fdisk -l /dev/sda " to check.
( strange error " no such device " ? )

egag
 
Old 12-27-2004, 06:11 PM   #9
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
Hi egag,

You were absolutely right. My mistake was that I had mounted the /boot/efi partition in a non-empty directory. I didn't realize that I could use mkdir to make an empty one. Now, when I mount the /boot/efi partition, no harm comes to the command set.

Unfortunately, I am still not able to mount the other partitions. However, I will try your latest suggestions and will keep working at it.

Peter
 
Old 12-27-2004, 06:21 PM   #10
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
ok.

you can make as many mountpoints as you need.
can you post that output for " #fdisk -l /dev/sda " ?

egag
 
Old 12-27-2004, 06:32 PM   #11
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
Hi egag,

You definitely know what you are talking about. I just used #fdisk -l /dev/sda (I had totally forgotten to try that). The bad news is that /dev/sda1 is the only partition I found and somehow it occupies the entire 18GB disk, but contains only the boot files. I can't figure out how that happened. That must be why I could not mount any other partitions. I wonder if there is any other more powerful way to get at the data that resided in what used to be /dev/sda6.

Thanks for all your help.

Peter
 
Old 12-27-2004, 06:38 PM   #12
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
well...maybe try a program called " testdisk ".
( use google to find it , i beleeve it's free )
i read from several people that they were able to get data from corrupted disks.

good luck.

egag
 
Old 12-27-2004, 06:52 PM   #13
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
hi egag,

Again, thanks so much for the help. I will look for testdisk.

Someday, I hope to be able to help others with Linux. I certainly learned a lot today about Dell 7150 hardware, linux installation and troubleshooting.

Hope you have a great 2005.

Peter
 
Old 12-27-2004, 07:09 PM   #14
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
the same for you....
Linux is great !

egag
 
Old 01-16-2005, 12:01 PM   #15
phahn
Member
 
Registered: Apr 2002
Location: Philadelphia
Posts: 48

Original Poster
Rep: Reputation: 15
Hi egag,

I took your suggestion and downloaded TestDisk. Can you give me some simple instructions. Do I have to make or download a rescue (boot) disk to use TestDisk? Must I compile TestDisk before I can use it? I am trying to read the documentation provided in the doc directory, but it is a bit confusing.

Peter
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'Operating System Missing' Eerath Linux - Newbie 6 02-24-2005 02:11 PM
installing linux on unformatted hard drive with no operating system gjhowar Linux - Newbie 4 08-18-2004 04:29 PM
Why Linux is best Operating System for Learning/Doing System Programming ? ubaid_t General 6 03-21-2004 02:10 PM
name of the operating system emmanuelmathew Linux From Scratch 5 02-11-2003 09:14 AM
operating system name emmanuelmathew Linux - General 9 02-11-2003 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:32 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