3

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.

3
  • What version of Ubuntu are you using? Is it the server or desktop version?
    – Ernie
    Commented Jul 2, 2013 at 15:37
  • It's the server version.
    – Chris G.
    Commented Jul 2, 2013 at 15:40
  • And the version number?
    – Ernie
    Commented Jul 2, 2013 at 15:45

3 Answers 3

2

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.

4
  • 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.
    Commented Jul 2, 2013 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
    Commented Jul 3, 2013 at 7:45
  • And in laymens terms that path references the usb slot?
    – Chris G.
    Commented Jul 3, 2013 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
    Commented Jul 3, 2013 at 12:35
1

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

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .