Commit cecfb7b6 authored by Ryan Jackson's avatar Ryan Jackson

Wipe out the first 8K on disks at reload to erase stale LVM data

parent 8ea0419e
......@@ -56,11 +56,11 @@ tweakmbr() {
_CUR=1
;;
12305790s)
_CUR=2
_CUR=2
;;
s)
# special case: no part1 so probably no MBR at all, make sure we install
echo "Found no MBR on $_DSK, installing version $_NEW"
echo "Found no MBR on $_DSK, installing version $_NEW"
_CUR=1000000
;;
*)
......@@ -211,7 +211,7 @@ loadone() {
#
if [ -x /dev/MAKEDEV -a ! -e /dev/$DISK ]; then
(cd /dev; ./MAKEDEV $DISK ${DISK}s2a ${DISK}s3a ${DISK}s4a)
fi
fi
if [ x"$ADDRESS" != x ]; then
isurl=`echo $ADDRESS | grep http -`
......@@ -225,7 +225,7 @@ loadone() {
echo "Need to create or mount /images directory!"
return 1
fi
#
# This needs a lot more work ...
#
......@@ -233,7 +233,7 @@ loadone() {
imagefile="/images/$imagefile"
elif [ x"$ispath" != x ]; then
ispath=1
if [ ! -e $ADDRESS ]; then
echo "$ADDRESS does not exist!"
return 1
......@@ -251,7 +251,7 @@ loadone() {
isurl=0
ispath=0
fi
#
# ZFILL==1: use frisbee
# ZFILL==2: separate disk-wipe pass (not yet implemented)
......@@ -440,7 +440,7 @@ case $STATUS in
mount | grep "^/dev/$d" > /dev/null && continue
zapsuperblocks $d
echo "Invalidating MBR on $d"
dd if=/dev/zero of=/dev/$d bs=512 count=1
dd if=/dev/zero of=/dev/$d bs=512 count=16
done
;;
esac
......
......@@ -85,7 +85,7 @@ tweakmbr()
echo "WARNING: cannot find MBR version $new_mbr_ver, not installed"
return 255
fi
echo "Installing MBR version $new_mbr_ver ..."
dd if=$MBR_PATH/mbr${new_mbr_ver}.dd of=$disk bs=512 count=1
......@@ -115,7 +115,7 @@ find_disks() {
zapsuperblocks()
{
local disk=${1##*/}
echo "Invalidating old potential superblocks on $disk"
partitions=`echo /sys/block/$disk/$disk* 2>/dev/null`
for part in $partitions; do
......@@ -262,7 +262,7 @@ handle_loadinfo()
[hs]d[a-z])
;;
*)
DISK=`$BINDIR/freebsd_to_linux_disk $DISK 0`
DISK=`$BINDIR/freebsd_to_linux_disk $DISK 0`
DISK=${DISK%% *}
;;
esac
......@@ -345,7 +345,7 @@ get_loadinfo()
if [ $time -eq 0 ]; then
return 1
fi
return 0
}
......@@ -409,7 +409,7 @@ case $STATUS in
mount | grep "^/dev/$d" > /dev/null && continue
zapsuperblocks /dev/$d
echo "Invalidating MBR on /dev/$d"
dd if=/dev/zero of=/dev/$d bs=512 count=1
dd if=/dev/zero of=/dev/$d bs=512 count=16
done
;;
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment