Kbase P139466: How do I display information about the logical volumes, volume groups and physical disks on an AIX s
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  06/01/2009 |
|
Status: Unverified
GOAL:
How do I display information about the logical volumes, volume groups and physical disks on an AIX system?
GOAL:
How do I list the defined logical volumes on an AIX system?
GOAL:
How do I list the defined volume groups on an AIX system?
GOAL:
How do I display information about the physical disks on an AIX system?
FACT(s) (Environment):
IBM AIX
Progress 9.x
OpenEdge 10.x
FIX:
The following commands can be used to display information about logical volumes, volume groups and physical disks on an AIX system. Use the "man" command (e.g. man lslv) to display the command syntax and description:
lslv <logical volume name> : Displays information about a logical volume
lsvg : Displays information about volume groups
lspv <physical volume name> " Displays information about a physical volume within a volume group.
The following script can also be run. It will create a report of the logical volumes, volume groups and physical disks. The report is named <machine hostname>.disk.report and is written to the same directory where the script was run from. The script will also create, and then delete temporary files (with a .progress<process id of the script> extension) while it is running:
#!/bin/sh
# List the volume groups
lsvg > vol_groups.progress$$
# List the logical volume name, type, number of logical and physical partitions,
# number of physical volumes, logical volume state and mount point for each
# logical volume in the volume group
for i in `cat vol_groups.progress$$`
do
lsvg -l $i > `hostname`.lsvg.$i.progress$$
echo " " >> `hostname`.lsvg.$i.progress$$
done
# Create a list of logical volume names
for i in *.lsvg*
do
# Strip off the first two lines which do not contain volume names
num_lvs=`wc -l $i | awk '{print $1}'`
num_lvs=`expr $num_lvs - 2`
lvs=`tail -$num_lvs $i | awk '{print $1} '`
# Display information about each logical volume in the volume group
for j in $lvs
do
lslv $j > `hostname`.lslv.$j.progress$$
echo " " >>`hostname`.lslv.$j.progress$$
lslv -l $j >> `hostname`.lslv.$j.progress$$
echo "----------------------------------" >>`hostname`.lslv.$j.progress$$
echo " " >>`hostname`.lslv.$j.progress$$
done
done
# Create a list of physical volumes
lspv > phys_vols.progress$$
phys_vols=`lspv | awk '{print $1}'`
# Display information about each physical volume and the logical volumes associated with it
for i in $phys_vols
do
lspv $i > `hostname`.lspv.$i.progress$$
echo " " >>`hostname`.lspv.$i.progress$$
lspv -l $i >> `hostname`.lspv.$i.progress$$
echo "----------------------------------" >>`hostname`.lspv.$i.progress$$
echo " " >>`hostname`.lspv.$i.progress$$
done
# Create the report file
echo "VOLUME GROUPS" > `hostname`.disk.report
echo "=============" >> `hostname`.disk.report
cat `hostname`.lsvg.*.progress$$ >> `hostname`.disk.report
echo " " >> `hostname`.disk.report
echo "LOGICAL VOLUMES" >> `hostname`.disk.report
echo "===============" >> `hostname`.disk.report
cat `hostname`.lslv.*.progress$$ >> `hostname`.disk.report
echo " " >> `hostname`.disk.report
echo "PHYSICAL VOLUMES" >> `hostname`.disk.report
echo "================" >> `hostname`.disk.report
c.at `hostname`.lspv.*.progress$$ >> `hostname`.disk.report
# Remove the temporary files created while running this script
rm *.progress$$
.