最近Image 服务器老是报警,磁盘空间超过了90%,原先使用了LVM,买了一块磁盘加上去。
扩容的过程:
1 先创建物理卷PV (之前的分区,这里就不描述了)
# pvcreate /dev/sdb1
# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 136.63 GB / not usable 5.83 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 4372
Free PE 0
Allocated PE 4372
PV UUID 9Tn5q7-zmzZ-tnQe-Jj0y-kpqV-JBvC-uTd1Ik
--- Physical volume ---
PV Name /dev/sdb1
VG Name VolGroup00
PV Size 136.73 GB / not usable 11.78 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 4375
Free PE 1175
Allocated PE 3200
PV UUID hTcPFR-IcTu-SsKu-oi5v-yniv-Hvon-qePnwf
2 接着将创建的物理卷加入到逻辑卷组中
# vgextend VolGroup00 /dev/sdb1
3 对逻辑卷组扩容
# lvextend -L+100G /dev/VolGroup00/LogVol00
4 加入后使用resize2fs
# resize2fs /dev/VolGroup00/LogVol00
5 使用df查看
[root@lxdm6 spool]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 216G 104G 101G 51% ***
6 使用pvscan可以看出第2块硬盘还有36.72G未分配
[root@lxdm6 spool]# pvscan
PV /dev/sda2 VG VolGroup00 lvm2 [136.62 GB / 0 free]
PV /dev/sdb1 VG VolGroup00 lvm2 [136.72 GB / 36.72 GB free]
Total: 2 [273.34 GB] / in use: 2 [273.34 GB] / in no VG: 0 [0 ]
7 下面有篇文章介绍的lvm满具体,可以参考下
http://crazylinux.blog.51cto.com/259244/216795
阅读(1549) | 评论(0) | 转发(0) |