Applicable system: Non-IO optimized +SSD cloud Disk Linux (Redhat, Centos,debian,ubuntu) instance, IO Optimization instance +SSD cloud disk partition mount recommended script: Tools: auto_fdisk_ssd.sh
* 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 disk
Before 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:
Tip: If you execute the fdisk-l command and find that no/DEV/XVDB indicates that your cloud service has no data disk, you do not need to mount the tutorial, which is not applicable to you at this time
2. Partition the data disk
Execute the "fdisk-s 56/dev/xvdb" command to partition the data disk;
According to the prompt, enter "n", "P" "1", two times Enter, "Wq", the partition will begin, will be completed soon.
3. View New partitions
With the "fdisk-l" command you can see that the new partition XVDB1 has been established.
4. Format the new partition
Take 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 information
Write 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 you need to attach the data disk to a folder separately, for example, to store the page separately, you can modify the/mnt part of the above command.
6. Mount the new partition
Use 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 System Mount Data disk