Skip to content
Snippets Groups Projects
Commit 9271e58a authored by micah's avatar micah :speech_balloon:
Browse files

older versions (lenny) of lvm2 have a bug in vgcfgbackup that makes it so when...

older versions (lenny) of lvm2 have a bug in vgcfgbackup that makes it so when you specify multiple volume groups to backup, it gives an error, saying you must set the %s template for the name. We are doing that, it just cannot handle it properly.

This change routes around this issue, which has been fixed in later lvm2 releases, by passing only one argument to vgcfgbackup by taking all the volume groups that are found and running them through a for loop
parent a80d6f4a
No related branches found
No related tags found
No related merge requests found
...@@ -649,8 +649,11 @@ function doLvmBackup () { ...@@ -649,8 +649,11 @@ function doLvmBackup () {
debug "$VGS --options vg_name --noheadings | @SED@ 's/^[ ]*//' | @SED@ 's/[ ]*$//' | tr '\n' ' '" debug "$VGS --options vg_name --noheadings | @SED@ 's/^[ ]*//' | @SED@ 's/[ ]*$//' | tr '\n' ' '"
vgs=`$VGS --options vg_name --noheadings | @SED@ 's/^[ ]*//' | @SED@ 's/[ ]*$//' | tr '\n' ' '` vgs=`$VGS --options vg_name --noheadings | @SED@ 's/^[ ]*//' | @SED@ 's/[ ]*$//' | tr '\n' ' '`
debug "Let's try to backup LVM metadata for detected volume groups: $vgs" debug "Let's try to backup LVM metadata for detected volume groups: $vgs"
debug "$VGCFGBACKUP --file \"${lvmdir}\"/\'%s\' $vgs" for vg in $vgs
output=`$VGCFGBACKUP --file "${lvmdir}"/'%s' $vgs` do
debug "$VGCFGBACKUP --file \"${lvmdir}\"/\'%s\' $vg"
output=`$VGCFGBACKUP --file "${lvmdir}"/'%s' $vg`
done
exit_code=$? exit_code=$?
debug $output debug $output
case $exit_code in case $exit_code in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment