1.热添加磁盘后扫描总线
shell> echo "- - -" > /sys/class/scsi_host/host*/scan
2.fdisk查看磁盘信息
shell> fdisk -l #查看磁盘情况
3.fdisk 进入/dev/sda,创建新分区/dev/sda3
shell> fdisk /dev/sda
Command(m for help):n #new新分区
Command action
e extend
p primary partition(1-4)
p #选择主分区
Partition number(1-4):3 #分区序号3
First Cylinder(xxxx-xxxx,default xxxx): #分区开始块,回车使用默认
Using default value xxxx
Last Cylinder,+cylineders or +size(K,M,G)(xxxx-xxxx,default xxxx): #分区结束块
Command(m for help):t #修改分区格式
Partition number(1-4):3 #选择分区序号
Hex code(type L to list codes):8e #格式选择8e Linux LVM
Changed system type of partition 3 to 8e(Linux LVM)
Command(m for help):p #显示分区信息
/dev/sda3 xxxx xxxx xxxx 8e Linux LVM #新建的分区,格式8e
Command(m for help):w #保存信息
The partition table has been altered!
4.更新分区表
shell> partx -u /dev/sda
5.创建物理卷
shell> pvcreate /dev/sda3
Writing physical volume data to disk "/dev/sda3"
Physical volume "/dev/sda3" successfully created
6.查看新建的物理卷和大小
shell> pvdisplay
7.添加新的物理卷到lv_root同一个卷组
shell> vgextend VolGroup /dev/sda3
Volunme group "VolGroup" successfully extended
8.查看卷组信息
shell> vgdisplay
9.增加lv_root大小,增加xG
shell> lvresize -L +xG /dev/mapper/VolGroup-lv_root
Extending logical volume lv_root to xGiB
Logical volume lv_root successfully resized
10.重新识别大小,xfs_growfs是centos7命令,在centos6.X中是resize2fs
shell> resize2fs /dev/mapper/VolGroup-lv_root
11.查看扩容后的大小
shell> df -lh