5

I have used fdisk to move Ubuntu Mate partitions from a 1M boundary to start on a 4M boundary on a SD card.

The "boot" partition now starts at block 8192.

This is how the Raspbian distributions are configured, which makes perfect sense for the partitions to align with an Erase Block Group.

This is working OK, but gparted shows a 4M unused block before the "boot" partition which it does not show for Raspbian.

My question is how does the system "know" the 1st 4M is reserved for boot on one disk, but think only 1M is reserved on my modified disk.

EDIT

I just purchased a brand new 8GiB SDHC memory card which has a FAT32Lba partition starting at block 8192. I dumped the 1st 4MiB which contains 00 except for the 16bytes containing the partition table, so there does not seem to be anything special here.

0

I recommend you to:

  1. Align DOS-partitions to start at sector 64.
  2. If only one partition and no bootsector are needed, avoid the use of partition tables.

No more than 62 sectors are needed for boot loaders of DOS-partition tables. From my point of view, there are no strong reasons to align a partition to 4M, only to 4K.

My question is how does the system "know" the 1st 4M is reserved for boot on one disk, but think only 1M is reserved on my modified disk.

Technically the 4M are not reserved for boot. They are not used. (except the first 32256 bytes).

I just purchased a brand new 8GiB SDHC memory card which has a FAT32Lba partition starting at block 8192. I dumped the 1st 4MiB which contains 00 except for the 16bytes containing the partition table, so there does not seem to be anything special here.

A Master Boot Record require 512 bytes and only 16 bytes are useful to define the partition table.

Additionally to that 512 bytes, 62 sectors may be used by the bootloader, so no more than 32256 bytes (63 sectors) are required for a DOS bootloader with MBR and the rest is technically unused.

  • 1
    This does not answer the question. In addition your "recommendation" ignores the organisation of a SD card which erases 4M blocks, so partitions should be aligned on a 4M boundary for efficiency. – Milliways Feb 7 '16 at 1:37
  • I want to question the organistaion of that SD card and read their studies about how 4M boundaries help for efficiency. I've been thinking about this subject and seems that someone said 4M boundaries will help to increase the performance but it seems to be false. My answer is: the 4M are not reserved, they are unused and 4M alignment would only help if the filesystem has blocks of 4M. Usually ext2+ filesystems have 4K block sizes and 4K alignment is recommended. – ncomputers Feb 7 '16 at 1:42

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.