Add app for dumping the MBR
[cmccabe-bin] / mbr_dump.sh
1 #!/bin/sh
2
3 #
4 # Dumps the bytes representing the four primary partitions in an IBM master
5 # boot record
6 #
7 # Colin McCabe
8 #
9
10 if [ -e ${1} ]; then
11         PART_FILE=${1}
12 else
13         echo "usage: ${0} <IBM-master-boot-record>"
14         echo "should be 512 bytes in length."
15         exit 1
16 fi
17 echo "# first partition"
18 od -j 446 -N 16 -t x1 ${1}
19 echo "# second partition"
20 od -j 462 -N 16 -t x1 ${1}
21 echo "# third partition"
22 od -j 478 -N 16 -t x1 ${1}
23 echo "# fourth partition"
24 od -j 494 -N 16 -t x1 ${1}