From e915a0738a5e314ed9282674f8bbc07325388d5a Mon Sep 17 00:00:00 2001 From: Colin McCabe Date: Tue, 19 Jan 2010 15:15:47 -0800 Subject: [PATCH] Add app for dumping the MBR Add an app for dumping the MBR. I guess now that everyone is moving to GUID partition tables (GPTs) this may not be useful forever. Still, I might need it again. --- mbr_dump.sh | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100755 mbr_dump.sh diff --git a/mbr_dump.sh b/mbr_dump.sh new file mode 100755 index 0000000..dce7962 --- /dev/null +++ b/mbr_dump.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# +# Dumps the bytes representing the four primary partitions in an IBM master +# boot record +# +# Colin McCabe +# + +if [ -e ${1} ]; then + PART_FILE=${1} +else + echo "usage: ${0} " + echo "should be 512 bytes in length." + exit 1 +fi +echo "# first partition" +od -j 446 -N 16 -t x1 ${1} +echo "# second partition" +od -j 462 -N 16 -t x1 ${1} +echo "# third partition" +od -j 478 -N 16 -t x1 ${1} +echo "# fourth partition" +od -j 494 -N 16 -t x1 ${1} -- 1.6.6.rc1.39.g9a42