[SOLVED] How mount and read hard drive from another linux system
Linux - NewbieThis 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.
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.
How mount and read hard drive from another linux system
I'm trying to mount a hard drive that was used on a FC 4.0 system on a headless Ubuntu 11.04 server. I need to be able to read the information on the old drive. I created a mount point: /mnt/backup then ran the following command with this result.
root@GX300:/mnt/backup# mount -t vfat /dev/sda /mnt/backup
mount: /dev/sda already mounted or /mnt/backup busy
I don't know why /mnt/backup would be busy and /etc/mtab doesn't list sda.
Can someone tell me what I'm doing wrong?
Last edited by smbrooks; 08-23-2011 at 12:12 AM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
One thing is that you usually mount partitions, rather than the device itself (so you should be trying to mount, e.g. /dev/sda1). Are you sure you've got the right device? Post the outputs of fdisk -l (lowercase L) and mount, so we can see the partition table(s) and what's already mounted.
Run this:
df -hT
to see what's mounted already. You might want to change out of that directory too. Mount balks when you are in a directory you're trying to mount or umount a file system to. Give us the output of the aforementioned command.
I agree check to make sure it isn't all ready mounted, Ubuntu will autodetect a lot of things and may auto mount the drive. check /media. Further you are referencing sda which is usually the main hard drive the OS is on. Even though this device may have been sda on the fedora system in this new one it is likely sdb or sdc depends on how many drives you have in the system (including CD drives etc....)
Nylex also has a good point you will need to mount actual partitions not the drive itself, so whatever sd* it is you will need to append the partition number to it as well. You will likely have at least 2 partitions 1 for swap and one for the root, more if you had things set up differently.
Last edited by scheidel21; 08-23-2011 at 01:44 PM.
Reason: add more information.
Thanks everybody. Though I've searched for and found answers on this forum I've never actually asked a question. I'm bowled over by the response.
I have done what you all have asked and I'll attach information at the end of this post. schneidz you are correct - the disk I'm trying to attach appears to be ext3. I tried running the same commands with that change and received the same result.
Additional info:
I brought up this system when fc4.0 was current, installed LAMP and used it as a test bed for web development. Then, I used it as a backup file server. It's an old Pentium 3 or 4 with 512k memory. I'm doing some experimentation with wordpress and remembered this old server. Then I hosed up MySQL to the point it seemed simpler to reinstall and start over. That was mistake number 1. I had several more learning experiences before posting this question. I like Linux more all the time. Reminds me of the days when command lines were all we had.
sdb is a fast SCSI 80G drive and the one on which I installed the boot sector, swap partition and all the operating system files.
sda is a 200G ATA drive. It was mounted and working in the FC system before I installed the Natty distro. I used it to back up two or three systems using backup software that is no longer used here. Those systems are now out of commission but the backup files, God forbid I should ever need them, are all that survived a direct lightening strike to the facility which knocked us all the way back to tape.
I remember it was originally mounted as /mnt/backup or (Backup) so tried to duplicate that.
Installing current versions of Fedora failed. But, I was successful with Ubuntu 11.04 server. When I brought up the OS I didn't try to partition backup drive since I wanted to save the info and believed that I could mount it after getting a working Linux OS.
Here is output from the commands for the questions you've asked:
root@GX300:/home/smbrooks# fdisk -l > pig
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2 doesn't contain a valid partition table
root@GX300:/home/smbrooks# nano pig
GNU nano 2.2.6 File: pigr
Number Start End Size Type File system Flags
1 1049kB 256MB 255MB primary ext2 boot
2 257MB 36.8GB 36.5GB extended
5 257MB 36.8GB 36.5GB logical lvm
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/GX300-swap_1: 533MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 533MB 533MB linux-swap(v1)
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/GX300-root: 36.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 36.0GB 36.0GB ext4
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/Backup-Backup: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 200GB 200GB ext3
------------------------------------------------------------------
I hope I'm being clear. I'm a stranger in a strange land. Thanks again for your help.
Did you try mounting sda1? instead of just sda. The only thing that I see that concerns me of all the output you posted is that /dev/dm-0 has no partition table, if i read the rest of the output correctly the sda is dm-0
Yes, I did try mounting sda1 with an identical result. I don't know what to do with the device management mappings that will help me mount the drive. Do you think LVM is getting in the way in any way?
I don't think so I think it has to do with a bad or non-existent partition table this is what concerns me in the output of what you posted
Code:
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-0: 200.0 GB, 200047329280 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
what does, however, seem odd is that you have a 200GB disk as /dev/dm-0 and /dev/sda it appears they are the same disk, at least to me. I suppose you could also try mounting /dev/dm-0 or /dev/dm-1 as well.
Your 200gb drive is your primary boot, the one your OS is on. It has one partition, /dev/sda1. You can't mount it because it's LVM and it's already mounted. Your 36gb drive is /dev/sdb and it has three partitions, /dev/sdb1, /dev/sdb2 and /dev/sdb5. Good old LVM has /dev/sdb2 and /dev/sdb5 labeled as "extended" and "logical lvm". Personally I hate LVM. It's confusing. I always use conventional partitioning during an install, but it's too late for that here. Make a directory:
mkdir /mnt/sdb2
and try mounting /dev/sdb2:
mount /dev/sdb2 /mnt/sdb2
If that doesn't mount your 36gb partition try this:
mkdir /mnt/sdb5
mount /dev/sdb5 /mnt/sdb5
Of course do
df -hT
after each attempt to see if either partition mounts. You are right in a way, LVM is screwing with you. I hope this doesn't start a dispute over LVM but if it does maybe we will all learn something. But as for me I think a person should know beforehand what partitions they want, right? LVM is all about resizing partitions safely. If partition size is getting to be a problem a person should add another hard drive. Bring it, LVM fans! Anyway, hope this helps the OP.
EDIT
Wait a minute, I just saw something. Try this:
mkdir /mnt/sda1
mount /dev/mapper/Backup-Backup /mnt/sda1
Then do:
df -hT
just for kicks and giggles.
Last edited by SharpyWarpy; 08-24-2011 at 01:13 AM.
Reason: Wait a minute:
Sharp, you sure about this he stated that the smaller 80GB drive (sdb) was the drive he installed the OS on, and sda the 200GB drive was the one from the other system. sda and sdb will simply be assigned based on what port on the mobo it is plugged into (and jumper position or cable select on IDE interfaces)
Scheidel - that worked but I really don't understand why. I was able to mount dm-0. That would never have occurred to me. Have I mounted a symlink? I need to bone up on LVM.
Quote:
what does, however, seem odd is that you have a 200GB disk as /dev/dm-0 and /dev/sda it appears they are the same disk, at least to me. I suppose you could also try mounting /dev/dm-0 or /dev/dm-1 as well.
I can read the drive and the backup information is all there. Success! But I have no idea why that worked. And what kind of a mess do I have that may rear up and bite me later. How can I clean this up? Have I screwed up the installation?
Just for giggles, I tried mounting Backup-Backup. (I have no idea where that came from.)
It works the same as mounting dm-0. Now I'm so confused I'm numb.
To clarify: The 80G drive is a scsi drive attached to its own controller on the PCI bus. It has the OS installed on it. The 200G drive is running off the EIDE bus. The system is confused by a DVD drive installed that the Bios doesn't support. I thought I had disconnected it.
Sharp, you sure about this he stated that the smaller 80GB drive (sdb) was the drive he installed the OS on, and sda the 200GB drive was the one from the other system. sda and sdb will simply be assigned based on what port on the mobo it is plugged into (and jumper position or cable select on IDE interfaces)
No, actually I'm not at all sure. LOL. I'm like OP, LVM is confusing. See my edit to that post. One note here. OP mentioned he had a DVD drive installed the bios didn't recognize. It reminded me of something I read in an Intel motherboard manual. It said don't install a CD/DVD drive as a master drive on the IDE channel. This particular board I'm talking about has one IDE channel to accomodate two IDE devices and four SATA channels. Weird. But no, I'm never sure about anything any more.
Last edited by SharpyWarpy; 08-24-2011 at 01:13 PM.
Reason: typo
LVM shouldn't have had anything to say about the 200GB drive unless it was added to the LVM. It seems to me like the device wasn't being mapped properly. Either way I am glad the issue is resolved for you.
SHarp where did you see /dev/mapper/backup-backup that triggered your thought?
LVM shouldn't have had anything to say about the 200GB drive unless it was added to the LVM. It seems to me like the device wasn't being mapped properly. Either way I am glad the issue is resolved for you.
SHarp where did you see /dev/mapper/backup-backup that triggered your thought?
From this (excerpt from OP running parted -l command):
----------------------------------------------------------------------------------
root@GX300:/media# parted -l
Model: ATA ST3200822A (scsi)
Disk /dev/sda: 200GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 512B 200GB 200GB primary boot, lvm
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.