0

I have a system running Raspbian Jessie with LightDM which auto mounts USB dongles under /media/pi. I would like to make this automount Read Only, so it does automount, but only automounts Read Only.

I see that Udisks2 and PCManFM are involved in that process, but I cant find any way to configure what I am looking for.

udisksctl info -b /dev/sda1 gives some clues:

/org/freedesktop/UDisks2/block_devices/sda1:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sda1
    DeviceNumber:               2049
    Drive:                      '/org/freedesktop/UDisks2/drives/Generic_USB__SD_Reader_12345678901234567890'
    HintAuto:                   true
    HintIconName:
    HintIgnore:                 false
    HintName:
    HintPartitionable:          true
    HintSymbolicIconName:
    HintSystem:                 false
    Id:                         by-uuid-1E67-9F72
    IdLabel:
    IdType:                     vfat
    IdUUID:                     1E67-9F72
    IdUsage:                    filesystem
    IdVersion:                  FAT16
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sda1
    ReadOnly:                   false
    Size:                       2007368192
    Symlinks:                   /dev/disk/by-id/usb-Generic_USB_SD_Reader_12345678901234567890-0:0-part1
                                /dev/disk/by-partuuid/4f48812e-01
                                /dev/disk/by-path/platform-3f980000.usb-usb-0:1.4:1.0-scsi-0:0:0:0-part1
                                /dev/disk/by-uuid/1E67-9F72
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        /media/pi/1E67-9F72
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:
    Number:             1
    Offset:             130560
    Size:               2007368192
    Table:              '/org/freedesktop/UDisks2/block_devices/sda'
    Type:               0x06
    UUID:               4f48812e-01

Thanks very much Kevin

1
  • Looks like I have to turn off the PCManFM options to automount and look at an alternative.
    – Kevin W
    Commented May 5, 2019 at 20:39

1 Answer 1

0

I have gone with turning off automount in PCManFM and using 'usbmount':

apt-get install usbmount

Change MountFlags=slave to MountFlags=shared in /lib/systemd/system/systemd-udevd.service

Set RO in the options in /etc/usbmount/usbmount.conf

Cheers

Kev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .