Score:3

Discrepancy between lsblk, df and Disks

dj flag

I don't understand the differences in size produced by the following commands:

$ lsblk
...
nvme0n1               259:0    0 238.5G  0 disk  
├─nvme0n1p1           259:1    0   512M  0 part  /boot/efi
├─nvme0n1p2           259:2    0   732M  0 part  /boot
└─nvme0n1p3           259:3    0 237.3G  0 part  
  └─nvme0n1p3_crypt   253:0    0 237.3G  0 crypt 
    └─ubuntu--vg-root 253:1    0 237.3G  0 lvm   /


$ df -h
/dev/mapper/ubuntu--vg-root  233G  203G   19G  92% /

Moreover, the Disks utility displays yet another number: Disks screenshot

Where do 237.3G, 233G and 255 GB from Disks come from and why do they differ?

I also tried:

$ sudo resize2fs /dev/mapper/ubuntu--vg-root 
resize2fs 1.45.5 (07-Jan-2020)
The filesystem is already 62194688 (4k) blocks long.  Nothing to do!
Artur Meinild avatar
vn flag
Does this answer your question? [lsblk and df -H don't match](https://askubuntu.com/questions/1039115/lsblk-and-df-h-dont-match)
David avatar
cn flag
From the Linux Manual page and you can do the same for the other commands to learn about them. https://man7.org/linux/man-pages/man8/lsblk.8.html
Score:5
vn flag

It seems Disks show result in Gigabytes, while the CLI utilities output in GibiBytes. A conversion utility is here. 255 GB = 237 GiB.

Also, df only shows usable space, while lsblk shows block devices. Therefore, it seems 4 GiB on the disk is reserved for root.

To see how many blocks are reserved, run this command:

sudo tune2fs -l /dev/mapper/ubuntu--vg-root | grep "lock count"

Then divide Reserved block count with Block count, and you get the percentage that is reserved, which can easily be converted to GiB of storage.

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.