Eve V. E. Kovacs wrote:
> Hi, I have a USB drive that I would like to automount at boot and
> whenever it is hotplugged (is this possible?), at a fixed mountpoint.
>
> The current options in the fstab (added by the system when I plugged
> in the drive) are:
> pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed
>
> Is it just as simple as changing the noauto to auto??
>
> Another behavior I would like to change is that if I hot unplug the
> drive and then hotplug it, the system comments out
> my fstab entries and writes in new ones (as above) with the mountpoints
> at /media/usbdisk1, /media/usbdisk2 etc.
>
> How do I keep the mountpoints that I defined? There is a 'hotplug' mount
> option in Suse linux, but I could not find documentation for it in SL
> (not conclusive since there is no documentation I could find for
> fscontext=system_u object_r removable_t either!)
>
> Can anyone help?
> Thanks,
> Eve
>
>
Hi Eve,
The easiest way I can think of is to label the file system on your USB
drive filesystem, and remove all mention of it from your fstab.
That might sound a little bizzare, but here is the reason why.
You're USB drive is already being automounted when you plug it in, you
are seeing it yourself. It get's put into the fstab automatically with
hotplug. But, as you said, it is picking a new directory for it to be
mounted in each time.
The formula that hotplug is using to pick a directory name is rather
simple. It's first choice is /media/<FILESYTEM LABEL>
If a file system is not labeled, it then takes guesses, the most common
being usbdrive, so you get /media/usbdrive
If your usbdrive patition has an ext2/ext3 partition, use e2label to
label it.
Troy
--
__________________________________________________
Troy Dawson [log in to unmask] (630)840-6468
Fermilab ComputingDivision/LCSI/CSI DSS Group
__________________________________________________
|