SHOWDISKS.PL - Summary of disks
showdisks.pl - Generate summary of disks on a Linux machine
showdisks.pl showdisks.pl -o /tmp/mysumary.txt showdisks.pl -html -o /tmp/mysumary.html showdisks.pl -id DATA -byslot -html -o /tmp/mysumary.html
Use this program to generate a summary of the disks for a host running Linux. This is particularly of interest when your machine has a large number of drives.
The summary of each drive includes its state (mounted or part of another filesystem like LVM, MD or ZFS), size, serial number etc. If partitions are defined for the drive, a list of these is provided.
The intent of this program is not to replace your others tools to manage partitions, but rather the point here is to provide a means to keep track of a large set of drives and exactly what use is being made of them.
This can be especially helpful if you provide a mapping file of drive serial numbers and slots. Unfortunately, RedHat systems do not have the necessary data available to get serial numbers of the drives. At this time only Debian based systems (including Ubuntu and friends) provide access to the serial number information. While this program will provide some useful information, it really only works on Debian systems.
The motivation for this program came when I first encountered a Sun x4500 which had 48 drives. In particular I wanted to keep track of what drives were being used and where the drive was (i.e. what slot). This turned out to be a particularly clumsy thing to discover. My solution is to provide a map of drive serial numbers and slot numbers, which must be determined manually. Linux has a means to determine the serial number of the drive with software, but there is no reliable way I could determine the slot - hence a manually created map is necessary.
Details about this program are available from http://www.hps.com/~tpg/toolbox/showdisks.php and a sample of the HTML output generated by it can be seen at http://www.hps.com/~tpg/toolbox/x4500.disksummary.html
Note: If you use ZFS, you may need to set the path to zpool in %opts at the top of the program. This script uses sudo to issue certain commands as root.
If no fatal errors are detected, the program exits with a return code of 0. Any error will set a non-zero return code.
Written by Terry Gliedt I<E<lt>firstname.lastname@example.orgE<gt>> in 2008. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; See http://www.gnu.org/copyleft/gpl.html