[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: How many drives?



> 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

<<winmail.dat>>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]