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
Unix - Find command examples
Viewed 4678 times since Fri, Jun 8, 2018
Convert JSON to CSV with bash script
Viewed 13225 times since Mon, Jan 20, 2020
Linux / UNIX: Convert Epoch Seconds To the Current Time
Viewed 3163 times since Fri, May 25, 2018
Dealing with Funny Files
Viewed 2885 times since Wed, May 30, 2018
Epoch & Unix Timestamp Conversion Tools
Viewed 63262 times since Fri, Jun 22, 2018
HowTo: Clear BASH History
Viewed 2275 times since Mon, Feb 18, 2019
How to get a password from a shell script without echoing - solutions
Viewed 14049 times since Fri, Feb 22, 2019
The Ultimate Bash Array Tutorial with 15 Examples
Viewed 13594 times since Sun, Sep 30, 2018
Unix - eval command example
Viewed 2111 times since Fri, Jun 8, 2018
Convert a human readable date to epoch with a shell script on OpenBSD and Mac OS X
Viewed 15316 times since Fri, May 25, 2018