After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790279 - Gnome-disk-utility shows snap squashfs
Gnome-disk-utility shows snap squashfs
Status: RESOLVED FIXED
Product: gnome-disk-utility
Classification: Core
Component: Disks UI
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-disk-utility-maint
gnome-disk-utility-maint
Depends on:
Blocks:
 
 
Reported: 2017-11-13 08:33 UTC by Andrea Azzarone
Modified: 2018-03-21 12:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[gdudevicetreemodel] Skip devices with HintIgnore equals to True. (918 bytes, patch)
2017-11-13 09:39 UTC, Andrea Azzarone
reviewed Details | Review
Hide devices if mounted with x-gdu.hide (2.22 KB, patch)
2017-11-24 12:47 UTC, Andrea Azzarone
none Details | Review
Hide devices if mounted with x-gdu.hide (2.09 KB, patch)
2018-01-31 14:45 UTC, Andrea Azzarone
none Details | Review
Hide devices if mounted with x-gdu.hide (2.09 KB, patch)
2018-01-31 14:52 UTC, Andrea Azzarone
none Details | Review
Hide devices if mounted with x-gdu.hide (2.25 KB, patch)
2018-01-31 14:54 UTC, Andrea Azzarone
none Details | Review
Hide devices if mounted with x-gdu.hide (3.33 KB, patch)
2018-02-02 12:32 UTC, Andrea Azzarone
committed Details | Review
Disks 3.28 on Arch Linux (67.68 KB, image/png)
2018-03-20 18:26 UTC, Strangiato
  Details

Description Andrea Azzarone 2017-11-13 08:33:13 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.
Comment 1 Andrea Azzarone 2017-11-13 09:39:57 UTC
Created attachment 363488 [details] [review]
[gdudevicetreemodel] Skip devices with HintIgnore equals to True.
Comment 2 Kai Lüke 2017-11-13 09:49:25 UTC
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 3 Kai Lüke 2017-11-13 10:04:39 UTC
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…
Comment 4 Kai Lüke 2017-11-13 10:13:30 UTC
A solution just targeting snaps would maybe be the better to avoid the overloaded ignore option (only hide in nautilus vs hiding everywhere).
Comment 5 Andrea Azzarone 2017-11-24 12:47:01 UTC
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 6 Kai Lüke 2017-11-30 09:09:50 UTC
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.
Comment 7 Andrea Azzarone 2018-01-31 14:45:19 UTC
Created attachment 367705 [details] [review]
Hide devices if mounted with x-gdu.hide
Comment 8 Andrea Azzarone 2018-01-31 14:52:30 UTC
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
Comment 9 Andrea Azzarone 2018-01-31 14:54:40 UTC
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.
Comment 10 Andrea Azzarone 2018-01-31 14:55:34 UTC
Please find attached an updated version of the patch. The required code has been merged in udisks2.
Comment 11 Kai Lüke 2018-02-01 13:47:31 UTC
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!
Comment 12 Andrea Azzarone 2018-02-02 12:32:21 UTC
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.
Comment 13 Kai Lüke 2018-02-04 14:48:15 UTC
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.
Comment 14 Kai Lüke 2018-02-04 14:49:47 UTC
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.
Comment 15 Strangiato 2018-03-20 18:26:41 UTC
Created attachment 369921 [details]
Disks 3.28 on Arch Linux

Disks 3.28 is showing snap squashfs on Arch.
Comment 16 Kai Lüke 2018-03-21 07:42:56 UTC
Please type "mount" in the terminal to see whether your snap tooling is already using the new mount option x-gdu.hide
Comment 17 Strangiato 2018-03-21 12:10:06 UTC
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)
Comment 18 Andrea Azzarone 2018-03-21 12:19:08 UTC
Which version of udisks2 have you got?
Comment 19 Strangiato 2018-03-21 12:27:04 UTC
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)