Software parted
takes automatically size of sector (512B for GPT).
I enter exact size to MB, but I can't create swap partition with exact size.
mkpart swap linux-swap 15.5GB 17013
print
Number Start End Size File system Name Flags
1 1049kB 10.0GB 10.0GB ext4
2 10.0GB 15.0GB 5000MB ext4
3 15.0GB 15.5GB 512MB ext4
4 15.5GB 17.0GB 1499MB linux-swap(v1)
When I enter another size: mkpart swap linux-swap 15.5GB 17014 print
Number Start End Size File system Name Flags
1 1049kB 10.0GB 10.0GB ext4
2 10.0GB 15.0GB 5000MB ext4
3 15.0GB 15.5GB 512MB ext4
4 15.5GB 17.0GB 1501MB linux-swap(v1)
Why increase the size by 2B when adding only one?
unit MiB
or similar with parted. If you're not following the MiB-alignment mantra or want to double-check, go forunit s
or evenunit b
. – frostschutz Jun 14 '18 at 21:21