Prepare a stock centos HN to do vzdumps using LVM snapshots
Situation:
- Stock Centos 4 system with OpenVZ kernel + utilities installed. One big /vz partition, using LVM.
Trying to make a backup using:
It means that you don't have enough free space in the VG (Volume Group) to create an LVM snapshot.
What is the solution? Reduce the size of one partition, then resize one LV (logical volume). This is easily done if you don't have only one big / partition. I usually always make a separate partition for /var and for /vz.
To determine what logical volume needs to be resized, you can use the df -h command. Mine showed:
/dev/mapper/VolGroup00-LogVol05
119G 16G 99G 14% /vz
To resize it:
If you need to know how big are your LV : lvdisplay.
If you need to know how big are our VG: vgdisplay. This also tells the free space in the VG.
You can not try to use lvm snapshots with vzdump.
- Stock Centos 4 system with OpenVZ kernel + utilities installed. One big /vz partition, using LVM.
Trying to make a backup using:
vzdump --dumpdir /var/ --snapshot 101
Error message received:Insufficient free extents (1) in volume groupWhat does that mean?
VolGroup00: 16 required
It means that you don't have enough free space in the VG (Volume Group) to create an LVM snapshot.
What is the solution? Reduce the size of one partition, then resize one LV (logical volume). This is easily done if you don't have only one big / partition. I usually always make a separate partition for /var and for /vz.
To determine what logical volume needs to be resized, you can use the df -h command. Mine showed:
/dev/mapper/VolGroup00-LogVol05
119G 16G 99G 14% /vz
To resize it:
- Make backups of your VM to be sure
- Stop the vz service (service vz stop)
- umount /vz
- e2fsck -f /dev/VolGroup00/LogVol05
- Use resize2fs /dev/VolGroup00/LogVol05 110G
- Use lvresize to reduce the LV sizey by 2 GB:lvresize --size -2G /dev/VolGroup00/LogVol05
- e2fsck -f /dev/VolGroup00/LogVol05
- resize2fs /dev/VolGroup00/LogVol05
If you need to know how big are your LV : lvdisplay.
If you need to know how big are our VG: vgdisplay. This also tells the free space in the VG.
You can not try to use lvm snapshots with vzdump.
Comments