1

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?

jasonwryan
  • 73,126
J. Doe
  • 11
  • parted's default unit of MB/GB always suffers rounding issues. Unless you have special requirements, you really want to use unit MiB or similar with parted. If you're not following the MiB-alignment mantra or want to double-check, go for unit s or even unit b. – frostschutz Jun 14 '18 at 21:21
  • If is MB or GB incorrect, why somebody uses it? Why everybody don't use Mib and Gib etc.? – J. Doe Jun 14 '18 at 21:43

0 Answers0