Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
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?
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.
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: sdc1sd 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...
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'
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.
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.