HowTo: define a mountpoint in /etc/fstab that will not auto-mount

When a mount point is define in /etc/fstab, it can be mounted by a very simple command
sudo mount mountpoint

When I define an entry in /etc/fstab, it will got mounted on boot:

UUID=**** mountint fstype nofail,other-mount-options 0 0 # I always use double zeros for the ending

Are there mount-options that will allow me to define a mountpoint that will not be auto-mounted on boot?

So that when I need it, I can just do the simple sudo mount mountpoint

I know there is systemd-mount, but whenever I need to define one, I need to do lots of Internet Search for copy and paste and modify …

1 Like

Did you try noauto? Also systemd can read /etc/fstab and create mount and automount units for you automatically. After editing fstab, run sudo systemctl daemon-reload. They are named after the name of the mount poing. i.e. mnt-xyz.mount if it is mounted to /mnt/xyz


Thank you very much!

yes, noauto is exactly what I want.

Regarding systemd mount and automount unit files, if I comment out an entry in /etc/fsab, will systemd remove the mount / automount unit files as well? (what if I want to keep those auto-generated unit files?)

1 Like

I have tried it and yes it is removed. You can systemctl cat mnt-xyz.mount > my-mnt-xyz.mount and put that file in /etc/systemd/system/ before commenting out it from fstab file.

1 Like

The gnome-disks app

has some automount functionality to offer.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.