Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command to find filesystem 1

Status
Not open for further replies.

lblauen

Technical User
Aug 13, 2002
69
0
0
I'm looking for a command to show me all the physical volumes a filesystem is on.

example /psoft751 is on which physical volumes. Is it possible. I know its on /dev/lv167no1 for a volume group name.

I would like a output like /psoft751 is on hdisk1,hdisk30 and hdisk44. Even though the volume group is on hdisk1-60.

Or do I need a script to do this?

Thanks Lloyd
 
lspv |awk '{print $1}' |while read vol
do
echo "-----------------------------------------------"
echo ""
lspv -l $vol
done
 
I like what was posted but I just want the physical volumes with /psoft751 not all the volumes. Or the unassigned or varyoff ones.
 
#!/bin/ksh

if test "${1}" = ""
then
echo "Usage: gimpy filesystemname"
exit
fi

FS="${1}"

LVNAME=`df -k | grep " ${FS}$" | head -1 | awk '{print $1}' | sed s/'\/dev\/'//g`

if test "${LVNAME}" = ""
then
echo "no such filesystem"
exit
fi

#echo "${LVNAME}"

echo "${FS} is on \c"

lslv -l ${LVNAME} | tail +3 | awk '{print $1}' | xargs echo
 
hi,

you can try

lslv -m lvname

this lists all disks used , number of pp's used
and the mirror copy ( 2nd ,3rd columns)
 
Thanks chapter11 that is just what the doctor ordered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top