Remount fstab Without Reboot in Linux
How To: Remount /etc/fstab Without Rebooting in Linux
The file /etc/fstab contains necessary information for automatic mounting of partitions.
Usually, after this file editing, you need to reload the Linux server for the changes to take effect.
In the article below we will show you that refreshing the commands in fstab or restarting the operation system in Linux is not necessary.
Reload fstab without reboot in command line from root:
sudo mount -a
OR
sudo mount -av
This simple command remounts all file systems which specified in /etc/fstab, with the exception of partitions with the noauto option.
Wrapping up
We hope that after reading our article, you were able to reload fstab without rebooting. Also in the frequently asked questions you will find answers to the most popular questions that may arise when working with /etc/fstab.
Remount fstab FAQs
-
What is fstab?
- The fstab file is a text file that contains information about the various file systems and storage devices on your computer. It is just one file that defines how the disk and/or partition will be used and how it will be integrated into the rest of the system. The full path to the file is /etc/fstab. This file can be opened in any text editor, but it can only be edited as a sudo, because the file is an important, integral part of the system; without it, the system will not boot.
-
What is the command "mount" used for in Linux?
- The Linux mount command is used to attach and access external storage devices, network shares, and other file systems to the operating system. It is required to integrate additional storage, ensure data availability, and expand storage capacity.
-
Remount all filesystems in fstab with command mount -o remount -a
- To re-evaluate all the mount options in fstab as if rebooting use command below:
mount -o remount -a
Should re-mount with the changed mount-options of your fstab.
- To re-evaluate all the mount options in fstab as if rebooting use command below:
-
How to make the OS reload fstab so auto-mounts use the new settings when media is connected?
- First way
This is caused by systemd’s conversion of /etc/fstab; traditional mount doesn’t remember the contents of /etc/fstab.
To refresh systemd’s view of the world, including changes to /etc/fstab, run:
systemctl daemon-reload
Second way
Do your configuration and change the fstab file.
Use this command to remount the device_file you have changed its configuration in the fstab file:
mount -o remount [device_file]
This way you will mount the partition with its new configuration read from the "fstab" file.
If you removed a partition from the "fstab" file, simply umount [device_file]. Be sure, the partition stays unmounted after the reboot.
Also any time you can check the result by running mount command.
- First way