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.

  • 1
    Does this answer your question? [How do you validate fstab without rebooting?](https://serverfault.com/questions/174181/how-do-you-validate-fstab-without-rebooting) – Gerald Schneider Sep 22 '21 at 08: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. –  Sep 22 '21 at 09: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. – Michael Hampton Sep 22 '21 at 13:32
  • Hi @MichaelHampton , what do you mean by "just do it yourself"? –  Sep 22 '21 at 13:40
  • I mean remount the mount with the new options. `mount -o remount /mountpoint` or `mount -a -o remount` – Michael Hampton Sep 22 '21 at 13:42
  • But sometimes the old mountpoint is being used...so usually I wait for a system reboot--not sure if this is the "correct way". –  Sep 22 '21 at 13:44
  • EIther way could be "correct". It depends on your specific circumstances. – Michael Hampton Sep 22 '21 at 14:15
  • For those who recommended `findmnt --verify`, I just tried on RHEL 7 and it turns out that...its `findmnt` (2.23.2) does not have a `--verify` option lol –  Oct 03 '21 at 08:49

0 Answers0