Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free Hard Drive Space

Status
Not open for further replies.
May 25, 2012
5
US
Trying to figure out the command to see how much space is used on each hard drive and/or partition?
 
Why not use lspv?

# lspv hdisk0
PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvg
PV IDENTIFIER: 00132ebdadd7a20d VG IDENTIFIER 001328edc0023dc00221230109e2fad0cf
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 11
TOTAL PPs: 546 (69888 megabytes) VG DESCRIPTORS: 2
FREE PPs: 43 (5504 megabytes) HOT SPARE: no
USED PPs: 503 (64384 megabytes) MAX REQUEST: 256 kilobytes
FREE DISTRIBUTION: 00..00..00..00..43
USED DISTRIBUTION: 110..109..109..109..66
 
Doesn't handle varied off vg's on disks, but I'm sure you can tinker with it.

Code:
echo "Total MB | Free MB"
for hdisk in `lspv |awk '{print $1}'`
do
lspv $hdisk|awk '/TOTAL|FREE PPs/'|awk '{print $3}'|xargs
done

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top