Table of Contents

Update RHEL LVM backup

We use install RHEL 6 or 7 in one Volume Group (VG), named “rootvg”, usually only in one LUN o Physical Volume. So this guide supposes that you have installed your OS on rhel VG and your app on db2vg VG, named “appvg”.

We faced a problem, if you make a snapshot of a machine with large data, the snapshot can took two days to get merged, production environment can allowed that behavior.

The plan is take only the rootvg for the snapshot or use dd to make a backup only of rootvg

We will cover three scenarios over VM machines:

Machine setup

[root@localhost ~]# lvs
  LV    VG    Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  db2lv db2vg -wi-ao----   9.00g
  root  rhel  -wi-ao----   7.09g
  swap  rhel  -wi-ao---- 924.00m

Create snapshot of rootvg only

We will cover only the steps of make a snapshot, but you must have knowledge about remove disk temporary. The steps are:

Create snapshot

virsh connect qemu:///system
snapshot-create-as --domain rhel7.4-db2-pruebalun --name "rhel7.4-db2-pruebalun-snapshot-hoy"
snapshot-list rhel7.4-db2-pruebalun
snapshot-info --current rhel7.4-db2-pruebalun

Revert snapshot

virsh connect qemu:///system
snapshot-revert --domain rhel7.4-db2-pruebalun --snapshotname rhel7.4-db2-pruebalun-snapshot-hoy --running

Delete snapshot

virsh connect qemu:/system snapshot-delete –domain rhel7.4-db2-pruebalun –snapshotname rhel7.4-db2-pruebalun-snapshot-hoy </code>