1

It seems the boot partition can start at 2048 based on reading, although I haven't validated it (yet) and wonder if its related regarding compatibility?

Taken from the export-image/prerun.sh

fdisk -H 255 -S 63 ${IMG_FILE} <<EOF
o
n


8192
+$((BOOT_SIZE * 2 /512))
p
t
c
n


8192


p
w
EOF
3

It's all about the erase block boundaries of the flash media. Filesystems should be aligned to those boundaries so changes will only ever need to erase one block for a change instead of two adjacent blocks.

The standard erase block size for GB sized flash media used to be 1MByte, which is 2048 sectors of 512 byte.

But better safe than sorry, there a some cheap SD cards in the market with a 4MB erase block size, that's 8192 sectors of 512 byte.

  • Worth mentioning that the reason it doesn't start at 0 (which would be aligned) is that there's a 1 sector master boot record at the start of the first logical block. – goldilocks Feb 1 '18 at 14:27
  • 2
    The Raspberry GPU firmware just reads the MSDOS partition table in sector 0 to find out about the location of the boot filesystem. So technically, it's not an MBR. That would had an x86 binary inside and would not run on an ARM CPU. – Janka Feb 1 '18 at 14:42
  • Well, it may or may not have the bootstrap code in it (you can create a card using fdisk, and it will work). It is probably more fuss to create images without it. But point taken, that part of the MBR is not used if it exists. – goldilocks Feb 1 '18 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.