Recently launched cluster server system disk was found not enough. Check disk consumption, the system disk to use 98%, taking into account the demand of late, had to increase data disc, recorded here under mount process data disk.
1 to confirm whether there is data disk
fdisk -l #查看ECS上的数据盘
FIG / dev / vda a system disk, / dev / vdb and / dev / vdc is a data disk.
Two pairs of data disk partition
fdisk /dev/vdb
In the hard split mode, there are the following commands:
① input m to display all commands listed.
② Enter p to display the partitioning of the hard disk.
③ setting a hard disk input region.
④ n input setting new hard disk partition.
⑤ enter t change disk partition or property.
⑥ enter d to delete the hard disk partition property.
⑦ q input end the partition in the hard disk properties.
⑧ w input end and writing to a hard partition Properties
输入 n #设定新的硬盘分割区
输入p #设置硬盘为主要分割区
输入1 #创建第一个主分区
连续两次回车 #系统自动计算 将数据盘都分给一个区
输入wq #保存操作
3 Check whether the data disk to mount successful (check the partitions)
fdisk -lu /dev/vdb
You can see / dev / vdb1, explained the partition is created successfully
4 format the new partition to create a file system on the new partition
Here we create a ext4 file system, mkfd.vfat command can create a VFAT file system.
mkfs.ext4 /dev/vdb1
5 Create a mount directory
mkdir /BigData
Data disks are created as BigData directory
6 to write the new partition information
echo /dev/vdb1 /BigData ext4 defaults 0 0 >> /etc/fstab #向/etc/fstab写入新分区信息
7 to see the new partition information
cat /etc/fstab
As shown above, it indicates that the write succeeds
8 Mounting File Systems
root@master:~# mount /dev/vdb1 /BigData
9 View the current disk space and usage
df -h
As shown above appears / dev / vdb1 new file system information indicating mount successfully, you can use the new file system.