Bug 98858 - Please allow ext4 mount option: noload
Summary: Please allow ext4 mount option: noload
Status: RESOLVED FIXED
Alias: None
Product: udisks
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Vojtech Trefny
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-25 21:54 UTC by Alain Kalker
Modified: 2017-08-31 12:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Alain Kalker 2016-11-25 21:54:21 UTC
Please allow a user to specify the noload option when using `udisksctl mount`. It is needed to mount a 'dirty' (not cleanly unmounted) ext4 partition read-only, which is useful in data forensics and for security reasons.

A (currently failing) use case, using a disk image containing two partitions, one FAT, the other a 'dirty' ext4 filesystem:

$ udisksctl loop-setup -r -f disk.img
Mapped file disk.img as /dev/loop0.
$ udisksctl mount -o ro -b /dev/loop0p1
Mounted /dev/loop0p1 at /run/media/miki/XXXX-XXXX.
$ udisksctl mount -o ro -b /dev/loop0p2
Error mounting /dev/loop0p2: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting /dev/loop0p2 at /run/media/XXXX/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid,ro" "/dev/loop0p2" "/run/media/XXXX/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/loop0p2,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.


[from dmesg]
[33824.747555] EXT4-fs (loop0p2): INFO: recovery required on readonly filesystem
[33824.747556] EXT4-fs (loop0p2): write access unavailable, cannot proceed

Following the advice in [1], try to mount using the noload option:

$ udisksctl mount -o ro,noload -b /dev/loop0p2
Error mounting /dev/loop0p2: GDBus.Error:org.freedesktop.UDisks2.Error.OptionNotPermitted: Mount option `noload' is not allowed

Mounting as root works as expected, without errors:
$ sudo mount -o ro,noload /dev/loop0p2 /mnt

[1]: https://digital-forensics.sans.org/blog/2011/06/14/digital-forensics-mounting-dirty-ext4-filesystems/
Comment 1 Vojtech Trefny 2017-08-14 08:43:41 UTC
Thank you for the report.

PR for upstream project: https://github.com/storaged-project/udisks/pull/376
Comment 2 Vojtech Trefny 2017-08-31 12:27:13 UTC
Fixed in udisks 2.7.3


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.