linux下根目录扩容
划分出一个磁盘,并将其格式化
[root@gg ~]# mkfs.ext3 /dev/sdb2
创建一个物理卷
[root@gg ~]# pvcreate /dev/sdb2
[root@gg ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup lvm2 a-- 19.51g 0
/dev/sdb2 lvm2 --- 153.13g 153.13g
[root@gg ~]#
[root@gg ~]#
根路径所在的卷组进行扩容
[root@gg ~]# vgextend VolGroup /dev/sdb2
Volume group "VolGroup" successfully extended
[root@gg ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup 2 2 0 wz--n- 172.64g 153.13g
将根目录的那个逻辑卷进行扩容
[root@gg ~]# 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
[root@gg ~]# 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.
[root@gg ~]# 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
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