1827758 Members
2854 Online
109969 Solutions
New Discussion

LVM Snap Shot

 
SOLVED
Go to solution
Nath_3
Frequent Advisor

LVM Snap Shot

Hi All,

Can i get some detailed explanation regarding the LVM Snapshot. (With Commands)

Thanks
3 REPLIES 3
Ivan Ferreira
Honored Contributor
Solution

Re: LVM Snap Shot

Here is a good example and usage:

http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Nath_3
Frequent Advisor

Re: LVM Snap Shot

Thanks. Useful link
skt_skt
Honored Contributor

Re: LVM Snap Shot


Check if this helps

If we need to preserve a backup of a file system which is subject to a major change and a BCV option is not available, the following procedure can be followed. This uses LVM mirroring for the same.

Pre-requisites : MirrorDisk/UX software installed in the server.
Sufficient space in a different group of disks for mirroring.

=> Create a spare lv ( temporary one ) to fill up the existing free space of the VG.
=> Add adequate spare disks to the VG.
=> lvextend -m 1 /dev/vgname/lvname
=> lvdisplay -v /dev/vgname/lvname |grep -I stale
To make sure there is no stale LVs.
=> Make sure that there is no data modification happening
In case of a db file system halt the database.
=> lvsplit /dev/vgname/lvname
This will create two lvs as /dev/vgname/lvname and /dev/vgname/lvnameb

=> /dev/vgname/lvnameb can be used as a preserved backup LV.
Can be mounted if require.

=> If require to retrieve data

/usr/sbin/lvmerge dest_lv_path src_lv_path

eg:- to copy data from /dev/vgname/lvnameb back to /dev/vgname/lvname

/usr/sbin/lvmerge /dev/vgname/lvname /dev/vgname/lvnameb

This will result in a single LV /dev/vgname/lvnameb with the old data.

=> lvmerge can be used even if the lvs are not created by a previous lvsplit command also. But the lvs should be of the same size.

Please refer to man page of lvsplit and lvmerge before any such activity.