LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mount 2nd Hard disk (https://www.linuxquestions.org/questions/linux-newbie-8/mount-2nd-hard-disk-784910/)

bjlatt 01-26-2010 02:56 PM

Mount 2nd Hard disk
 
Forgive the simplicity of this, but is it possible to mount a 2nd hard disk without erasing the data that is already on it? If so, what command must I enter. The system recognizes that thedisk is there, I just can't access the data because it hasn't been mountred.

Thank you

EricTRA 01-26-2010 03:01 PM

Hello,

Mounting a disk doesn't do anything other then make a file system accessible. So you can easily mount it and then access the data on it. The most simplest way is to create a directory and then mount your disk:
Code:

mkdir /mnt/mydisk
mount /dev/yourdevice /mnt/mydisk

There are a lot of options that you can give to mount. Check them out with
Code:

man mount
Kind regards,

Eric

MTK358 01-26-2010 03:02 PM

Why would mounting a disk possibly erase the data on it?

Just use the command (as root):

Code:

mount /dev/??? /path/to/mount/point
And to unmount (as root):

Code:

umount /path/to/mount/point
Note that the command is umount, not unmount.

worm5252 01-26-2010 03:05 PM

Yes this is possible. You can do it in a command terminal very easily. To do it you must have root privileges so you want to either su to become root or use sudo to mount the drive.

First you need a mount point. I like to just create folder in /media.
Code:

sudo mkdir /media/drive2
Next you want to find out what the device assignment is for the drive. to do this I like to use fdisk
Code:

sudo fdisk -l
You should see /dev/sda or /dev/hda for your primary drive. You should also see your 2nd drive listed as /dev/sdb or /dev/hdb

Assuming your 2nd disk is /dev/sdb you can mount it to your mount point by using the mount command. The mount command works like so
Code:

sudo mount -t [filesystem type] [device partition to be mounted] [location of mount point]
so assuming that you have 1 partition on your 2nd drive and it is a Windows ntfs partition you could mount it like this
Code:

sudo mount -t ntfs-3g /dev/sdb1 /media/drive2
Then you can view the contents of the 2nd drive by going to /media/drive2

MTK358 01-26-2010 03:09 PM

I didn't know about fdisk -l, it seems very helpful!

worm5252 01-26-2010 03:22 PM

I like fdisk -l. It is good for listing the partition tables of a drive so you can see what is going on.


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