From: Colin McCabe Date: Tue, 19 Jan 2010 23:15:47 +0000 (-0800) Subject: Add app for dumping the MBR X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e915a0738a5e314ed9282674f8bbc07325388d5a;p=cmccabe-bin 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. --- 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}