File mbr.bin created (as root): #dd if=/dev/hda of=mbr.bin bs=512 count=1 Table A: Last 66 bytes of mbr.bin raw output of 'od -A n -t x1 mbr.bin' .. .. .. .. .. .. .. .. .. .. .. .. .. .. 00 01 01 00 82 fe 3f 7f 3f 00 00 00 41 60 1f 00 80 00 01 80 83 fe ff ff 80 60 1f 00 b4 e4 65 01 00 fe ff ff 83 fe ff ff 34 45 85 01 cc 0d 23 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa ------------------------------------------ ------------------------------------------ Table B: Table A data, rearranged to line up partition table entries in even rows: ------------------------------------------ 00 01 01 00 82 fe 3f 7f 3f 00 00 00 41 60 1f 00 80 00 01 80 83 fe ff ff 80 60 1f 00 b4 e4 65 01 00 fe ff ff 83 fe ff ff 34 45 85 01 cc 0d 23 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa ------------------------------------------ ------------------------------------------ Table C: Last 66 byte of mbr.bin, "copy as test" + paste from hex-edit and rearranged (Confirm same as Table B) ------------------------------------------ 00 01 01 00 82 fe 3f 7f 3f 00 00 00 41 60 1f 00 80 00 01 80 83 fe ff ff 80 60 1f 00 b4 e4 65 01 00 fe ff ff 83 fe ff ff 34 45 85 01 cc 0d 23 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa ------------------------------------------ ------------------------------------------ Table D: =Table C: dissected ------------------------------------------ descriptor of partition 1 00 010100 82 fe3f7f 3f000000 41601f00 descriptor of partition 2 80 000180 83 feffff 80601f00 b4e46501 descriptor of partition 3 00 feffff 83 feffff 34458501 cc0d2303 descriptor of partition 4 (no partition 4 defined) 00 000000 00 000000 00000000 00000000 MBR boot signature 55aa ------------------------------------------ ------------------------------------------ Table D1: Breakdown of descriptor of partition 1 00 010100 82 fe3f7f 3f000000 41601f00 | | | | | | | | | | | Partition size, 4 bytes, sectors, little-endian | | | | | 001f6041h=2056257 sectors /2048 sec/MB= 1004MB | | | | | | | | | Start sector, absolute LBA, 4 bytes, little-endian | | | | 0000003fh=sector 63 (first sector of devices is sector 0) | | | | | | | Last sector CHS value (actually HSC value with 2 bit transpose) | | | head fe=head 254 | | | 3f, 7f=(00)111111, 01111111 ->111111, (00)01111111=55, 127 | | | Last sector CHS=127,254,55 | | | | | Partition type (82h=linux swap/solaris) | | | First sector CHS value (actually HSC value with 2 bit transpose) | head 01h=head 01 | 01, 00 sector01 cylinder 00 | First sector CSH=0,1,1 | Active (bootable) flag not set (80h=bootable) ------------------------------------------ Table D2: Breakdown of descriptor of partition 2 80 000180 83 feffff 80601f00 b4e46501 | | | | | | | | | | | Partition size, 4 bytes, sectors, little-endian | | | | | 0165e4b4h=23,454,900 sectors /2048 sec/MB= 11,452 MB | | | | | | | | | Start sector, absolute LBA, 4 bytes, little-endian | | | | 001f6080h=sector 2,056,320 (first sector of devices is sector 0) | | | | | | | Last sector CHS value (actually HSC value with 2 bit transpose) | | | head feh= 254 | | | ff, ff=(11)111111, 11111111 ->111111, (11)11111111= 63, 1023 | | | Last sector CHS=1023,254,63 | | | | | Partition type (83h=linux) | | | First sector CHS value (actually HSC value with 2 bit transpose) | head 00h=head 00 | sector, cylinder 01h, 80h= 01, 128 | First sector CHS=128,0,1 | Active (bootable) flag set (80h=bootable) ------------------------------------------ Table D3: Breakdown of descriptor of partition 3 00 feffff 83 feffff 34458501 cc0d2303 | | | | | | | | | | | Partition size, 4 bytes, sectors, little-endian | | | | | 03230dcch= 52628940 sectors /2048 sec/MB= 25,698 MB | | | | | | | | | Start sector, absolute LBA, 4 bytes, little-endian | | | | 01854534h=sector 25,511,220 (first sector of devices is sector 0) | | | | | | | Last sector CHS value (actually HSC value with 2 bit transpose) | | | head fe=head 254 | | | ff, ff=(11)111111, 11111111 ->111111, (11)11111111= 63, 1023 | | | Last sector CHS=1023,254,63 | | | | | Partition type (83h=linux) | | | First sector CHS value (actually HSC value with 2 bit transpose) | head fe=head 254 | ff, ff=(11)111111, 11111111 ->111111, (11)11111111= 63, 1023 | First sector CHS=1023,254,63 | Active (bootable) flag not set (80h=bootable) ------------------------------------------ Table D4: Breakdown of descriptor of partition 4 (No partition 4 defined.) 00 000000 00 000000 000000000 00000000 | | | | | | | | | | | Partition size, 4 bytes, sectors, little-endian | | | | | | | | | Start sector, absolute LBA, 4 bytes, little-endian | | | | | | | Last sector CHS value (actually HSC value with 2 bit transpose) | | | | | Partition type 00h=no partition defined all other fields should also be 0 | | | First sector CHS value (actually HSC value with 2 bit transpose) | Active (bootable) flag not set (80h=bootable) ------------------------------------------ Table D5: MBR boot signature 55aa | MBR boot signature (Master Boot Record not proper with out it). ------------------------------------------ ------------------------------------------ Test consistency with output of fdisk: # fdisk -lu /dev/hda Disk /dev/hda: 40.0 GB, 40007761920 bytes 255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/hda1 63 2056319 1028128+ 82 Linux swap / Solaris /dev/hda2 * 2056320 25511219 11727450 83 Linux /dev/hda3 25511220 78140159 26314470 83 Linux Looks good! ------------------------------------------ References: http://www-128.ibm.com/developerworks/linux/library/l-linuxboot/ http://mirror.href.com/thestarman/asm/mbr/PartTables.htm http://mirror.href.com/thestarman/asm/mbr/PartTypes.htm http://www.win.tue.nl/%7Eaeb/partitions/partition_types-1.html http://www.rdrop.com/%7Ecary/html/endian_faq.html