How many drives?

Miner, Jonathan W (CSC) (US SSA) jonathan.w.miner at baesystems.com
Thu Sep 27 15:15:01 UTC 2007


> Quick, and dirty...
>
> fdisk -l | grep '^Disk ' | wc -l
>
> This will fail to report correctly on systems with embedded hardware RAID
> controllers, also mis-counts on systems with software volume management.

This fixes the software volume management issue, only counts "hd" and "sd" devices:



fdisk -l | egrep '^Disk /dev/.*[hs]d' | wc -l
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2505 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070927/3b545c1b/attachment-0001.bin>


More information about the fedora-list mailing list