CentOS 7 Mount Point Setup Guide

You can add a mount point on CentOS 7 by following these steps:

  1. Ensure that you are prepared with the device you want to mount (such as a hard drive, partition, or NFS share).
  2. 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
  1. The file located at /etc/fstab
sudo vi /etc/fstab
  1. The file that contains configuration information for file systems in Linux systems is called /etc/fstab.
  2. The first partition on the second storage device
  3. 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.

  1. Save and close the /etc/fstab file.
  2. 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.

bannerAds