From owner-freebsd-questions@FreeBSD.ORG Thu Dec 6 23:34:19 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B5017B6 for ; Thu, 6 Dec 2012 23:34:19 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from ozzie.tundraware.com (ozzie.tundraware.com [75.145.138.73]) by mx1.freebsd.org (Postfix) with ESMTP id 4431D8FC14 for ; Thu, 6 Dec 2012 23:34:18 +0000 (UTC) Received: from [192.168.0.2] (viper.tundraware.com [192.168.0.2]) (authenticated bits=0) by ozzie.tundraware.com (8.14.5/8.14.5) with ESMTP id qB6NY4eM014078 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 6 Dec 2012 17:34:04 -0600 (CST) (envelope-from tundra@tundraware.com) Message-ID: <50C12B6C.5020109@tundraware.com> Date: Thu, 06 Dec 2012 17:34:04 -0600 From: Tim Daneliuk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "Ronald F. Guilmette" Subject: Re: List all hard drives on system (with capacities)... How? References: <9304.1354836633@tristatelogic.com> In-Reply-To: <9304.1354836633@tristatelogic.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (ozzie.tundraware.com [192.168.0.1]); Thu, 06 Dec 2012 17:34:04 -0600 (CST) X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner-ID: qB6NY4eM014078 X-TundraWare-MailScanner: Found to be clean X-TundraWare-MailScanner-From: tundra@tundraware.com X-Spam-Status: No Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 23:34:19 -0000 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/