Mailinglist Archive: opensuse (1445 mails)

< Previous Next >
Re: [opensuse] Re: making rw esata hotplug
Hello,

On Sun, 18 Mar 2012, jdd wrote:
Le 18/03/2012 20:34, James Knott a écrit :
The drive can be identified by name or device ID. Is there any reason
why you couldn't give all drives the same name? If not, it's just
another line in fstab.

adding line in fstab is as a problem as making the disk rw by hand.

The solution could be to make all the disks mount on the same
mountpoint (after all it's the same dock), but now it mounts by ID
like this:

/media/769125ac-9176-4b9c-8bda-f029f14dcf64/

how can I change this?

Use /dev/disk/by-path/.

I e.g. have

/dev/disk/by-path/pci-0000:00:13.2-usb-0:1:1.0-scsi-0:0:0:0 \
/usb6 auto defaults,user,users,noauto 0 0
/dev/disk/by-path/pci-0000:00:13.2-usb-0:1:1.0-scsi-0:0:0:0-part1 \
/usb6p1 auto defaults,user,users,noauto 0 0

in my fstab for the lower front usb-port ;) No matter what I plug in
there, I can mount that if e.g. an usb-stick is unpartitioned or
it's first partition if it is partitioned under /usb6 resp. /usb6p1 as
a user. Works like a charm also with FAT-formatted sticks.

So, just put a disk in your dock and turn it on and then have a look
into /dev/disk/by-path. There you'll find e.g.

pci-0000:03:00.0-scsi-1:0:0:0-part1 symlinked to /dev/sd?1

(no usb for eSATA ;)

And if you keep the dock in the same (e)SATA port, that 'by-path'
device should be always the same, so no matter what disk you put in
there, you can access it via that by-path. Creating an udev rule for
that should not be that hard also, if you don't want to do a manual
'mount /media/Dock' (as user) with a similar fstab entry as mine.
I'm too tired and lazy ATM.

You can also add by-label and by-id entries for specific partitions or
disks (or usb-sticks in my case), I e.g. have some for "my"
usb-sticks, so no matter where I plug them, I can mount them under the
same mountpoint, e.g.

/dev/disk/by-id/usb-ADATA_N005_0000000000008516-0:0-part1 \
/usbadata auto defaults,user,users,noauto 0 0

So, depending on your "use case" you can have fstab-entries or
udev-rules for any medium that has/reports an id and serial number[1]
or filesystem-label or for specific SATA/PCI/USB ports (no idea about
firewire). Or for a filesystem UUID which I find clunky. Your
/media/ example was the by-uuid under /media/${uuid} case.

HTH,
-dnh

[1] I have e.g. 8 SATA disks in this box, with 5 resp. 3 being
the exact same model and firmware version, so I need the serial-no
to distinguish those 3 resp. 5. I use filesystem-labels with those
(6 disks have only one partition anyway).

--
Computers make very fast, very accurate mistakes.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups