Web lists-archives.com

Re: df shows wrong disk size




On Sat, Jun 01, 2019 at 10:41:20AM -0700, Ross Boylan wrote:
> df says my volume is 3G, but everything else says it's 4G.  What's
> going on and how can I correct it?
> 
> This question concerns the total reported space, not the free space.
> 
> The volume is an LVM logical volume on buster with an ext4 file
> system.  I originally mistakenly created it as 4TB in size.
> Then I took it offline, resized the file system to 3G, resized the
> logical volume to 4G, and  then auto-resized (that is, ran resize2fs
> without specifying an explicit size) the file system to 4G.  When df
> showed the size as 3G I thought it might be temporary, but it it
> reports the same value after reboot.
> 
> (If you're wondering: I resized to 3G first out of concern that the
> file system requires a slightly larger "partition" than its own size,
> and I didn't want to risk cutting off the end of the file system.)
> 
> I thought there might have been a huge amount of reserved space or
> journal from the original 4TB size, but the values in dumpe2fs appear
> normal to me.
> 
> Running buster.
> 
> Thanks.
> Ross
> 
> # df -h /var/local/cache/
> Filesystem                  Size  Used Avail Use% Mounted on
> /dev/mapper/vgbarley-cache  3.0G  721M  2.1G  26% /var/local/cache
> root@barley:~/tempserver/root# lvs vgbarley
>   LV      VG       Attr       LSize   Pool Origin Data%  Meta%  Move
> Log Cpy%Sync Convert
>   cache   vgbarley -wi-ao----   4.00g
> ## etc
> # resize2fs /dev/vgbarley/cache
> resize2fs 1.44.5 (15-Dec-2018)
> The filesystem is already 1048576 (4k) blocks long.  Nothing to do!
> # So both LVM and e2fs utilities see 4G , even thouogh df reports 3G
> 
What is the output of 'df -B4096'?

Regards,

-Roberto

-- 
Roberto C. Sánchez