CentOS 7 Mount Point Setup Guide
You can add a mount point on CentOS 7 by following these steps:
- Ensure that you are prepared with the device you want to mount (such as a hard drive, partition, or NFS share).
- Create a directory to mount devices, for example, you can create a directory named “data” in the /mnt directory to mount the device.
sudo mkdir /mnt/data
- The file located at /etc/fstab
sudo vi /etc/fstab
- The file that contains configuration information for file systems in Linux systems is called /etc/fstab.
- The first partition on the second storage device
- I only need one option: /mnt/data
/dev/sdb1 /mnt/data ext4 defaults 0 0
Among them, ext4 is the file system type of the partition, defaults are the mount options, and 0 0 indicates the default file system check and backup options.
- Save and close the /etc/fstab file.
- Reload the /etc/fstab file with the following command to apply the changes:
sudo mount -a
You have successfully added a mount point now. You can use the df -h command to verify if the mount was successful and if the new device has been mounted to the specified directory.