free disk space for lvm volumes using df ?

Ingo Jochim i.jochim at querysoft.de
Fri Feb 3 14:28:02 UTC 2006


Hi all,

via script I like to know how much free disk space is on each partition 
in my system.
This works well with normal partitions.

df /partition | grep ^/ | tr -s [:blank:] " "  | cut -d " " -f4

But on LVM volumes the output of "df" is totally different.
The name of a volume and the size are in different lines.
I have a mixture of normal partitions and LVM. That makes it more difficult.

/dev/mapper/VolGroup00-root.fs
                       4983392   1395340   3330824  30% /
/dev/hda1               101086     10052     85815  11% /boot
/dev/shm                257280         0    257280   0% /dev/shm
/dev/mapper/VolGroup00-home.fs
                      16854376     77892  15906496   1% /home



Has anybody an idea for that ?




More information about the fedora-list mailing list