[PC-BSD Commits] r6540 - pcbsd/trunk/pc-sysinstall/backend-partmanager

svn at pcbsd.org svn at pcbsd.org
Fri Apr 9 08:45:01 PDT 2010


Author: kris
Date: 2010-04-09 08:45:00 -0700 (Fri, 09 Apr 2010)
New Revision: 6540

Modified:
   pcbsd/trunk/pc-sysinstall/backend-partmanager/delete-part.sh
Log:

When removing partitions, if we delete the last one, destroy the geom so we can
switch between GPT / MBR when we begin creating again



Modified: pcbsd/trunk/pc-sysinstall/backend-partmanager/delete-part.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend-partmanager/delete-part.sh	2010-04-09 09:01:25 UTC (rev 6539)
+++ pcbsd/trunk/pc-sysinstall/backend-partmanager/delete-part.sh	2010-04-09 15:45:00 UTC (rev 6540)
@@ -3,6 +3,7 @@
 ########################################################
 
 . ${PROGDIR}/backend/functions.sh
+. ${PROGDIR}/backend/functions-disk.sh
 
 if [ -z "${1}" ]
 then
@@ -52,4 +53,11 @@
 
 echo "Running: gpart delete -i ${PARTINDEX} ${DISK}"
 gpart delete -i ${PARTINDEX} ${DISK} >/dev/null 2>/dev/null
+
+# Check if this was the last partition and destroy the disk geom if so
+get_disk_partitions "${DISK}"
+if [ -z "${VAL}" ] ; then
+  gpart destroy ${DISK}  
+fi
+
 exit "$?"



More information about the Commits mailing list