Score:1

Disk Size is not Consistent Between fdisk and parted

tm flag

I have noticed some difference in size displayed using parted and fdisk. I have a disk attached with a size of 20GB. Executing the fdisk command shows that the size is 20GB which is correct.

fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x22c4d209

On the other hand, using parted the disk size is 21.5GB

parted /dev/nvme0n1
GNU Parted 3.2
Using /dev/nvme0n1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: NVMe Device (nvme)
Disk /dev/nvme0n1: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Why does parted show a larger disk size?

Score:4
sr flag

fsdisk shows 20 GiB, which means 20 gibibyte. this equals to 20 * 2^30 = 21474836480 bytes

This is rounded by parted to 21.5 gigabyte (GB).

Grabinuo avatar
tm flag
Yikes. I have missed this.
ae flag
Good to know! I always assume that it's GiB everywhere regardless of the actual notation used.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.