Auto mount any USB drive

I have used luci to attempt to mount any connected USB as readonly:

  • I added a mount point
    • Device: /dev/sda1
    • Mount point: /mnt/sda1
    • File system: auto
    • Mount options: default,ro
      And saved and applied.

When I connect a USB device, /dev/sda1 is present, but is not mounted.
What have I missed?

If you want ANY usb drive to be auto mounted, ticking ‘Anonymous Mount’ and ‘Automount Filesystem’ up the top of Mount Points should be enough.

It looks like there is a problem with the ‘Check filesystems before mount’ option when it’s on, I’ll look into it.

For a specific USB drive, you can add by UUID. I wouldn’t recommend adding by device path as names can change on a system for various reasons (for example, a program having a file open on the device when it’s removed)

If it doesn’t work, check the system log. It could be something like a filesystem without an installed driver (e.g NTFS) or some weird settings (like FAT32 using a weird character set)