Citrix   虚拟机在线扩容根目录操作

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


spacer.gif wKiom1Nt9frTp_keAAAq51AnEDc958.png

第二步:    通过xencenter 增加一个 storage    ----------------------400GB

wKiom1Nt9t3SvmSNAAEmJrPRHoo169.png

第三步:         fdisk -l查看是否能够看到此storage

spacer.gif wKioL1Nt9s6znz9gAACQIl2Br4A636.png

由此看出,/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 wKiom1Nt9w_jcw3-AABKJ_x-OTg801.png

然后建立pv

[root@svnbackup ~]# pvcreate /dev/xvdb
spacer.gif wKioL1Nt9vbyokL3AAAi1JlxiYQ855.png

删除    pv
[root@svnbackup ~]# pvremove /dev/xvdb
spacer.gif wKiom1Nt9y-BD5YJAAAPnPArXHE797.png

第五步: 加到已存在的VG组中去


spacer.gif wKiom1Nt9zyTwAKLAAAtA9nK9u0273.png


第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 wKiom1Nt90riBJHKAAA_EVmAWVE777.png

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
wKioL1Nt9y3yiFMLAAAq51AnEDc704.png
spacer.gif

扩容后的大小     /  目录扩大为  230G   (扩容成功)

spacer.gif wKiom1Nt92DyKFGsAAAmAWJLqMc234.png


你可能感兴趣的:(虚拟机,linux,storage,在线,根目录)