Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a five 4TB usb drives. I want to setup a mount point, /mnt/backups so that when I plug in any of those drives, they get automatically mounted to /mnt/backups.

The problem is that when the drive path changes all the time for the drives even though I put them in the same usb slot. I've seen /dev/sde1 through /dev/sdh1...

OS is Ubuntu.

share|improve this question
    
What version of Ubuntu are you using? Is it the server or desktop version? –  Ernie Jul 2 '13 at 15:37
    
It's the server version. –  Chris G. Jul 2 '13 at 15:40
    
And the version number? –  Ernie Jul 2 '13 at 15:45
add comment

migrated from serverfault.com Jul 3 '13 at 13:08

This question came from our site for professional system and network administrators.

3 Answers

up vote 2 down vote accepted

Have a look at /dev/disk. There are some other ways to access the devices. by-path may suit your needs, dependent from the usb controllers in your drives. If this does not work you might just label (e2label(8)) your partitions and use by-label.

share|improve this answer
    
How do I mount a drive by its path? I'm assuming if I can mount a drive by-path then I can plug a different drive into the same usb slot and it will work. –  Chris G. Jul 2 '13 at 15:40
    
in the by-path folder are symlinks to e.g. /dev/sde1. So you can just mount /dev/disk/by-path/pci-0000:01:00.0-scsi-0:0:0:0-part1 /mnt/backups. Some for by-path –  krissi Jul 3 '13 at 7:45
    
And in laymens terms that path references the usb slot? –  Chris G. Jul 3 '13 at 12:05
    
That depends on your drives usb controller. Just plug in your devices and check if the path changes. If you want to be sure use the by-label way. –  krissi Jul 3 '13 at 12:35
add comment

I don't know about your Ubuntu version, but 12.04 LTS will automatically mount USB devices and put them in /media/disklabel, where 'disklabel' is the actual name of the disk according to the partition metadata. This makes the path of the disk consistent across each mounting.

share|improve this answer
add comment

My understanding is that you can use udev to define the disk locations as static as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.