Software >> OS >> Unix >> Linux >> How to view the master boot record MBR of a disk

e.g. MBR for disk /dev/sda

# dd if=/dev/sda od=/tmp/mbr.bin bs=512 count=1

view the contents by

# file /tmp/mbr.bin | sed 's/; /;\n/g'

sample output :-

/tmp/mbr.bin: x86 boot sector;
GRand Unified Bootloader, stage1 version 0x3, boot drive 0x80, 1st sector stage2 0x10732c0, GRUB version 0.94;
partition 1: ID=0x83, active, starthead 32, startsector 2048, 75495424 sectors;
partition 2: ID=0x82, starthead 254, startsector 75497472, 8388608 sectors, code offset 0x48