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
Linux and Unix xargs command tutorial with examples
Viewed 3795 times since Fri, Jun 1, 2018
30 Examples for Awk Command in Text Processing
Viewed 14685 times since Sat, Nov 24, 2018
java Simple Java JDBC Program To Execute SQL Select Query
Viewed 3442 times since Sun, Jan 9, 2022
10 Xargs Command Examples in Linux / UNIX
Viewed 3803 times since Fri, Jun 1, 2018
Linux / UNIX: Convert Epoch Seconds To the Current Time
Viewed 2971 times since Fri, May 25, 2018
Unix - Examples for grep command
Viewed 2978 times since Fri, Jun 8, 2018
Convert CSV to JSON with jq
Viewed 27155 times since Mon, Jan 20, 2020
Bash: Read File Line By Line – While Read Line Loop
Viewed 2104 times since Mon, Feb 18, 2019
How to sort IP addresses in Linux
Viewed 3793 times since Thu, May 24, 2018
Utilities to Tidy Up Your Reports
Viewed 16188 times since Wed, May 30, 2018