Display basic information about Physical Volumes

# Small script to display some interesting information about Physical Volumes


DISP="1"; ls -l /dev/hdisk* | awk '{print $10 " " $5 $6}' | sed -e "s:/dev/::" -e "s/,/ /"  | while read DISK MAJOR MINOR
do
   SIZE=$(bootinfo -s $DISK)
   LUN=$(lscfg -l $DISK | sed -e "s/^.*L//" -e "s/ .*$//" | cut -c-2)
   VG=$(lspv | awk -vSDISK=$DISK '$1 == SDISK {print $3}')
   [ "$DISP" == "1" ] && echo -e "DISK \t SIZE \t LUN \t MAJOR \t MINOR \t VG" && DISP="0"
   echo -e "$DISK \t $SIZE \t $LUN \t $MAJOR \t $MINOR \t $VG"
done


DISK     SIZE    LUN     MAJOR   MINOR   VG
hdisk0   76800   81      17      0       rootvg
hdisk1   13312   82      17      3       rootvg
hdisk2   20480   83      17      4       None
hdisk3   10240   84      17      2       None
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
30 Handy Bash Shell Aliases For Linux / Unix / MacOS
Viewed 6174 times since Thu, Feb 11, 2021
Convert CSV to JSON with jq
Viewed 28760 times since Mon, Jan 20, 2020
Bash: Read File Line By Line – While Read Line Loop
Viewed 3130 times since Mon, Feb 18, 2019
Convert CSV to JSON with bash script
Viewed 6109 times since Mon, Jan 20, 2020
To do a quick check on the number of path present (does not mean all are Enabled] using for loop
Viewed 5044 times since Fri, Jun 8, 2018
“Yes/No” in Bash Script – Prompt for Confirmation
Viewed 35918 times since Mon, Feb 18, 2019
10 Awk Tips, Tricks and Pitfalls
Viewed 6761 times since Wed, Aug 19, 2020
Convert JSON to CSV with bash script
Viewed 14303 times since Mon, Jan 20, 2020
bash for do done AIX
Viewed 2612 times since Mon, Jun 4, 2018
awk printf
Viewed 16992 times since Wed, Aug 19, 2020