difference between gparted align to MiB and Cylinder in micro SD Card

8,781

You don't say what OS or boot loader you're using, but many boot loaders rely on direct sector references. That is, the boot code in the MBR is a rudimentary stub that tells the computer, essentially, "execute sector X to continue," where X is a hard-coded sector value, like 63 or 2048 or 27934920. LILO does this, for instance. Microsoft's MBR boot loader does not do this, but its second-stage boot loader (located in the partition's boot record) does, so the effect can be the same.

In the past, cylinder alignment was common, and even today, a lot of disks were created with tools that aligned to cylinders by default. Such disks typically start the first partition on sector 63, and subsequent partitions on weird values that are multiples of whatever size the (fictitious) cylinder is. Suppose your original disk was created with old tools, or even with new tools set to use this old cylinder alignment system. Further suppose that you resize a partition on that disk with GParted. If it's set for the new 2048-sector alignment, the result will be that the start of any resized partition will be moved, which will render the value in the boot loader incorrect. If you'd done it with cylinder alignment set, the partition's start point will probably be unaffected. Furthermore, partition resizing operations sometimes end up moving the contents of files, so even if the partition's start point isn't changed, if there are sector-based references to files, they may be invalidated. (This more often happens when shrinking a partition than when growing one, though.)

In sum, resizing a boot partition runs a risk of rendering it unbootable, at least on BIOS-based computers. (EFI-based systems are safer because their boot loaders never, to the best of my knowledge, rely on sector-value references. They could be thrown off by other things, though, like partition numbers changing.)

Share:
8,781

Related videos on Youtube

kelmat
Author by

kelmat

Updated on September 18, 2022

Comments

  • kelmat
    kelmat over 1 year

    I just dd'd a 2gb micro sd onto a 16 gb and gparted the partition.

    First time I resized the partition using gparted to the max. Align to was MiB.

    The system did not boot.

    Then I dd'd the same again, this time resized to the max using "Align to Cylinder".

    Then the system booted. Why didnt it boot the first time?

    System is a cubieboard, similar to Raspberry Pi.