Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Dec 2012 17:34:04 -0600
From:      Tim Daneliuk <tundra@tundraware.com>
To:        "Ronald F. Guilmette" <rfg@tristatelogic.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: List all hard drives on system (with capacities)... How?
Message-ID:  <50C12B6C.5020109@tundraware.com>
In-Reply-To: <9304.1354836633@tristatelogic.com>
References:  <9304.1354836633@tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/06/2012 05:30 PM, Ronald F. Guilmette wrote:
>
> I'd like to write a small program or shell script that simply lists all
> of the physical hard drives attached to the local system, along with their
> product identifiers and their respective capacities.
>
> The following simple script works well for both PATA/SATA and USB hard drives,
> but it does not list drive capacities:
>
> #!/bin/sh
>
> atacontrol list | grep ':  ad[0-9]' | sed 's/^.*:  //'
> camcontrol devlist | grep '(da[0-9]' | sed -E 's/^(.*) \((da[0-9]+).*$/\2 \1/'
>
>
> How can I modify the script above in order to get it to print out the
> respective drive capacities?

Look into fdisk -s


-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra@tundraware.com
PGP Key:         http://www.tundraware.com/PGP/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50C12B6C.5020109>