Applicable system: Linux (Redhat, Centos,debian,ubuntu)
* The Linux cloud Server data disk is not partitioned and formatted, and can be partitioned and formatted according to the following steps.
The following operation will divide the data disk into a partition to use.
1. View Data DiskBefore partitioning and formatting the data disk, using the "df–h" command, you cannot see the data disk, you can use the "fdisk-l" command to view. Such as:
Friendly tips:
If you execute the fdisk-l command and find no/dev/xvdb indicating that your cloud service does not have a data disk, you do not need to mount the tutorial, which is not applicable to you at this time
2. Partition the data diskExecute "fdisk-s 56/dev/xvdb" command, partition the data disk; According to the prompt, enter "n", "P" "1", two times the carriage return, "Wq", the partition will start, will be completed soon.
3. View New PartitionsWith the "fdisk-l" command you can see that the new partition XVDB1 has been established.
4. Format the new partitionTake ext3 as an example: Use the "MKFS.EXT3/DEV/XVDB1" command to format the new partition, and the time to format varies depending on the size of the hard disk. (You can also decide to choose Other file formats, such as EXT4, etc.)
5. Add partition informationWrite new partition information using the "Echo '/dev/xvdb1/mnt ext3 defaults 0 0 ' >>/etc/fstab" (unquoted) command.
Then using the "cat/etc/fstab" command to view, the following message indicates that the write was successful. Note: ubuntu12.04 does not support barrier, so the correct wording is: Echo '/dev/xvdb1/mnt ext3 barrier=0 0 0 ' >>/etc/fstab* if it is necessary to mount the data disk to a folder separately, You can modify the/mnt section of the above command if you are using it as a separate page.
6. Mount the new partitionUse the "mount-a" command to mount the new partition, and then use the "df-h" command to view the following message stating that the mount was successful and you can start using the new partition.
Linux Mount Aliyun Data disk