~ubuntu-branches/ubuntu/breezy/lvm2/breezy

« back to all changes in this revision

Viewing changes to scripts/vg_convert

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Caulfield
  • Date: 2004-11-03 09:37:56 UTC
  • Revision ID: james.westby@ubuntu.com-20041103093756-jt0nj8z0v8k1lyiv
Tags: upstream-2.00.25
ImportĀ upstreamĀ versionĀ 2.00.25

Show diffs side-by-side

added added

removed removed

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