Alibaba Cloud: attaching data disks in Linux

Source: Internet
Author: User
Linux ECS data disks are not partitioned or formatted. you can perform the following steps to partition and format them. The following operations will divide the data disk into a partition applicable system: Linux (Redhat, CentOS, Debian, Ubuntu)

* Linux ECS data disks are not partitioned or formatted. you can perform the following steps to partition and format them.

The following operations will divide the data disk into a partition for use.
 

1. run the "df-h" command to view the data disk before partitioning or formatting the data disk. you can run the "fdisk-l" command to view the data disk. For example:



 

Tip: If you run the fdisk-l command and find that no/dev/xvdb indicates that your cloud service has no data disk, you do not need to attach it. this tutorial is not applicable to you.

 


2. run the "fdisk-S 56/dev/xvdb" command to partition the data disk. enter "n" as prompted ", "p" "1", press enter twice, and "wq", the partition starts and will be completed soon.

 


 


3. run the "fdisk-l" command to view the new partition. The new partition xvdb1 has been created.




 


4. format the new partition and use the "mkfs. ext3/dev/xvdb1" command to format the new partition. the formatting time varies with the hard disk size. (You can also choose ext4 format on your own)

 

 

 


5. run the echo '/dev/xvdb1/mnt ext3 defaults 0 0'>/etc/fstab command to add the partition information and write the new partition information.
Run the "cat/etc/fstab" command to check whether the write is successful. * If you need to mount the data disk to a folder separately, for example, to store webpages separately, you can modify the/mnt part of the preceding command.



 

6. mount a new partition by running the "mount-a" command, and then run the "df-h" command to view the new partition. if the following information is displayed, the mount is successful, you can start using the new partition.


Related Article

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.