I am using xubuntu 22.04.2 with gvfs 1.48.2 and glib 2.72.4.
I have a LUKS partition on my hard drive which is not unlocked or mounted during boot. My goal is to have this partition NOT be displayed as an icon on my desktop when it is locked and unmounted. (Actually I don’t want it to show up when it is unlocked either, but I am able to control the icon being displayed in that case.)
To this end, I created a dummy entry in /etc/fstab for the locked partition with mount option x-gvfs-hide, in addition to the entry for the unlocked volume which was already there:
/dev/nvme0n1p5 /mnt/nvme0n1p5 auto nosuid,nodev,nofail,noauto,x-gvfs-hide 0 0
/dev/mapper/blah /mnt/blah ext4 user,noauto,x-gvfs-hide,noatime 0 0
However, upon boot, the LUKS partition is shown on the desktop, seemingly because GIO includes it in its list of mountable volumes:
$ gio mount --list --detail
Drive(0): THNSN5512GPU7 NVMe TOSHIBA 512GB
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
ids:
unix-device: '/dev/nvme0n1'
themed icons: [drive-harddisk-solidstate] [drive-harddisk] [drive] [drive-harddisk-solidstate-symbolic] [drive-harddisk-symbolic] [drive-symbolic]
symbolic themed icons: [drive-harddisk-solidstate-symbolic] [drive-harddisk-symbolic] [drive-symbolic] [drive-harddisk-solidstate] [drive-harddisk] [drive]
is_removable=0
is_media_removable=0
has_media=1
is_media_check_automatic=1
can_poll_for_media=0
can_eject=0
can_start=0
can_stop=0
start_stop_type=shutdown
sort_key=00coldplug/00fixed/nvme0n1
Volume(0): 195 GB Encrypted
Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
ids:
class: 'device'
unix-device: '/dev/nvme0n1p5'
uuid: '4a92e82d-1412-46f9-b302-833350dc5b31'
uuid=4a92e82d-1412-46f9-b302-833350dc5b31
symbolic themed icons: [drive-harddisk-solidstate-symbolic] [drive-harddisk-symbolic] [drive-symbolic] [drive-harddisk-solidstate] [drive-harddisk] [drive]
can_mount=1
can_eject=0
should_automount=0
sort_key=gvfs.time_detected_usec.1690057768434940
When I unlock the LUKS partition (but even before mounting), the /dev/mapper/blah entry is created, and the partition immediately disappears from GIO’s list of volumes and also from the desktop, as expected:
$ sudo cryptsetup luksOpen /dev/nvme0n1p5 blah
Enter passphrase for /dev/nvme0n1p5:
$ gio mount --list --detail
Drive(0): THNSN5512GPU7 NVMe TOSHIBA 512GB
Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
ids:
unix-device: '/dev/nvme0n1'
themed icons: [drive-harddisk-solidstate] [drive-harddisk] [drive] [drive-harddisk-solidstate-symbolic] [drive-harddisk-symbolic] [drive-symbolic]
symbolic themed icons: [drive-harddisk-solidstate-symbolic] [drive-harddisk-symbolic] [drive-symbolic] [drive-harddisk-solidstate] [drive-harddisk] [drive]
is_removable=0
is_media_removable=0
has_media=1
is_media_check_automatic=1
can_poll_for_media=0
can_eject=0
can_start=0
can_stop=0
start_stop_type=shutdown
sort_key=00coldplug/00fixed/nvme0n1
So: is this is a gvfs bug, or am I just doing things wrong? Is there a different way to accomplish my ultimate goal of hiding this partition from the desktop?