On Fri, Oct 27, 2017 at 11:04:51AM +0200, Stephen Berman wrote:
> On Thu, 26 Oct 2017 23:47:11 +0100 Ken Moffat <[email protected]> wrote:
>
> > I've never used autofs (the idea offends me, I *want* to know what
> > gets mounted, and where, and I may choose to mount ro or rw at
> > different times)
>
> I want to be able to plug in and write to a USB stick or external hard
> disk without having to be root or use sudo; is there some way to do that
> besides using autofs?
>
> Steve Berman
I haven't needed to do this in a long time (and I have a suspicion
that there might be a problem with unmounting), but I have the
following in /etc/fstab:
/dev/stick /media/stick vfat shortname=lower,noauto,user,rw 0 0
and a series of rules in /etc/udev/rules.d (21-stick.rules, 22, ...)
$cat /etc/udev/rules.d/??-stick.rules
SUBSYSTEMS=="usb", ATTRS{product}=="USB Flash Memory", KERNEL=="sd?1",
SYMLINK="stick", MODE="0660"
SUBSYSTEMS=="usb", ATTRS{product}=="DISK 2.0", KERNEL=="sd?1", SYMLINK="stick",
MODE="0660"
SUBSYSTEMS=="usb", ATTRS{product}=="EHCI Host Controller", KERNEL=="sd?1",
SYMLINK="stick", MODE="0660"
SUBSYSTEMS=="usb", ATTRS{product}=="xHCI Host Controller", KERNEL=="sd?1",
SYMLINK="stick", MODE="0660"
And a new one every time a newer stick didn't show up. The
properties were found by running
# /sbin/udevadm info --name=/dev/sdb --attribute-walk
This method only allows one stick (or disk, or camera) at a time.
I'm reckless - I do a lot of things as root, and mounting external
real disks is one of those things : but I have regular backups.
ĸen
--
Truth, in front of her huge walk-in wardrobe, selected black leather
boots with stiletto heels for such a barefaced truth.
- Unseen Academicals
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page