File: vg_convert

package info (click to toggle)
lvm2 2.02.111-2.2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 8,856 kB
  • sloc: ansic: 101,481; sh: 15,369; makefile: 1,843; python: 777; ruby: 332; awk: 20
file content (18 lines) | stat: -rwxr-xr-x 591 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh -x

# Original script used to convert a VG from LVM1 to LVM2 metadata format.
# Superceded by 'vgconvert', but left here to show how to do it step-by-step.

# Takes vgname as parameter.  No error checking.  Uses temp file 'lvmbackup'.

echo "Please use the 'vgconvert' tool instead"
exit 1

./vgcfgbackup $1 || exit 1
./vgcfgbackup --file lvmbackup $1 || exit 1

CMDS=`./pvscan -u | sed -ne "s/.*PV \(.*\) with UUID \(.*\) VG $1 .*/.\/pvcreate -ff -y -M lvm2 --restorefile lvmbackup -u \2 \1 ; /p"`

sh -x -c "$CMDS" || exit 1

./vgcfgrestore --file lvmbackup -M lvm2 $1 || exit 1