1 1.1 haad #!/bin/sh -x 2 1.1 haad 3 1.1 haad # Original script used to convert a VG from LVM1 to LVM2 metadata format. 4 1.1 haad # Superceded by 'vgconvert', but left here to show how to do it step-by-step. 5 1.1 haad 6 1.1 haad # Takes vgname as parameter. No error checking. Uses temp file 'lvmbackup'. 7 1.1 haad 8 1.1 haad echo "Please use the 'vgconvert' tool instead" 9 1.1 haad exit 1 10 1.1 haad 11 1.1 haad ./vgcfgbackup $1 || exit 1 12 1.1 haad ./vgcfgbackup --file lvmbackup $1 || exit 1 13 1.1 haad 14 1.1 haad CMDS=`./pvscan -u | sed -ne "s/.*PV \(.*\) with UUID \(.*\) VG $1 .*/.\/pvcreate -ff -y -M lvm2 --restorefile lvmbackup -u \2 \1 ; /p"` 15 1.1 haad 16 1.1 haad sh -x -c "$CMDS" || exit 1 17 1.1 haad 18 1.1 haad ./vgcfgrestore --file lvmbackup -M lvm2 $1 || exit 1 19