How Can You Test Your /etc/fstab File without Rebooting the Linux Server?

Problem scenario
You want modified the /etc/fstab file. You want to reboot, but you are concerned your server won't work if you accidentally had a typo in the /etc/fstab file. What should you do?

Solution

  1. Backup the /etc/fstab file somewhere (e.g., /etc/bak.fstab.bak).
  2. Run a command like this:
sudo mount -o remount,rw /dev/path/to /path/to/use

The /path/to/use is the path that you will see on your Linux system. The source is the /dev/path/to.

  1. The command will fail if your /etc/fstab file had a big problem. Otherwise you will be safe to reboot the server.

Leave a comment

Your email address will not be published. Required fields are marked *