划分出一个磁盘,并将其格式化
[[email protected] ~]# mkfs.ext3 /dev/sdb2
创建一个物理卷
[[email protected] ~]# pvcreate /dev/sdb2
[[email protected] ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup lvm2 a-- 19.51g 0
/dev/sdb2 lvm2 --- 153.13g 153.13g
[[email protected] ~]#
[[email protected] ~]#
根路径所在的卷组进行扩容
[[email protected] ~]# vgextend VolGroup /dev/sdb2
Volume group "VolGroup" successfully extended
[[email protected] ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup 2 2 0 wz--n- 172.64g 153.13g
将根目录的那个逻辑卷进行扩容
[[email protected] ~]# lvextend -L +30G /dev/mapper/VolGroup-lv_root
Size of logical volume VolGroup/lv_root changed from 17.54 GiB (4490 extents) to 47.54 GiB (12170 extents).
Logical volume lv_root successfully resized
[[email protected] ~]# resize2fs -p /dev/mapper/VolGroup-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/VolGroup-lv_root is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 3
Performing an on-line resize of /dev/mapper/VolGroup-lv_root to 12462080 (4k) blocks.
The filesystem on /dev/mapper/VolGroup-lv_root is now 12462080 blocks long.
[[email protected] ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 47G 11G 34G 25% /
tmpfs 3.9G 72K 3.9G 1% /dev/shm
/dev/sda1 477M 29M 424M 7% /boot
原文地址:https://www.cnblogs.com/wangqianqiannb/p/8446761.html