We are making extensive use of the logical volume manager (LVM) on our Debian servers. But I find it hard to get a good overview on which partitions (LVM as well as native) I have mounted where, from which LV (logical volume) from which VG (volume group) and from which PV (physical volume). There are console tools like "lvdisplay -v" and "lvs" but those always just give me a partial view of everything. What I'd wish for is a textual representation something like:
Volume group "vgmain" ======================= consists of physical volumes: - /dev/sda1 (300 GB, 50 GB unused) - /dev/sdb1 (300 GB, 120 GB unused) - /dev/sdc1 (300 GB, nothing unused) provides logical volumes: - lvroot (EXT3 mounted on /, 4 GB, 0.5 GB free) - lvmysql (XFS mounted on /var/lib/mysql, 8 GB used, 2 GB free) Volume group "vghuge" ======================= consists of physical volumes: - /dev/sdc2 (800 GB, 250 GB unused) provides logical volumes: - lvhome (XFS mounted on /home, 300 GB, 90 GB free) - lvbackup (XFS mounted on /mnt/backup, 300 GB, 20 GB free)
Just as an idea how that might look. Is there such a tool? If nothing like that exists yet I think I'll have to script something myself which queries "df", "lvdisplay", "vgdisplay" and "pvdisplay" and creates such an overview.
Thanks in advance.
This didn't take long to write.
GNU Parted can give you most of the information you need with
It seems It only fails to effectively link lvm parttion to device mapper devices. I am sure they will welcome your patch. ;-)
Cheesy, but it shows everything (except where the filesystems are mounted). Save it as
/usr/sbin/lvms
Follow-up: Pgs (on this page) has provided a much nicer script.
No, I don't think such a script exists. Would be a pretty cool thing to script though. I might actually look into that myself, the next time I have my weekly day-of-scripting ;-)