It also gives a localised example showing how space could be added using LVM and, with the '-f' option, analyses usage of /home in a tree format. When run with '-q' option it will be silent unless any filesystem's level of usage is over the specified percent_trigger, and so it can be used to issue a warning if running out of space.

Suggested use is as a cron job with e.g. -q 75 (percent_trigger is ignored without -q switch.) Note that if run with '-f' option it can take many minutes to complete.

All sizes are reported in binary quantities e.g. gibibytes i.e. powers of 1024 not 1000.

Oh, and it runs happily on systems that do not have or use LVM, too.

Usage

lvm-usage.sh [options] [percent_trigger]

Example

sudo ./lvm-usage.sh -q 85

Options

-b show size and location of physical partitions in bytes
-f full (show full tree usage of /home)
-h shows these instructions and exit
-i use ascii characters for tree
-l show changelog and exit
-q suppress output unless usage is over percent_trigger (default 0%)

My Other Sites

My Programs

Here is a selection of some (other) programs I have written, most of which run from the command line (CLI), are freely available and can be obtained by clicking on the links. Dependencies are shown and while in most cases written for a conventional Linux server, they should run even on a Raspberry Pi, and many can run under Windows using Cygwin. Email me if you have problems or questions, or if you think I could help with a programming requirement.

tiny-device-monitor - GNU/Linux program to test webpages (including password-protected) or machines to check they are live; use as a cron job for your own websites, for hardware presenting a webpage, or for any machines with a presence on your local LAN or on the internet. [ GNU/Linux: 2009-18
]

dutree - GNU/Linux program to show a tree-style list of files and directories at the specified location and greater than the specified size (default 1GB). [ GNU/Linux: 2012-15
]

disk-wiper - GNU/Linux script to wipe a disk drive comprehensively and also check it for bad blocks. For use on a surplus drive (not SSD, not GPT) before passing to a third party. [ GNU/Linux: 2011-16
]