You are not logged in.
Pages: 1
Hallo,
I am creating partitions with cgdisk, and there is something I don't quite understand: the size of the partitions sistematically turns out to be 1 sector less than I expect, no matter if I specify the size in sectors or in MiB/GiB/...
For example, if I try to create a 1MiB partition, its size (as reported when selecting "info") will be 2047 sectors, instead of 2048.
The same happens if I ask for a 2048-sector partition: it will be 2047 sectors as well.
In both cases the partiton size is coherently reported as 1023.5 KiB instead of 1024 KiB.
Why? What am I missing here?
Thank you!
Offline
I am prone to think that there must be something strange going on with cgdisk 0.8.8 because `fdisk -l` reports the expected size of the partitions.
Has anyone ever noticed that cgdisk gives the right size of the partition in the main screen, but when full info concerning some partition is asked (selecting "info" in the main menu), a different size is reported? (the size appears here to be 1 sector less than the actual size).
Weird.
Offline
I would understand that the partition would start let's say at sector X and end at sector Y-1 i.e. 0 to 2047 is 2048 sectors. Are you reading the partitioon data correctly? I'm assuming you're working with a GPT disk label. What happens, if you specify the sectors manually?
This will create a new GPT label
# sgdisk -o /dev/sda
Then create partitions like this (this creates an EFI system partition):
# sgdisk -n 1:2048:1050623 -c 1:"EFI" -t 1:EF00 /dev/sda
You can also use the interactive gdisk instead.
Offline
I double checked every detail and I have of course been very careful in counting the sectors. (And you do not even have to do the math, because cgdisk tell you directely the size, along with the starting and ending sectors). I have even tried to create a one-sector partition, and this turns out to be 1 sector less too, i.e. 0-sector long! . Even when I specify the sectors manually, in the "info" screen it is always reported as one sector less than it should be (the partition starts at the right sector, but it ends one sector earlier than specified, and the size is accordingly one sector short). Anyway, this is reported only in the "info" tab of cgdisk. Other tools, like fdisk, report data matching the parameters given when creating the partition.
However, I realized that any other tool, including the main screen of cgdisk, gives me the correct size. It is only in the info tab of cgdisk that they are 512 KiB smaller.
I have also tried to check the size of a 100 GiB partition (on a GPT disk) on a completely different (Debian) machine, and fdisk tells me that the size of the partition is 209715200-sectors, while cgdisk 0.8.7 tells me 209715199 sectors! I cautiously use the word "bug" but at this point I really believe that it is a cgdisk problem.
Thank you.
Offline
Pages: 1