[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#347479: Seems to not handle VG creation correctly



tags 347479 + patch
thanks

The attached patch adds some basic checks so we do not "just go ahead" in 
situations the code is not ready to handle. Basically, partman-auto-lvm 
will now fail if the device selected for autopartioning already contains 
an LVM physical device.
Also, the check if the name for the volume group is already in use has 
been improved.

This patch introduces some new templates and may thus show untranslated 
messages if included in Beta2. However, the new strings are only shown on 
error situations and should not come into play during most installations 
using partman-auto-lvm.

Comments on the patch very welcome.

diff -Naurd partman-auto-lvm-9.orig/automatically_partition/some_device_lvm/do_option partman-auto-lvm-9/automatically_partition/some_device_lvm/do_option
--- partman-auto-lvm-9.orig/automatically_partition/some_device_lvm/do_option	2006-01-29 19:33:38.000000000 +0100
+++ partman-auto-lvm-9/automatically_partition/some_device_lvm/do_option	2006-02-01 11:53:19.000000000 +0100
@@ -96,11 +96,17 @@
     db_get partman-auto-lvm/new_vg_name
     VG_name="$RET"
 
-    if VG_create "$VG_name" $pv_devices; then break; fi
+    # check if the volume group name is not in use
+    if [ -z "$(VG_list | grep "$VG_name")" ]; then break; fi
     noninteractive="exit 1"
 done
 
-perform_recipe_by_lvm $VG_name $recipe
+if VG_create "$VG_name" $pv_devices; then
+  perform_recipe_by_lvm $VG_name $recipe
+else
+  ## should we show an error message here?
+  exit 1
+fi
 
 # default to accepting the autopartitioning
 menudir_default_choice /lib/partman/choose_partition finish finish || true

Attachment: pgpxQ4SvAz4pt.pgp
Description: PGP signature


Reply to: