#StackBounty: #sgdisk sgdisk: Force alignment of end sector

Bounty: 50

I am trying to get sgdisk to create partitions that align on 1 MB.

This is easy for the starting sector (using -a), and for the ending sector, if I choose the size.

But if I let sgdisk choose the ending sector I end up with something like:

Device                                                         Start       End   Sectors   Size Type
/dev/disk/by-id/scsi-36848f690d917dc002587bfae06302a5a-part2    2048   1046527   1044480   510M EFI System
/dev/disk/by-id/scsi-36848f690d917dc002587bfae06302a5a-part3 1048576   5242879   4194304     2G Solaris /usr & Apple Z
/dev/disk/by-id/scsi-36848f690d917dc002587bfae06302a5a-part4 5242880 467660800 462417921 220.5G Linux filesystem

And 462417921 is clearly not aligned to a 1 MB block.

It seems -a only applies to the starting sector.

How can I make it align the ending sector, too, for the rest-of-the-disk partition?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.