From 88787ea0e8554383b71b9f93f7d27cfd2b6961eb Mon Sep 17 00:00:00 2001 From: Jay Faulkner Date: Thu, 16 Jan 2014 10:55:08 -0800 Subject: [PATCH] fix(makefs.sh): Remove any existing partition tables - In the SFO lab we got some errors about how a GPT partition table still partially existed. Zero out the first couple megs of the drive to ensure any vestige of old partition table is gone before imaging. - This should be removed once we support secure erase. --- teeth_agent/shell/makefs.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teeth_agent/shell/makefs.sh b/teeth_agent/shell/makefs.sh index a10613146..c3c8a0981 100755 --- a/teeth_agent/shell/makefs.sh +++ b/teeth_agent/shell/makefs.sh @@ -22,6 +22,10 @@ DEVICE="$3" [[ -f $IMAGEFILE ]] || usage "$2 (IMAGEFILE) is not a file" [[ -b $DEVICE ]] || usage "$3 (DEVICE) is not a block device" +# In production this will be replaced with secure erasing the drives +# For now we need to ensure there aren't any old (GPT) partitions on the drive +dd if=/dev/zero of=$DEVICE bs=512 count=10 + qemu-img convert -O raw $IMAGEFILE $DEVICE # Create small partition at the end of the device