[root@a ~]# df文件系统 1K-块 已用 可用 已用% 挂载点/dev/mapper/VolGroup00-LogVol00 6983168 2909812 3712908 44% /系统分区的VG是VolGroup00,VL是LogVol00这里我们增加一块硬盘/dev/sdb将/dev/sdb建立为pv[root@a ~]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created由于系统已经有了VG:VolGroup00,这里直接将新建的pv加入到系统VG:VolGroup00[root@a ~]# vgextend VolGroup00 /dev/sdb Volume group "VolGroup00" successfully extended给LogVol00系统LV增加1G的空间[root@a ~]# lvextend -L +1G /dev/VolGroup00/LogVol00 Extending logical volume LogVol00 to 7.88 GB Logical volume LogVol00 successfully resizedLV扩容之后需要激活修改的配置[root@a ~]# resize2fs /dev/VolGroup00/LogVol00resize2fs 1.39 (29-May-2006)Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing requiredPerforming an on-line resize of /dev/VolGroup00/LogVol00 to 2064384 (4k) blocks.The filesystem on /dev/VolGroup00/LogVol00 is now 2064384 blocks long.查看扩容之后的系统分区[root@a ~]# df -l文件系统 1K-块 已用 可用 已用% 挂载点/dev/mapper/VolGroup00-LogVol00 7998912 2909816 4676232 39% //挂载点的总容量增加了1G,扩容成功再来查看VolGroup00参数[root@a ~]# vgdisplay -v VolGroup00 Using volume group(s) on command line Finding volume group "VolGroup00" --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 7 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 10.84 GB PE Size 32.00 MB Total PE 347 Alloc PE / Size 284 / 8.88 GB Free PE / Size 63 / 1.97 GB //还有剩余空间可以分配 VG UUID vPFrNV-lcZz-ZiAA-oZpt-VqWZ-gIC3-RCuJG7 --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID 9QP8xz-w6dQ-luU0-y52W-1vct-1BvG-zKjLO8 LV Write Access read/write LV Status available # open 1 LV Size 7.88 GB Current LE 252 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID DWTtvU-SwNi-6Vho-HetD-O2a0-hSRV-F8AYi1 LV Write Access read/write LV Status available # open 1 LV Size 1.00 GB Current LE 32 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 --- Physical volumes --- //在这个VG中有两块物理硬盘 PV Name /dev/sda2 PV UUID 594r8z-ROTL-2VBc-DPlr-f4iG-Blx5-Vu1I81 PV Status allocatable Total PE / Free PE 252 / 0 PV Name /dev/sdb PV UUID 1R1H2t-f2DP-hYCQ-hkBE-HtmD-2kZy-2Bj4TY PV Status allocatable Total PE / Free PE 95 / 63实验完成[root@localhost ~]# resize2fs /dev/VolGroup00/LogVol00resize2fs 1.35 (28-Feb-2004)/dev/VolGroup00/LogVol00 is mounted; can't resize a mounted filesystem!You can useext2online -v /dev/VolGroup00/LogVol00instead of "resize2fs /dev/VolGroup00/LogVol00", to extend an online / fsThanks.对lvm2创建的LVM卷来说,容量大小取决于kernel的限制 (当然,还有你的磁盘空间)64位,2.6,最大8EB32位,2.6,最大16TB
posted on 2013-12-02 18:49
回忆之城 阅读(173)
评论(0) 编辑 收藏 引用 所属分类:
unix/linux