Display basic information about Physical Volumes
Article Number: 207 | Rating: Unrated | Last Updated: Sun, Jun 3, 2018 10:04 AM
# 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
Posted - Sun, Jun 3, 2018 10:04 AM. This article has been viewed 4530 times.
Filed Under:
Bash, Scripts
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
Related Articles

Unix - Find command examples
Viewed 5299 times since Fri, Jun 8, 2018
Unix - eval command example
Viewed 2773 times since Fri, Jun 8, 2018
Bash: String Length – How To Find Out
Viewed 3145 times since Mon, Feb 18, 2019
Utilities to Tidy Up Your Reports
Viewed 17192 times since Wed, May 30, 2018
Unix - Examples for grep command
Viewed 4025 times since Fri, Jun 8, 2018
Script HW/SW AIX
Viewed 10555 times since Mon, Jun 4, 2018
Tunneling With SSH to Your Destination
Viewed 5792 times since Wed, May 30, 2018
HowTo: Clear BASH History
Viewed 2990 times since Mon, Feb 18, 2019
Convert CSV to JSON with bash script
Viewed 6267 times since Mon, Jan 20, 2020