4Mib Aligned Disk Geometry on SDcard?
by slac-in-the-box from LinuxQuestions.org on (#5MRST)
Scripting the formatting of disks lead me to read the info page on parted, and it says this: Quote:
So that was 10 years ago. Is this still relevant for low end flash devices of 2021? It seems like many arm and arm64 devices have capability to boot from low end flash devices.
But when I look at partition tables (like this one) on various images that I can burn to microSD to boot pinebook pro off of, none have this "placeholder partition". sndwvs slarm64 image has a single partition, type 8300, that starts at 32768, is gpt, and says "partitions will be aligned on 2048-sector boundaries"... Does just starting at 64 or 32768 already have this 4MiB alignment. (dos it just have to be divisible by 4?)
Now, we will show how to partition a low-end flash device ("low-end", as of 2011/2012). For such devices, you should use 4MiB-aligned partitions(1). This command creates a tiny place-holder partition at the beginning, and then uses all remaining space to create the partition you'll actually use: $ parted -s /dev/sdX -- mklabel msdos \ mkpart primary fat32 64s 4MiB \ mkpart primary fat32 4MiB -1s Note the use of '--', to prevent the following '-1s' last-sector indicator from being interpreted as an invalid command-line option. The above creates two empty partitions. The first is unaligned and tiny, with length less than 4MiB. The second partition starts precisely at the 4MiB mark and extends to the end of the device. |
But when I look at partition tables (like this one) on various images that I can burn to microSD to boot pinebook pro off of, none have this "placeholder partition". sndwvs slarm64 image has a single partition, type 8300, that starts at 32768, is gpt, and says "partitions will be aligned on 2048-sector boundaries"... Does just starting at 64 or 32768 already have this 4MiB alignment. (dos it just have to be divisible by 4?)