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.
mount -ais going to mount all devices according tofstaband I want to removenoexecfrom one particular entry offstab, it seems thatmount -awill NOT make this removal effective and I have to actually restart the system to execute command inside the mountpoint. This causes my concern ifmount -acan really replicate everything that is going to happen after a real reboot. – Sep 22 '21 at 09:01findmnt --verifyinstead. That aside, if you really intend an immediate change to mount options, just do it yourself. – Michael Hampton Sep 22 '21 at 13:32mount -o remount /mountpointormount -a -o remount– Michael Hampton Sep 22 '21 at 13:42findmnt --verify, I just tried on RHEL 7 and it turns out that...itsfindmnt(2.23.2) does not have a--verifyoption lol – Oct 03 '21 at 08:49