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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
12-27-2004, 06:51 AM
|
#1
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Rep:
|
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
|
|
|
12-27-2004, 08:20 AM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
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
|
|
|
12-27-2004, 09:34 AM
|
#3
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
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.
|
|
|
12-27-2004, 12:40 PM
|
#4
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
12-27-2004, 02:32 PM
|
#5
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
12-27-2004, 03:28 PM
|
#6
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
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
|
|
|
12-27-2004, 05:27 PM
|
#7
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
12-27-2004, 05:39 PM
|
#8
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
...and maybe take a look at the output of " #fdisk -l /dev/sda " to check.
( strange error " no such device " ? )
egag
|
|
|
12-27-2004, 06:11 PM
|
#9
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
12-27-2004, 06:21 PM
|
#10
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
ok.
you can make as many mountpoints as you need.
can you post that output for " #fdisk -l /dev/sda " ?
egag
|
|
|
12-27-2004, 06:32 PM
|
#11
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
12-27-2004, 06:38 PM
|
#12
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
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
|
|
|
12-27-2004, 06:52 PM
|
#13
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
12-27-2004, 07:09 PM
|
#14
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
the same for you.... 
Linux is great !
egag
|
|
|
01-16-2005, 12:01 PM
|
#15
|
Member
Registered: Apr 2002
Location: Philadelphia
Posts: 48
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 07:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|