### Baremetal MBR ### # Refs http://cepcasa.info/tellmewhy/descripteurs.html # MBR visu dd bs=512 count=1 if=/dev/sda | od -Ax -tx1z -v # Partition table visu # (16 bytes / partition) * (4 primary partitions) = 64 bytes dd bs=1 count=64 skip=446 if=/dev/sda | od -Ax -tx1z -v # dd if=/dev/sda bs=1 count=64 skip=446 2>/dev/null | hexdump | grep -v ^0000040 | cut -d" " -f2- | sed 's/ //g' >> output 000000 80 01 01 00 07 fe ff ff 3f 00 00 00 37 16 71 02 >........?...7.q.< 000010 00 fe ff ff 83 fe ff ff 76 16 71 02 4c 6e 42 03 >........v.q.LnB.< 000020 00 fe ff ff 83 fe ff ff c2 84 b3 05 3f 14 a8 04 >............?...< 000030 00 fe ff ff 05 fe ff ff 01 99 5b 0a c0 f1 45 08 >..........[...E.< >> explanation Byte 1: boot flag. 0x80 = true, 0x00 = false Bytes 2, 3, 4: formerly CHS start (cylinder, head, sector), unused on modern disks Byte 5: partition type (83=linux, 82=linux/solaris swap, 0x07=NTFS, 0x0b=FAT32, 0x05=extended) Bytes 6, 7, 8: formerly CHS end (cylinder, head, sector), unused on modern disks Bytes 9, 10, 11, 12: start number in sectors Bytes 13, 14, 15, 16: size in sectors (reverse the bytes to convert in decimal!) # EBR can be read at the beginning of an extended partition... # Example to convert from binary to hexa printf "0x%llx\n" 10110010