..and what are the consequences of the different methods?
I have been trying some things with the mounting of an sda2 partition.
Mounting in fstab, not mounting in fstab but from the file manager.
So far, if I am right, I learned that by mounting in fstab, a partition is mounted automatically at startup.
But this mounted partition is not shown under 'devices' in the file manager, whereas the root partition and cdrom for example are shown.
When you want to have it under devices in the sidebar, a partition should not be mounted in fstab but by clicking it in the file manager. Is that correct?
But which way to go if you want both? Automatically mounted at startup AND being shown in the sidebar of file manager?
Best Answer
This is documented (at least for
gnome-shell
/nautilus
) ingvfs-udisks2-volume-monitor
:Further down comes the explanation:
To sum up:
Partitions listed in
/etc/fstab
would (by default) only show up if they're mounted under/media
,$HOME
or/run/media/$USER
. If you want a partition to be automatically mounted at system startup and also listed in the file manager sidebar, the easiest way is to mount it via/etc/fstab
under one of those three locations.If you want the partition to be mounted under a different directory (e.g.
/mnt
) and still be shown in the sidebar, you can override the default behaviour by addingx-gvfs-show
to your mount options infstab
:Partitions not listed in
/etc/fstab
are handled byudisks2
and will be mounted under/run/media/$USER/VolumeName
or/media/VolumeName
depending on the value ofUDISKS_FILESYSTEM_SHARED
1 hence they will be shown underDevices
in the sidebar. However, they are not automatically mounted. A user could automatically mount them at session startup withudisksctl
, e.g. adding:to the session startup scripts.
1
man udisks
: