What is the noauto mount flag for?

Entries in fstab exist ONLY to specify things to mount at system boot or manually with mount -a, right? But I was reading up on the noauto mount flag, which apparently makes corresponding fstab entries NOT auto mounted.

So why would you ever put an entry in fstab with noauto? What purpose would it serve?

My guess is that I'm wrong about fstab's only purpose being to provide arguments to mount -a.


Solution 1:

A noauto entry in fstab is one which, for different reasons, you do not want to have mounted automatically, at boot and with the mount -a command. It is mounted by specifying the device or the mount point explicitly, like in

   sudo mount /dev/sdb1

or

   sudo mount /home/MyName/MyMountPoint

The cases in which you do not necessarily wish a device to be mounted at boot are numerous,for instance when we are talking about a network device, which may or may not be available at boot time (you could be on a laptop, and away from home). Or it might be an encrypted device, for which you have to provide a password, and you want to have to do that only when you truly need that. And so on.

In fact, fstab is used to provide rules by which devices are mounted, whether at boot time or not.