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.