I am currently learning about creating and managing devices on my Ubuntu Server 22.04 VM running on a KVM host. I added a virtual qcow2
storage disk to the VM. I used fdisk
and for very specific purposes I need to create a 9.9GiB
partition . I setup a DOS style partition table and then tried to create a primary partition.
Following are the steps to reproduce
root@hmxserver:/home/hmx# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): o
Created a new DOS disklabel with disk identifier 0xb4942d4d.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-20971519, default 20971519): +9.9G
Value out of range.
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-20971519, default 20971519):
Created a new partition 1 of type 'Linux' and of size 10 GiB.
Questions That I want to ask?
- Why is a
10GiB
partition possible but 9.9GiB
is out of range ?
- I was able accomplish this on another VM with similar specs but on VirtualBox with a
10GiB
VMDK disk attached and repeated the same steps. Why was fdisk
successful there?
- Does it have to do with the qcow2 devices ?
- Or is it some sort of Floating Point Errors ?