Unix Technical Forum

Re: How many HD ?

This is a discussion on Re: How many HD ? within the AIX Operating System forums, part of the Unix Operating Systems category; --> In article <bhssgh$g9t6@news-1.bank.dresdner.net>, Hans-Joachim Ehlers <service@metamodul.com> wrote: > > # Total hdisk space > lscfg -l hdisk\* | awk ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2008, 07:53 PM
Dan Foster
 
Posts: n/a
Default Re: How many HD ?

In article <bhssgh$g9t6@news-1.bank.dresdner.net>, Hans-Joachim Ehlers <service@metamodul.com> wrote:
>
> # Total hdisk space
> lscfg -l hdisk\* | awk '{ print $1 }' | xargs -I{} lsattr -El {} -a
> size_in_mb | awk '{ SIZE=SIZE+$2 } END { print SIZE/1024" GB" } '


Only one problem... lscfg -l hdisk\* | awk '{print $1}' returned:

# lscfg -l hdisk\*|awk '{print $1}'
DEVICE

hdisk0
MB)
hdisk1
MB)
hdisk2
MB)
hdisk3
MB)
hdisk4

Why? Because the lscfg -l output was:

# lscfg -l hdisk\*
DEVICE LOCATION DESCRIPTION

hdisk0 10-88-00-8,0 16 Bit LVD SCSI Disk Drive (36400
MB)
hdisk1 10-88-00-9,0 16 Bit LVD SCSI Disk Drive (36400
MB)
hdisk2 10-88-00-10,0 16 Bit LVD SCSI Disk Drive (36400
MB)
hdisk3 10-88-00-11,0 16 Bit LVD SCSI Disk Drive (36400
MB)
hdisk4 10-70-L SSA Logical Disk Drive

So to work around that better, I changed it to:

# lscfg -l hdisk\*|awk '{print $1}'|grep hdisk|xargs -I{} lsattr -El {} \
-a size_in_mb | awk '{ SIZE=SIZE+$2 } END { print SIZE/1024 " GB" }'
355.737 GB

-Dan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 07:53 PM
Hans-Joachim Ehlers
 
Posts: n/a
Default Re: How many HD ?

"Dan Foster" <dsf@globalcrossing.net> schrieb im Newsbeitrag
news:slrnbk41b3.1a7.dsf@gaia.roc2.gblx.net...
> In article <bhssgh$g9t6@news-1.bank.dresdner.net>, Hans-Joachim Ehlers

<service@metamodul.com> wrote:
> >
> > # Total hdisk space
> > lscfg -l hdisk\* | awk '{ print $1 }' | xargs -I{} lsattr -El {} -a
> > size_in_mb | awk '{ SIZE=SIZE+$2 } END { print SIZE/1024" GB" } '

>
> Only one problem... lscfg -l hdisk\* | awk '{print $1}' returned:
>
> # lscfg -l hdisk\*|awk '{print $1}'
> DEVICE
>
> hdisk0
> MB)
> hdisk1
> MB)
> hdisk2
> MB)
> hdisk3
> MB)
> hdisk4
>
> Why? Because the lscfg -l output was:
>
> # lscfg -l hdisk\*
> DEVICE LOCATION DESCRIPTION
>
> hdisk0 10-88-00-8,0 16 Bit LVD SCSI Disk Drive (36400
> MB)


Hm, my cmd line was only tested on AIX 5.2
Looks like IBM fixed the strange lscfg output from the previous versions.

cy
Hajo




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-04-2008, 07:53 PM
Dwivian
 
Posts: n/a
Default Re: How many HD ?

Dan Foster <dsf@globalcrossing.net> wrote in message news:<slrnbk41b3.1a7.dsf@gaia.roc2.gblx.net>...
> So to work around that better, I changed it to:
> # lscfg -l hdisk\*|awk '{print $1}'|grep hdisk|xargs -I{} lsattr -El {} \
> -a size_in_mb | awk '{ SIZE=SIZE+$2 } END { print SIZE/1024 " GB" }'
> 355.737 GB


Eww! Ew!

Okay...I suggest moving from lscfg to lspv. There.

-dwiv (CATE/AIX)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:06 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com