OsGate.org Logo

Previous Previous | Next Next

Read the MBR - mbr grub lilo boot sector

System System

Date 28.02.2012

Visits 3528



To read the MBR of your hard disk first copy it to a file:

dd if=/dev/sda of=disk.out bs=512 count=1

The "count" option tell to dd to only copy a sector of 512 bytes (bs=512)

Now with the file command you can see some information about your MBR:

bash-4.1# file disk.out
disk.out: x86 boot sector, LInux i386 boot LOader; partition 1: ID=0x82, starthead 254, startsector 64002960, 4000185 sectors; partition 2: ID=0x83, active, starthead 1, startsector 63, 64002897 sectors; partition 3: ID=0x83, starthead 254, startsector 68003145, 60002775 sectors; partition 4: ID=0x83, starthead 254, startsector 128005920, 184570785 sectors, code offset 0xeb