On 25/09/2018 13:13, Theo wrote:
> NY wrote:
>> I have a hard drive (either spinning or pen drive) which gets auto-mounted
>> to /media/pi/ (where the PID varies from one drive to another but is
>> fixed for any given drive). However the /dev/sd1 raw device changes from
>> sda1 to sdb1 to sdc1 etc if the device gets disconnected and reconnected,
>> which precludes auto-mounting /dev/sda1 to the path where I want it.
>
> You can use the device node in /dev/disk/by-id/ or by-label to make an entry
> in fstab that will always mount it in the same place. by-id nodes are based
> on the manufacturer and serial number of the device, so don't change when
> it's hotplugged.
>
> You can also make a udev rule that mounts all devices with (for instance)
> Seagate's USB vendor ID to the same mount point when hotplugged.
>
> By some combination of multiple rules, you can map multiple devices to the
> same location, assuming that's your aim.
>
> Theo
>
Note that if using labels, don't rely on the manufacturer's label. I,
for instance, have more than one drive originally called "Seagate
Expansion Drive". If two are plugged in at the same time I get
mountpoints of "/media/Seagate Expansion Drive" and "/media/Seagate
Expansion Drive_"
--
Chris Elvidge, England
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|