[Bug 1734280] Re: udisks unable to mount NTFS-formatted usb drive properly if block device is set to read only (blockdev --setro /dev/sd??)
Jean-Pierre
1734280 at bugs.launchpad.net
Mon Feb 26 21:05:14 UTC 2018
Please try the attached patch
** Patch added: "Check whether the device was forced read-only"
https://bugs.launchpad.net/ubuntu/+source/ntfs-3g/+bug/1734280/+attachment/5063870/+files/forced-ro.patch
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ntfs-3g 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 ntfs-3g 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/ntfs-3g/+bug/1734280/+subscriptions
More information about the foundations-bugs
mailing list