5

Backup of LVM2 logical volume

view full story
linux-howto

http://unix.stackexchange.com – I'd like to make backup on external drive of LVM2 logical volume in dd manner. Approach I consider is to make lv on extranl drive with identical size copy with dd (Please let me know if you see something really wrong in such approach. I need something reliable and fast.) I would like to automatize whole process, it is what I have: # Sanity check that lv is not used lvuses="$( lvdisplay -c /dev/mapper/vgA-AA | cut -d ':' -f 6 )" if [ $lvuses -gt 0 ]; then exit 1 ; fi #obtain lv size (in sectors) lvsize="$( lvdisplay -c /dev/mapper/vgA-AA | cut -d ':' -f 7 )" #create destination lvcreate (HowTos)