1

Recently I've start to implement some script to run using Linux "parted" to change the partition structure on our SoC system. When doing that I've encounter with some problems, The partitions on our device where not aligned.

The primary and extended partitions are aligned, but the logical partitions not.

The person that made the script for creating the image added offset of 63 sectors for each logical partition in the start sector arguments. I've try to figure why and I've read that each logical partition has "MBR" (EBR is the right name I think) at the beginning that store his value and points to the next partition and all of this structure is basically a linked list of partitions. So I'm guessing that the 63 sectors offset is to leave space for the EBR (We do the same thing in the first partition, its starts with 2048 sectors offset to leave space for the MBR).

first question - The offset for each logical partition is necessary? If not great. no need to read the second question. Q2: This 63 sectors offset cause the misalignment in the logical partitions. My first thought was to change this offset to 2048 sectors, but it will create "holes" and I'm not sure if is the right thing to do?

  • The first problem that I've mentioned seem to be related to the topic you mentioned. I've already solved this issue. Now I'm asking about another issue, the offset we gave for the logical partitions cause misalignment. I will edit my question and remove the first paragraph to prevent confusion – Ofir Oct 13 '20 at 15:26
  • Modern drives frequently use bigger physical I/O units than 512 bytes, e.g. 4k, but still present a 512 byte sector for compatibility. Having the partitions aligned to 4k bytes reduces the amount of read-modify-write operations the disk needs to do when doing large writes. Aligning to 2048 sectors doesn't appear to offer any advantage over aligning to 8 sectors currently. – icarus Oct 13 '20 at 15:55
  • I don't know if I can call the mmc chip on our SoC system modern. What I know is that parted complain about the current partitions, and after I aligned it to 2048 sectors it's stops complaining. And what if I ignore my system and I ask the same question as a General Question? – Ofir Oct 13 '20 at 18:30