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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| "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 |
| ||||
| 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) |