[PC-BSD Commits] r2417 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts
svn at pcbsd.org
svn at pcbsd.org
Tue Jul 22 13:32:15 PDT 2008
Author: kris
Date: 2008-07-22 13:32:15 -0700 (Tue, 22 Jul 2008)
New Revision: 2417
Modified:
pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh
pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
Log:
Fixed up some bugs when blowing away geom enabled partitions / drives
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh 2008-07-22 19:50:55 UTC (rev 2416)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh 2008-07-22 20:32:15 UTC (rev 2417)
@@ -3,6 +3,20 @@
# Configuration file
. /usr/local/pcbsd/scripts/PCBSD.Config
+# Set our sysctl so we can overwrite any geom using drives
+sysctl kern.geom.debugflags=16
+
+# Check if we need to shutdown any journals on this drive
+ls /dev/${1}*.journal >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ cd /dev
+ for i in `ls ${1}*.journal`
+ do
+ gjournal stop ${i}
+ done
+fi
+
#Get our Device Name
device=${1}
@@ -11,7 +25,7 @@
sleep 2
-fdisk -I -B /dev/${DEVICE}
+fdisk -I -B /dev/${device}
# Install new partition setup
fdisk -f /tmp/fdiskconfig /dev/${device}
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh 2008-07-22 19:50:55 UTC (rev 2416)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh 2008-07-22 20:32:15 UTC (rev 2417)
@@ -3,12 +3,26 @@
# Configuration file
. /usr/local/pcbsd/scripts/PCBSD.Config
+# Set our sysctl in case we are working with any geom using partitions
+sysctl kern.geom.debugflags=16
+
#Get our Device Name
device=${1}
# Get the Slice Number
slice=${2}
+# Check if we need to shutdown any journals on this drive
+ls /dev/${1}${2}*.journal >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ cd /dev
+ for i in `ls ${1}${2}*.journal`
+ do
+ gjournal stop ${i}
+ done
+fi
+
# Install new partition setup
fdisk -f /tmp/fdiskconfig /dev/${device}
More information about the Commits
mailing list