udisks unable to mount NTFS-formatted usb drive properly if block device is set to read only (blockdev --setro /dev/sd??)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ntfs-3g (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
In older versions (10.04 and older) we use HAL and UDEV rules to force all USB drives to be automounted read-only by the Desktop Environment. But they don't anymore for the newer versions. After a few days research and expirementations, I'm now able accomplish it using the UDEV rule:
KERNEL=
In 16.04 and 17.10, the above work for FAT/exFAT, ext3/4, and even ext4 on an encrypted partition. It doesn't work though on NTFS-formatted usb drives -- I get a permission denied error.
To replicate/test this without creating the UDEV rule:
1. Insert FAT or ext3/4-formatted flash drive. Let Nautilus automount it. Note where in the left navigation pane it is.
2. From a terminal session, unmount the partition -- let's say sdb1.
3. Do: sudo blockdev --setro /dev/sdb1
4. In Nautilus' left pane, click on the device name to mount it again.
5. The mount command should show the mounted device as read-only.
Do the same for a NTFS-formated usb drive. By step #4, it will not mount with a permission denied error.
We don't want all USB drives to be mounted read-only, and I'm pretty sure this was not the case in 10.04 or older. Your rule simply makes every scsi drive but the first one to be detected ( which may or may not be USB ) read only.