by Nudge » 04 Mar 2020, 20:30
I'm trying to set a trigger on Rune 0.4b that changes a USB external drive to be Read Only when mounted.
The following does not appear to work on Rune 0.4b using Arch Linux although it does on other flavours of Linux.
/etc/udev/rules.d/96-enforce-usb-ro.rules: (also tried: /usr/lib/udev/rules.d/96-enforce-usb-ro.rules)
SUBSYSTEMS=="usb", ACTION=="add", KERNEL=="sd*", ENV{SYSTEMD_WANTS}="enforce-usb-ro@%k"
/lib/systemd/system/enforce-usb-ro@.service:
[Unit]
Description=Enforce read-only mode on USB storage device
BindsTo=dev-%i.device
[Service]
Type=simple
ExecStart=/usr/bin/mount -o remount,ro /dev/%I
I'm obviously missing something and cannot determine the Arch Linux automount rule which might be a better place to mount as Read Only (I have a sneaky suspicion that devmon may be involved somewhere).
Any pointers / examples gratefully received !