第一步:查看原来没扩容之前磁盘的情况

spacer.gif
第二步:    通过xencenter
增加一个
storage    ----------------------400GB
第三步:        
fdisk -l查看是否能够看到此storage
spacer.gif
由此看出,/dev/xvdb  是没有被 Linux 利用的 storage
第四步:建立  PV
当出现   Unknown device  时,可以执行下面这条命令处理
[root@svnbackup ~]# pvs
 Couldn't find device with uuid Xet5se-uATk-zxrY-8BpA-3BLw-AJr1-UYFGcA.
 PV VG Fmt Attr PSize PFree
 /dev/xvda2 VolGroup00 lvm2 a- 99.88G 0
 /dev/xvdb lvm2 a- 400.00G 400.00G
 unknown device VolGroup00 lvm2 a- 399.97G 399.97G
[root@svnbackup ~]# vgreduce --removemissing VolGroup00
 Couldn't find device with uuid Xet5se-uATk-zxrY-8BpA-3BLw-AJr1-UYFGcA.
 Wrote out consistent volume group VolGroup00
[root@svnbackup ~]#
[root@svnbackup ~]# pvs
 PV VG Fmt Attr PSize PFree
 /dev/xvda2 VolGroup00 lvm2 a- 99.88G 0
 /dev/xvdb lvm2 a- 400.00G 400.00G
[root@svnbackup ~]#
spacer.gif
然后建立pv
[root@svnbackup ~]# pvcreate /dev/xvdb
spacer.gif
删除    pv
[root@svnbackup ~]# pvremove /dev/xvdb
spacer.gif
第五步: 加到已存在的VG组中去
spacer.gif
第6步:扩展逻辑卷
[root@svnbackup ~]# lvextend -L +200G /dev/mapper/VolGroup00-LogVol00
 Extending logical volume LogVol00 to 230.00 GB
 Logical volume LogVol00 successfully resized
spacer.gif
LV扩容之后需要激活修改的配置
[root@svnbackup ~]# lvextend -L +200G /dev/mapper/VolGroup00-LogVol00
 Extending logical volume LogVol00 to 230.00 GB
 Logical volume LogVol00 successfully resized
[root@svnbackup ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      30G 2.3G 26G 8% /
/dev/mapper/VolGroup00-LogVol02
                      60G 372M 57G 1% /data
/dev/xvda1 99M 14M 80M 15% /boot
tmpfs 1.0G 0 1.0G 0% /dev/shm
[root@svnbackup ~]# resize2fs /dev/mapper/VolGroup00-LogVol00
------------
LV扩容之后需要激活修改
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/mapper/VolGroup00-LogVol00 to 60293120 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-LogVol00 is now 60293120 blocks long.
第七步: 验证扩容是否成功
扩容前的大小    /  目录只有 30G
spacer.gif
扩容后的大小     /  目录扩大为  230G   (扩容成功)
spacer.gif