[pve-devel] [PATCH] Catch error from vgcreate.

Wolfgang Link w.link at proxmox.com
Wed Mar 2 16:16:02 CET 2016


This is necessary, if the volume group "pve" exists, say from a previous installation.
But whitout printing the reason no user will understand why this happens.
---
 proxinstall | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/proxinstall b/proxinstall
index ec15477..7a67623 100755
--- a/proxinstall
+++ b/proxinstall
@@ -834,8 +834,11 @@ sub create_lvm_volumes {
     # so pe_start is aligned on a 128k boundary (advantage for SSDs)
     syscmd ("/sbin/pvcreate --metadatasize 250k -y -ff $lvmdev") == 0 ||
 	die "unable to initialize physical volume $lvmdev";
-    syscmd ("/sbin/vgcreate pve $lvmdev") == 0 ||
-	die "unable to create volume group";
+
+    eval { syscmd ("/sbin/vgcreate pve $lvmdev") };
+    if (my $err = $@) {
+	die "unable to create volume group: $err";
+    }
 
     my $hdgb = int($os_size/(1024*1024));
     my $space = (($hdgb > 128) ? 16 : ($hdgb/8))*1024*1024;
-- 
2.1.4





More information about the pve-devel mailing list