[Bug 1734280] Re: udisks unable to mount NTFS-formatted usb drive properly if block device is set to read only (blockdev --setro /dev/sd??)
Michael Tinsay
1734280 at bugs.launchpad.net
Thu Dec 7 08:49:42 UTC 2017
I'm ok with you not wanting all USB drives to be mounted read-only --
such is the default behavior of Ubuntu. But I and the company I work
for want it to be that way to comply with out security policies. And
since HAL is already deprecated, the workaround I found for recent
Ubuntu versions is to use the udev rule I posted above. Your assertion
about the rule is correct and it is intended to be that way.
That is not the bug here.
When udisks detects the media to be read-only, it correctly mounts them
as read-only for FAT/exFAT and ext2/3/4 filesystems. For NTFS, it is
forcing a read-write mount which then results in an mount error because
the media is read-only.
** Changed in: udisks (Ubuntu)
Status: Invalid => New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to udisks in Ubuntu.
https://bugs.launchpad.net/bugs/1734280
Title:
udisks unable to mount NTFS-formatted usb drive properly if block
device is set to read only (blockdev --setro /dev/sd??)
Status in udisks package in Ubuntu:
New
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=="sd[b-z][0-9]", RUN+="/sbin/blockdev --setro /dev/%k"
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/1734280/+subscriptions
More information about the foundations-bugs
mailing list