[arch-general] How to align partitions?

Paul Gideon Dann pdgiddie at gmail.com
Mon Sep 3 05:40:29 EDT 2012


On Friday 31 Aug 2012 01:45:40 Stayvoid wrote:
> > Recent versions of fdiks, parted, gdisk do it for you.
> 
> I use parted.
> AFAICT it can tell that partitions aren't aligned, but there is no
> option to do it automatically.
> 
> Could you help me to do the math? All these bytes give me a headache.
> 
> Thanks

This is what I do:

In parted, enter "unit b" to switch to bytes, because then you know what 
you're working with.

I like to start my first partition at 1048576, which is 1Mb into the disk, and 
end it at 104857599, which makes it 99Mb long.  After that, I use a single 
partition spanning the rest of the disk, starting at 104857600 (100Mb), and 
ending at a multiple of (1024*1024=1048576).  I use LMV or RAID+LVM on top of 
that.

Don't forget that the end point for each partition will be one byte before a 
Mb marker, so my first partition, ending at 104857599, is 1b before the 99Mb 
mark.  The size of the partition includes this end byte, so the partition is a 
full 99Mb's worth of bytes.

I hope this helps,
Paul


More information about the arch-general mailing list