You are hereMounting usb drives on Linux
Mounting usb drives on Linux
Increasing disks have usb and firewire connections, and automatic recognition and mounting on Linux server editions (which have no GUI tools) is not always easy.
These notes are primarily for Ubuntu, but also work on my Suse 10.
To see if a disk is visible
# list disks
# list disk, with UUID and label
# list devices
ls -al /dev/disk/by-label
ls -al /media
# list partitions
Ask the system to re-detect disks
rchal restart [Suse ony]
The order that usb disks are mounted may change, and thus their /dev/sdXY number. Thus it better to assign a label, and mount using the label in /etc/fstab. So lets prepare a new disk /dev/sdc1 for usage:
# Create a partition sdc1
# Put an 'ext3' filesystems on that partition
# Lets label the disk EXTERNAL1, and check that the labelling worked:
e2label /dev/sdc1 EXTERNAL1
ls -al /dev/disk/by-label/
Now to mount the disk now and automatically in the future.
On some systems the disk is automatically mounted as /media/LABEL (i.e. /media/EXTERNAL1 in the above example)
on other systems an /etc/fstab entry is needed:
LABEL=EXTERNAL1 /external1 ext3 noauto,noatime,nodiratime,hotplug 0 2
Create mount point and mount
mkdir /external1 && mount /external1
If mounting a Windows NTFS formatted disk, find the UUID (with 'blkid') and try an fstab entry like this:
UUID=9A7836057835E0A5 /media/usb1 ntfs-3g force,noauto 0 2
There is more to learn though, I've had instances of
- USB disk not being mounted during powerup of the server, but mounting later worked fine.
- External USB disk mounting fine on one Ubutun 8.04 server, but not visible on another (as if there was a HW issue)
- USB disk umounting themselves/disappearing when idle.