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
Utilities to Tidy Up Your Reports
Viewed 17237 times since Wed, May 30, 2018
View Config Files Without Comments
Viewed 3093 times since Mon, May 21, 2018
HowTo: Clear BASH History
Viewed 3030 times since Mon, Feb 18, 2019
8 Practical Examples of Linux Xargs Command for Beginners
Viewed 6887 times since Fri, Jun 1, 2018
Bash: Read File Line By Line – While Read Line Loop
Viewed 3389 times since Mon, Feb 18, 2019
Tunneling With SSH to Your Destination
Viewed 5855 times since Wed, May 30, 2018
Unix - Find command examples
Viewed 5347 times since Fri, Jun 8, 2018
30 Handy Bash Shell Aliases For Linux / Unix / MacOS
Viewed 6541 times since Thu, Feb 11, 2021
Dealing with Funny Files
Viewed 3689 times since Wed, May 30, 2018
Time conversion using Bash
Viewed 3740 times since Fri, May 25, 2018