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.