1

Once a while, I need to adjust mountpoints of a server and it is not always possible for me to reboot the system right away. Therefore, to check if my revision to /etc/fstab is correct, usually I do mount -a to see if there are any complaints. If there are no complaints, I believe my /etc/fstab is okay and let the server team to reboot the server whenever they want.

However, I am keep wondering, is this really a very safe and reliable way? Let's say the external environment is the same (i.e., no broken hard drive or down remote sftp/NFS server), will mount -a always guarantee that the next reboot will NOT be interrupted because of incorrect /etc/fstab configuration?

Edit:

As pointed out by the comment from @GeraldSchneider, there is a pretty similar question being answered here: How do you validate fstab without rebooting?. However, I would like to add one more observation--hopefully this could differentiate my question from the previous one:

Say mount -a is going to mount all devices according to /etc/fstab and I want to remove noexec from one particular entry in fstab. It seems that mount -a will NOT make this removal effective and I have to actually restart the system to execute command inside the mountpoint.

This causes my concern on whether or not mount -a can really replicate everything that is going to happen after a real reboot.

8
  • 1
    Does this answer your question? How do you validate fstab without rebooting? Sep 22, 2021 at 8:47
  • ah @GeraldSchneider yes this basically answered my question. But I have a minor observation. Say mount -a is going to mount all devices according to fstab and I want to remove noexec from one particular entry of fstab, it seems that mount -a will NOT make this removal effective and I have to actually restart the system to execute command inside the mountpoint. This causes my concern if mount -a can really replicate everything that is going to happen after a real reboot.
    – Alex Kong
    Sep 22, 2021 at 9:01
  • The man page says you should use findmnt --verify instead. That aside, if you really intend an immediate change to mount options, just do it yourself. Sep 22, 2021 at 13:32
  • Hi @MichaelHampton , what do you mean by "just do it yourself"?
    – Alex Kong
    Sep 22, 2021 at 13:40
  • I mean remount the mount with the new options. mount -o remount /mountpoint or mount -a -o remount Sep 22, 2021 at 13:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.