LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-05-2009, 04:41 PM   #1
LiNuXMaN31509
LQ Newbie
 
Registered: Jun 2009
Location: Houston Texas (Born in Brooklyn NY)
Distribution: CentOS
Posts: 25

Rep: Reputation: 0
Smile Mounting External Drive


I know for most this is gonna be something really simple but I am new and I have searched but I was unable to find what I was looking for I don't know how I even didn't find it but I am trying to mount an external HHD in Gentoo.

On other versions of linux it comes up on its own but in gentoo you know you have to do everything manually but what is the command to mount it or how do I even know the computer is picking it up?

Thank you in advance for your time and help!

-LiNuXMan31509
 
Old 09-05-2009, 05:21 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by LiNuXMaN31509 View Post
I know for most this is gonna be something really simple but I am new and I have searched but I was unable to find what I was looking for I don't know how I even didn't find it but I am trying to mount an external HHD in Gentoo.

On other versions of linux it comes up on its own but in gentoo you know you have to do everything manually but what is the command to mount it or how do I even know the computer is picking it up?

Thank you in advance for your time and help!

-LiNuXMan31509
First, check the listings in the /dev directory. You should see files like /dev/sda1, or /dev/hdd1, etc. Those are your hard drive partitions, the numbers are the partitions on the drive, while the sd or hd are the device ID's. Plug in your external drive, and you should see more of them pop up...if you've got /dev/sda1 and /dev/sda2, you'll probably see /dev/sdb1 and the like 'appear' in the /dev directory. You can also just type in dmesg, after plugging in the device, and see what it tells you...the name will be towards the bottom, somewhere.

The mount command is simple, check the man page for mount, but it's essentially:
Code:
mount <device> <mount point>
the mount point is just a directory. I'd make one just for mounting devices, something like /media. So if your device is /dev/sdb1, the command would be
Code:
mount /dev/sdb1 /media
Make more directories/sub-directories, so you can mount more devices...enjoy.
 
Old 09-05-2009, 05:32 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You should start by running dmesg soon after attaching the extern HDD. It should indicate that a device has been detected, and with luck it will name the logical device. Here is a sample from a USB pendrive plugging in
Code:
usb 5-2: new high speed USB device using ehci_hcd and address 3
usb 5-2: configuration #1 chosen from 1 choice
scsi9 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
usb 5-2: New USB device found, idVendor=0781, idProduct=5406
usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-2: Product: U3 Cruzer Micro
usb 5-2: Manufacturer: SanDisk Corporation
usb 5-2: SerialNumber: 0000155E39600D87
scsi 9:0:0:0: Direct-Access     SanDisk  U3 Cruzer Micro  2.18 PQ: 0 ANSI: 2
sd 9:0:0:0: [sdc] 990865 512-byte hardware sectors: (507 MB/483 MiB)
sd 9:0:0:0: [sdc] Write Protect is off
sd 9:0:0:0: [sdc] Mode Sense: 03 00 00 00
sd 9:0:0:0: [sdc] Assuming drive cache: write through
sd 9:0:0:0: [sdc] 990865 512-byte hardware sectors: (507 MB/483 MiB)
sd 9:0:0:0: [sdc] Write Protect is off
sd 9:0:0:0: [sdc] Mode Sense: 03 00 00 00
sd 9:0:0:0: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 9:0:0:0: [sdc] Attached SCSI removable disk
sd 9:0:0:0: Attached scsi generic sg3 type 0
scsi 9:0:0:1: CD-ROM            SanDisk  U3 Cruzer Micro  2.18 PQ: 0 ANSI: 2
sr1: scsi3-mmc drive: 8x/40x writer xa/form2 cdda tray
sr 9:0:0:1: Attached scsi CD-ROM sr1
sr 9:0:0:1: Attached scsi generic sg4 type 5
usb-storage: device scan complete
The underlined lines tell us it is identified as sdc, and has one partition, sdc1. Yours will depend on your hardware, of course. Now, we can inspect it, with fdisk:
Code:
theNbomr@laptop02:~> sudo /sbin/fdisk -l /dev/sdc

Disk /dev/sdc: 507 MB, 507322880 bytes
16 heads, 61 sectors/track, 1015 cylinders
Units = cylinders of 976 * 512 = 499712 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1015      495289+   b  W95 FAT32
Now we know the type of filesystem installed on the device, so we can mount it. I use a mountpoint that indicates what I intend to mount on it...

Code:
theNbomr@laptop02:~> sudo mkdir /mnt/sdc1
theNbomr@laptop02:~> sudo mount -t vfat /dev/sdc1 /mnt/sdc1
You may need to consult manpages for fdisk, and mount.
--- rod.

Last edited by theNbomr; 09-05-2009 at 05:34 PM.
 
Old 09-05-2009, 08:14 PM   #4
LiNuXMaN31509
LQ Newbie
 
Registered: Jun 2009
Location: Houston Texas (Born in Brooklyn NY)
Distribution: CentOS
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
First, check the listings in the /dev directory. You should see files like /dev/sda1, or /dev/hdd1, etc. Those are your hard drive partitions, the numbers are the partitions on the drive, while the sd or hd are the device ID's. Plug in your external drive, and you should see more of them pop up...if you've got /dev/sda1 and /dev/sda2, you'll probably see /dev/sdb1 and the like 'appear' in the /dev directory. You can also just type in dmesg, after plugging in the device, and see what it tells you...the name will be towards the bottom, somewhere.

