Applicable Systems: Linux (Redhat, CentOS, Debian, Ubuntu) * Linux ECS data disks are not partitioned or formatted. you can perform partitioning and formatting according to the following steps. The following operations will divide the data disk into a partition for use. 1. view the data disk before partitioning and formatting the data disk, use the & ldquo; df & ndash; h & rdquo; life-oriented 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. View data disksBefore partitioning and formatting a data disk, you cannot view the data disk by running the "df-h" command. 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. partition data disksRun the "fdisk-S 56/dev/xvdb" command to partition the data disk. enter "n", "p", and "1" as Prompted. press enter twice, "wq", the partition starts and will be completed soon.
3. view the new partitionRun the "fdisk-l" command to check that the new partition xvdb1 has been created.
4. format the new partition.Take ext3 as an example: 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 other file formats, such as ext4)
5. add partition informationUse the echo '/dev/xvdb1/mnt ext3 defaults 0 0'>/etc/fstab (without quotation marks) command to write new partition information.
Run the "cat/etc/fstab" command to check whether the write is successful. Note: ubuntu12.04 does not support barrier, so the correct syntax is: echo '/dev/xvdb1/mnt ext3 barrier = 0 0 0'>/etc/fstab * 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 above command.
6. mount a new partitionRun the "mount-a" command to mount the new partition and run the "df-h" command to view the new partition. the following information indicates that the partition is successfully mounted and you can start using the new partition.