OpenVZ-7缩容系统盘
首先重设ROOT密码
1:在启动项中按e
2:找到quick后面加空格init=/bin/sh
3:然后CTRL+X
4:mount -o remount,rw /
5:passwd改密码
6:强制重启
将30G的vz逻辑卷删除
1:首先umount /vz,但提示busy,所以只能改/etc/fstab然后重启
2:重启后mkdir /mnt/vz && mount /dev/openvz/vz /mnt/vz
3:然后恢复cp -a /mnt/vz/* /vz/
4:卸载umount /mnt/vz
5:最后lvremove /dev/openvz/vz
在线迁移PV卷
1:放入一块新的临时硬盘
2:pvcreate /dev/vdb创建新的PV
3:vgextend openvz /dev/vdb进新的pv
4:然后用pvmove /dev/vda4 /dev/vdb转移旧PV的到新的PV
5:vgreduce openvz /dev/vda4
6:pvremove /dev/vda4最后删掉旧的PV
7:fdisk /dev/vda重新分区End到41940991(20Gib)
8:reboot
9:pvcreate /dev/vda4
10:vgextend openvz /dev/vda4
11:pvmove /dev/vdb /dev/vda4把数据转移回来
12:vgreduce openvz /dev/vdb
13:pvremove /dev/vdb
14:可以删掉vdb了
标签:缩容,PV,openvz,OpenVZ,vda4,dev,系统盘,vdb,vz
From: https://www.cnblogs.com/xiangxisheng/p/18104386