The partition and mount summary of the cloud disk under the Linux Operation--linux Basic article __linux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.