diff options
| author | Shivanand Tendulker <stendulker@gmail.com> | 2016-02-09 08:35:36 -0800 |
|---|---|---|
| committer | Shivanand Tendulker <stendulker@gmail.com> | 2016-02-09 09:13:07 -0800 |
| commit | 8f5ed3e2f16cd401b41b2c27617251e8d9894cf2 (patch) | |
| tree | f2bb952558b5335af0298125f0510ba01ade9bd9 | |
| parent | e76390b915aa0f42ca6964704126872f9cc0c963 (diff) | |
| download | ironic-python-agent-8f5ed3e2f16cd401b41b2c27617251e8d9894cf2.tar.gz | |
Clear GPT and MBR data structures on disk before imaging
This patch clears all GPT and MBR data structures on the disk.
GPT maintains its data structures at start and at end of the
disk.
Change-Id: I8d0b367755b568cb44f02f62b873659b4bea0f14
Closes-Bug: #1543339
| -rwxr-xr-x | ironic_python_agent/shell/write_image.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ironic_python_agent/shell/write_image.sh b/ironic_python_agent/shell/write_image.sh index f79d2496..3f07e07a 100755 --- a/ironic_python_agent/shell/write_image.sh +++ b/ironic_python_agent/shell/write_image.sh @@ -35,8 +35,8 @@ DEVICE="$2" # 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 -log "Erasing existing mbr from ${DEVICE}" -dd if=/dev/zero of=$DEVICE bs=512 count=10 +log "Erasing existing GPT and MBR data structures from ${DEVICE}" +sgdisk -Z $DEVICE log "Imaging $IMAGEFILE to $DEVICE" qemu-img convert -t directsync -O host_device $IMAGEFILE $DEVICE |
