Print unused bytes of logical volume

by guettli   Last Updated August 13, 2019 20:00 PM - source

Imagine the physical volume was resize with:

pvresize /dev/sda2 

And the logical volumne was resized with:

lvresize -l +100%FREE system/home

But this command was not done:

resize2fs /dev/mapper/system-home

Since the last command was forgotten, there is unused space.

How to calculate the unused bytes?

Background: I want to write a check-script which checks if on a server the resize of the filesystem was forgotten.

Related Questions

df is reporting wrong information in an LVM

Updated June 18, 2015 22:00 PM

mdadm/ext4 chunk size on raid 1

Updated February 17, 2018 23:00 PM