Linux system has been used for nearly 10 years, for Linux system use, transport and peacekeeping services deployment is also relatively skilled, but yesterday encountered a cloud disk load unexpectedly also toss a lot of time. Take the time to make a written summary of the disk partitions and mounts today, making it a little more memorable and avoiding wasting unnecessary hours later on.
Disk Partitions
First use Fdisk–l to view the current partition of the disk in the system.
You can see that there are two disks in the system, the first disk is divided into the system boot area and the data area, and the second disk has no partition table, which means that there are no partitions.
Linux system, use the FDISK command to perform a partition on the disk. Fdisk has a series of parameters that can be viewed by entering M.
When you are finished, you can use Fdisk–l to view the partitions.
Disk Mount
After the partition is complete, you also need to mount the disk to a directory on Linux to use it for data access.
Using the command df–th, first look at the system's existing disk mount condition. As you can see, the disk in the subregion has not been shown, indicating that it has not been mounted on the Linux file system.
Because the network-based cloud disk is being mounted today, the CIFS protocol is required, so a tool cifs-utils is required. Physical disks can skip the following step.
Use the Mount command to complete the mount. The Mount command has a range of parameters that can be viewed with man. If the mount has no parameters, the default is to mount a read-only disk, which requires attention. /DEV/XVDB1 is the disk that needs to be mounted;/mnt is the mount point of the Linux file system
After the mount is complete, we use df–th to check the mount condition and find that the disk has been mounted successfully.
Reboot Auto Mount
Using the above method to mount the disk is not complicated, but if the system shuts down, the disk will need to be mounted again. To avoid wasting time on disk mounting after each reboot of the system, you can modify the/etc/fstab file as follows. This way, after the system restarts, the disk mount is automatically completed according to our configured mount parameters and mount points.