LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting an External Hard Drive Manually Using Terminal (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-an-external-hard-drive-manually-using-terminal-529862/)

pjmaggitti 02-17-2007 05:56 AM

Mounting an External Hard Drive Manually Using Terminal
 
What terminal command should I use to mount an external hard drive that Ubuntu 6.10 did not recognize during installation? I understand that I should use either /mnt/hdb1 or /media/hdb1, but do I just open terminal and plop one or the other of those commands into the first blank space, or do I need to be at a specific location in terminal to which I do not know how to navigate as yet? Right now when I open terminal, what I see is -- pjm@pjm-desktop:~$ What do I do after that?

Thank you for your patience, you're going to need it.

Phil

Samoth 02-17-2007 06:56 AM

Just open a terminal and type:
Code:

mount /dev/<insert device> /mnt/hdb1
You don't have to be anywhere in the terminal. You could be in /usr/share/doc/xxx/docs/html for all the shell cares. As long as you put a leading "/" on it, it will know to go to the top of the heirarchy and you won't have a problem.

Lenard 02-17-2007 07:13 AM

First un-plug this external hard drive from the system (this is a USB hard drive correct??) Then plug the external drive back in. As root or equivalent check the tail end of /var/log/messages;

tail /var/log/messages

Example:
Code:

$ sudo tail /var/log/messages
Feb 17 08:00:13 Aspire5000 kernel: scsi 5:0:0:0: Direct-Access    WDC WD80 0VE-75HDT1      0000 PQ: 0 ANSI: 0
Feb 17 08:00:13 Aspire5000 kernel: SCSI device sdc: 156301488 512-byte hdwr sectors (80026 MB)
Feb 17 08:00:13 Aspire5000 kernel: sdc: Write Protect is off
Feb 17 08:00:13 Aspire5000 kernel: sdc: assuming drive cache: write through
Feb 17 08:00:13 Aspire5000 kernel: SCSI device sdc: 156301488 512-byte hdwr sectors (80026 MB)
Feb 17 08:00:13 Aspire5000 kernel: sdc: Write Protect is off
Feb 17 08:00:13 Aspire5000 kernel: sdc: assuming drive cache: write through
Feb 17 08:00:13 Aspire5000 kernel:  sdc: sdc1
Feb 17 08:00:13 Aspire5000 kernel: sd 5:0:0:0: Attached scsi disk sdc
Feb 17 08:00:13 Aspire5000 kernel: sd 5:0:0:0: Attached scsi generic sg2 type 0

As you can see from the example the USB hard drive is seen as device sdc and has one partition (sdc1) so this external hard drive and partition is device: /dev/sdc1

To mount this device as root or equivalent type something like;

mkdir /mnt/USB
mount -t auto /dev/sdc1 /mnt/USB -rw

The first command creates the location to mount the device to, the second mounts the device to this location (mountpoint) as read/writeable. you should be able to access the directories and files by looking in this location /mnt/USB, for example; ls -al /mnt/USB

To un-mount the device type something like; umount /mnt/USB

See the manpages for the details and additional information;

man mount
man tail
man mkdir
man umount

Samoth 02-17-2007 07:57 AM

Oh, just so you know if you get errors about "the device being busy" when you try to unmount it, make sure you aren't in the directory where you mounted it. For example, if I mount my USB pendrive to /mnt, and I want to unmount it, I have to leave /mnt before I can unmount the drive.


All times are GMT -5. The time now is 09:55 AM.