[PC-BSD Commits] r2560 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts
svn at pcbsd.org
svn at pcbsd.org
Thu Aug 7 16:35:15 PDT 2008
Author: kris
Date: 2008-08-07 16:35:15 -0700 (Thu, 07 Aug 2008)
New Revision: 2560
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 what should be all problems when using gjournal, either going from journaling to UFS+S or going to UFS regular. Now it the scripts correctly stop gjournal, which allows bsdlabel to work properly
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh 2008-08-07 21:58:35 UTC (rev 2559)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatDisk.sh 2008-08-07 23:35:15 UTC (rev 2560)
@@ -6,6 +6,9 @@
# Set our sysctl so we can overwrite any geom using drives
sysctl kern.geom.debugflags=16
+#Get our Device Name
+device=${1}
+
# Check if we need to shutdown any journals on this drive
ls /dev/${1}*.journal >/dev/null 2>/dev/null
if [ "$?" = "0" ]
@@ -13,13 +16,12 @@
cd /dev
for i in `ls ${1}*.journal`
do
- gjournal stop ${i}
- gjournal clear ${i}
+ rawjournal="`echo ${i} | cut -d '.' -f 1`"
+ gjournal stop -f ${rawjournal}
+ gjournal clear ${rawjournal}
done
fi
-#Get our Device Name
-device=${1}
#Erase any existing bootloader
dd if=/dev/zero of=/dev/${device} count=1024
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh 2008-08-07 21:58:35 UTC (rev 2559)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FormatPartition.sh 2008-08-07 23:35:15 UTC (rev 2560)
@@ -9,19 +9,23 @@
#Get our Device Name
device=${1}
-# Get the Slice Number
+# Get the full Slice Number (Example /dev/ad0s1)
slice=${2}
+# Get the device name without the /dev on it
+rawslice="`echo ${2} | cut -d '/' -f 3`"
# Check if we need to shutdown any journals on this partition
-ls ${2}*.journal* >/dev/null 2>/dev/null
+ls ${slice}*.journal* >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
cd /dev
- for i in `ls ${2}*.journal*`
+ for i in `ls ${rawslice}*.journal`
do
- gjournal stop ${i}
- gjournal clear ${i}
+ # Get rid of the .journal extension now
+ rawjournal="`echo ${i} | cut -d '.' -f 1`"
+ gjournal stop -f ${rawjournal}
+ gjournal clear ${rawjournal}
done
fi
More information about the Commits
mailing list