GNOME Bugzilla – Bug 790279
Gnome-disk-utility shows snap squashfs
Last modified: 2018-03-21 12:27:04 UTC
gnome-disk-utility shows snap squashfs mounted under /snap. One possible way to workaround this would be to add an udev rule to mark these devices as ignored and to patch gnome-disk-utility to ignore a device if 'udisks_block_get_hint_ignore (block)' returns True.
Created attachment 363488 [details] [review] [gdudevicetreemodel] Skip devices with HintIgnore equals to True.
Review of attachment 363488 [details] [review]: Thanks, looks good. I am not familiar with the snap format and its requirements but I just wonder if a dconf setting should be added to make them visible again for debugging? Can it happen that stale mounts are left over from snap applications?
Comment on attachment 363488 [details] [review] [gdudevicetreemodel] Skip devices with HintIgnore equals to True. Maybe we first need the dconf toggle and have it off by default to not break installations. The current usage of UDisksIgnore applies to some partitions which I would expect GNOME Disks to show: https://github.com/storaged-project/udisks/blob/master/data/80-udisks2.rules Or we need a way in the UI to expand to the full list if needed…
A solution just targeting snaps would maybe be the better to avoid the overloaded ignore option (only hide in nautilus vs hiding everywhere).
Created attachment 364324 [details] [review] Hide devices if mounted with x-gdu.hide Check inside should_include_block if a block has been mounted with the x-gdu.hide option. This allows to hide e.g. snap squashfs from gnome-disk-utility.
Comment on attachment 363488 [details] [review] [gdudevicetreemodel] Skip devices with HintIgnore equals to True. Thanks for the new direction in UDisks with runtime information. Let's see when the API lands how to go with this - I think there must be an explicit meson option because of requiring a higher UDisks version.
Created attachment 367705 [details] [review] Hide devices if mounted with x-gdu.hide
Created attachment 367706 [details] [review] Hide devices if mounted with x-gdu.hide Check inside should_include_block if a block has been mounted with the x-gdu.hide option. This allows to hide e.g. snap squashfs from gnome-disk-utility. https://bugzilla.gnome.org/show_bug.cgi?id=790279
Created attachment 367707 [details] [review] Hide devices if mounted with x-gdu.hide Check inside should_include_block if a block has been mounted with the x-gdu.hide option. This allows to hide e.g. snap squashfs from gnome-disk-utility.
Please find attached an updated version of the patch. The required code has been merged in udisks2.
Review of attachment 367707 [details] [review]: Dear Andrea, thanks for the patch, good that we have this solution now. Would you update it or should I do it? Regards, Kai ::: src/disks/gdudevicetreemodel.c @@ +1181,2 @@ static gboolean +has_x_gdu_hide_option (UDisksBlock *block) Could you please move this to gduutils.c+h and prefix it accordingly? Maybe besides _has_configuration or _is_flash, thanks!
Created attachment 367805 [details] [review] Hide devices if mounted with x-gdu.hide Check inside should_include_block if a block has been mounted with the x-gdu.hide option. This allows to hide e.g. snap squashfs from gnome-disk-utility.
Review of attachment 367805 [details] [review]: Thanks for making it generic as well, I will just make the name more explicit by adding userspace_mount when committing because otherwise it a bit confusing for a reader of the code what an option should be when the function is called.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Created attachment 369921 [details] Disks 3.28 on Arch Linux Disks 3.28 is showing snap squashfs on Arch.
Please type "mount" in the terminal to see whether your snap tooling is already using the new mount option x-gdu.hide
yes, it's already using mount option x-gdu-hide. /var/lib/snapd/snaps/core_3887.snap on /var/lib/snapd/snap/core/3887 type squashfs (ro,nodev,relatime,x-gdu.hide) /var/lib/snapd/snaps/vlc_158.snap on /var/lib/snapd/snap/vlc/158 type squashfs (ro,nodev,relatime,x-gdu.hide) /var/lib/snapd/snaps/vlc_190.snap on /var/lib/snapd/snap/vlc/190 type squashfs (ro,nodev,relatime,x-gdu.hide) /var/lib/snapd/snaps/core_4110.snap on /var/lib/snapd/snap/core/4110 type squashfs (ro,nodev,relatime,x-gdu.hide) /var/lib/snapd/snaps/core_2774.snap on /var/lib/snapd/snap/core/2774 type squashfs (ro,nodev,relatime) /var/lib/snapd/snaps/discord_52.snap on /var/lib/snapd/snap/discord/52 type squashfs (ro,nodev,relatime,x-gdu.hide) /var/lib/snapd/snaps/vlc_131.snap on /var/lib/snapd/snap/vlc/131 type squashfs (ro,nodev,relatime,x-gdu.hide) /var/lib/snapd/snaps/core_4206.snap on /var/lib/snapd/snap/core/4206 type squashfs (ro,nodev,relatime,x-gdu.hide)
Which version of udisks2 have you got?
udisks2 2.7.6-1. Now I noticed that one squashfs does not use x-gdu.hide. /var/lib/snapd/snaps/core_2774.snap on /var/lib/snapd/snap/core/2774 type squashfs (ro,nodev,relatime)