The mount command is simple, check the man page for mount, but it's essentially:
Code:
mount <device> <mount point>
the mount point is just a directory. I'd make one just for mounting devices, something like /media. So if your device is /dev/sdb1, the command would be
Code:
mount /dev/sdb1 /media
Make more directories/sub-directories, so you can mount more devices...enjoy.

All seem to be going well this I got this error:


areyana dev # mount sdb1 /media
mount: unknown filesystem type 'ntfs'
 
Old 09-05-2009, 10:50 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You have to specify the device, not just the partition:
Code:
mount /dev/sdb1 /media
It is not clear how mount knew about NTFS filesystem type. What actual commandline did you use? Do you have knowledge of the filesystem type used by your device? It sounds like your Linux does not have NTFS support. Maybe try NTFS-3G:
Code:
mount -t ntfs-3g /dev/sdb1 /media
There is nothing wrong with the use of '/media' as a mountpoint, but conventionally, it is used for things like cameras.
--- rod.

Last edited by theNbomr; 09-05-2009 at 10:51 PM.
 
Old 09-05-2009, 11:41 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Actually the convention that seems to have evolved is that /mnt is used for permanent devices like internal hard-drives, and perhaps network shares, while /media is used for removable devices, which includes external hard disks as well as usb sticks and cameras and such. The automount systems on most distros place removable devices under /media. But one of the benefits of Linux is that you can configure things to your liking, and mount your devices pretty much wherever you like.

Which brings up a point that TBOne mentioned above, but not very clearly. You probably don't want to use '/media' itself as a mount point. Create a subdirectory under it and mount it there, such as '/media/exthdd'. That way you have space to mount multiple devices at the same time.

Anyway, in addition to the regular mount command, there are a few other mounting options available to you.

One is pmount. "policy mount" is a wrapper for mount that's specifically designed for removable devices. It removes most of the work involved in setting up the mount command. Running "pmount /dev/sda1" will mount that device in a subdirectory of /media (by default), automatically creating and removing that directory as necessary.

Second, you might consider halevt. It's a daemon that uses hal to watch for hardware changes and perform actions on them, and one of the things it's designed to do is automount devices when it detects them. It even includes it's own mounting program similar to pmount.

Finally, there's the old, venerable autofs. This is the traditional automounting system for unix-based systems. It takes some work to set up, but one of it's strengths is that it will only mount the devices when you actually access them, and unmount them again after a preset timeout period. This means that your device is relatively safe from corruption if yanked out of the usb port unexpectedly. OTOH, I've experienced problems with really big file transfers when combined with short timeouts.
 
Old 09-07-2009, 03:47 AM   #7
LiNuXMaN31509
LQ Newbie
 
Registered: Jun 2009
Location: Houston Texas (Born in Brooklyn NY)
Distribution: CentOS
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by David the H. View Post
Actually the convention that seems to have evolved is that /mnt is used for permanent devices like internal hard-drives, and perhaps network shares, while /media is used for removable devices, which includes external hard disks as well as usb sticks and cameras and such. The automount systems on most distros place removable devices under /media. But one of the benefits of Linux is that you can configure things to your liking, and mount your devices pretty much wherever you like.

Which brings up a point that TBOne mentioned above, but not very clearly. You probably don't want to use '/media' itself as a mount point. Create a subdirectory under it and mount it there, such as '/media/exthdd'. That way you have space to mount multiple devices at the same time.

Anyway, in addition to the regular mount command, there are a few other mounting options available to you.

One is pmount. "policy mount" is a wrapper for mount that's specifically designed for removable devices. It removes most of the work involved in setting up the mount command. Running "pmount /dev/sda1" will mount that device in a subdirectory of /media (by default), automatically creating and removing that directory as necessary.

Second, you might consider halevt. It's a daemon that uses hal to watch for hardware changes and perform actions on them, and one of the things it's designed to do is automount devices when it detects them. It even includes it's own mounting program similar to pmount.

Finally, there's the old, venerable autofs. This is the traditional automounting system for unix-based systems. It takes some work to set up, but one of it's strengths is that it will only mount the devices when you actually access them, and unmount them again after a preset timeout period. This means that your device is relatively safe from corruption if yanked out of the usb port unexpectedly. OTOH, I've experienced problems with really big file transfers when combined with short timeouts.
Ok I did most of the stuff and nothing. I was told to use FUSE and it will work for sure. I checked to see if I have it installed and I got this message:

areyana / # modprobe fuse
FATAL: Module fuse not found.


Where can I find this I tried emerge but a whole bunch of stuff comes up. Thank you very much guys for your help!
 
Old 09-08-2009, 02:42 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I see nothing about your request that suggests a role for fuse.
Please supply the following information, which is required to answer your question:
1. A clip from dmesg that is run shortly after plugging in the external drive. The clip should show what device name is used, and will look something like 'sdb', 'sdc', or maybe 'hdb', hdc' (less likely). Alternatively, scan /var/log/messages after booting with the external drive already connected. Find something referring to your external drive, as above.
2. The result of running (as root), 'fdisk -l'

Having these, we can point you to the full solution.
--- rod.
 
  


Reply



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
Mounting External Drive gjblackford Ubuntu 4 09-30-2007 04:21 PM
Mounting External Drive gjblackford Ubuntu 6 09-06-2007 02:13 PM
mounting external hard drive perrywillis@cox.net SUSE / openSUSE 5 10-16-2006 01:22 AM
mounting external drive bug lin00b Linux - Hardware 0 10-12-2004 09:24 PM
external hard drive mounting. gonus Debian 5 08-27-2004 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

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