Linux system format disk and mount partition __linux

Source: Internet
Author: User

Usually in addition to the disk or new system, it is essential to format the disk, partition, mount the partition. Played Ali and other virtual host friends know that the data disk is required to partition and mount, for the novice is indeed a difficult problem, special note, for reference.

Use the DF-LH command to see that the system has only a system disk.

Using Fdisk-l to view the disk situation, you can see from the following figure that there is one disk that is not partitioned and remembers the identity of the partition, here we are/dev/xvdb:

To perform FDISK/DEV/XVDB on the disk partition, you need to enter "n", "P", "1", two times carriage return, "WQ":

Fdisk/dev/xvdb


After the completion of the fdisk-l can see the partition of the disk, and remember that the letter logo we are here/DEV/XVDB1, since the division is not a good area. The answer is no, it's not done yet.

Format partitions:

Mkfs.ext4/dev/xvdb1

After the format is completed, the mount partition is mounted:

1. Write partition information to Fstab

Echo '/dev/xvdb1/mjydata ext4 defaults 0 0 ' >>/etc/fstab
2. Mount Partition

Mount-a


Again with the DF-LH command to view, there will be a new partition:


Up to this point, the entire Linux disk partition is mounted and loaded.

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.