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 a size of 462417921 is clearly not aligned to a 1 MB block.
I would have expected something like:
/dev/disk/by-id/scsi-36848f690d917dc002587bfae06302a5a-part4 5242880 466616319 461373440 220G Linux filesystem
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?
The partition table is made with:
sgdisk --zap-all $DISK
sgdisk -n2:1M:+510M -t2:EF00 $DISK
sgdisk -a 1048576 -n3:0:+2G -t3:BF01 $DISK
# Use the rest of the disk for the final partition
# and it is here the end sector is not aligned
sgdisk -a 1048576 -n4:0:-0 -t4:BF01 $DISK
Asked by Ole Tange
(37348 rep)
May 25, 2020, 10:45 PM
Last activity: Jan 11, 2025, 01:11 AM
Last activity: Jan 11, 2025, 01:11 AM