OpenWRT x86 Style Disks and Booting: Difference between revisions

mNo edit summary
mNo edit summary
Line 2: Line 2:


===For Cloning a Drive===
===For Cloning a Drive===
Copy the "MBR Gap" (GRUB Stage 1.5, containing the CORE.IMG file): <code>dd if=/dev/sdX of=/dev/sdY bs=512 skip=1 count=511</code>
Copy the MBR (GRUB Stage 1 and Partition Table): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=1</code>
Copy the MBR (GRUB Stage 1 and Partition Table): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=1</code>
Copy the "MBR Gap" (GRUB Stage 1.5, containing the CORE.IMG file): <code>dd if=/dev/sdX of=/dev/sdY bs=512 skip=1 count=511</code>


Copy the First Partition (/boot Directory): <code>dd if=/dev/sdX1 of=/dev/sdY1 bs=128M  conv=noerror progress=status</code>
Copy the First Partition (/boot Directory): <code>dd if=/dev/sdX1 of=/dev/sdY1 bs=128M  conv=noerror progress=status</code>
Line 23: Line 23:
Other Notes
Other Notes


*Copying the MBR and MBR Gap can be combined into a single step (it was done to clarify and make an explicit point that there is important code stored in the MBR Gap necessary to boot OpenWRT with GRUB): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=512</code>
*Copying the MBR and MBR Gap can be combined into a single step (it was done to clarify and make an explicit point that there is important code stored in the MBR Gap necessary to boot OpenWRT with GRUB): <code>dd if=/dev/sdX of=/dev/sdY bs=512 count=512</code>.  And for some reason, doing the MBR Gap first, messes up the MBR.  Not a clue why.
*The "MBR Gap" for OpenWRT's x86 "flavor" is 511 Sectors (Sectors 2 - 511, 512 is the beginning of the first partition, AKA /boot Partition).  That's just how it is for OpenWRT because it is what they decided.  And just as a historical note, the "MBR Gap" is almost twice as big as the entire capacity of a Commodore 1541 disk (single sided is 170K).
*The "MBR Gap" for OpenWRT's x86 "flavor" is 511 Sectors (Sectors 2 - 511, 512 is the beginning of the first partition, AKA /boot Partition).  That's just how it is for OpenWRT because it is what they decided.  And just as a historical note, the "MBR Gap" is almost twice as big as the entire capacity of a Commodore 1541 disk (single sided is 170K).  And don't think OpenWRT is being wasteful of space either.  If one uses CFDISK (or equivalent), the MBR GAP is 2048 Sectors (4 times that of OpenWRT, still 512 Bytes per Sector).
*If conv=sync is used an out of space error will occur.
*If conv=sync is used an out of space error will occur.