cancel
Showing results for 
Search instead for 
Did you mean: 

lvdisplay

SOLVED
Go to solution
Uday_S_Ankolekar
Honored Contributor

lvdisplay

How can I identify what files/mount points there in a perticular logical volume.

For example I want to know what is there in /dev/vg00/lvol13. I checked with bdf, lvdisplay and vgdisplay

Any clue..?
Good Luck..
11 REPLIES
Victor BERRIDGE
Honored Contributor

Re: lvdisplay

Hi,
Use bdf...

All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: lvdisplay

What are you looking for?
bdf should do, or mount, usuall you add a file system in a logical volume that is mounted at the mountpoint specified
all this information is found with e.g. mount:
# mount
/ on /dev/vg00/lvol3 log on Fri Jan 12 22:16:43 2001
/stand on /dev/vg00/lvol1 defaults on Fri Jan 12 22:16:44 2001
/work on /dev/r5vg02/lvol6 delaylog on Fri Jan 12 22:16:54 2001
/var on /dev/vg00/lvol8 delaylog on Fri Jan 12 22:16:54 2001
/var/opt/oracle on /dev/r5vg02/lvol4 delaylog on Fri Jan 12 22:16:54 2001
/var/opt/app/budget on /dev/r5vg02/lvol5 delaylog on Fri Jan 12 22:16:55 2001
/usr on /dev/vg00/lvol7 delaylog on Fri Jan 12 22:16:55 2001
...

What else are you looking for?
Uday_S_Ankolekar
Honored Contributor

Re: lvdisplay

Victor,

I've this logical volume named /dev/vg00/lvol13 I want to know how this lvol is being used as.
bdf doesnot show this entry. vgdiplay -v /dev/vg00 shows the entry of lvol13 . lvdiaply -v /dev/vg00/lvol13 also gives the details with physical disk. I wan to know what is there in this perticular lvol.
Hope I'm clear this time
Good Luck..
James R. Ferguson
Acclaimed Contributor

Re: lvdisplay

Hi Uday:

'bdf' will only show mounted devices. Try mounting your device first.

...JRF...
Rob Smith
Respected Contributor

Re: lvdisplay

Hi, try this:

#!/usr/bin/sh
#
# Report the mountpoint for each argument on the command line
#
# Usage:
# mymountpt / /tmp /var/tmp /opt
#
set -u
if [ $# -lt 1 ]
then
echo
echo "Usage: $(basename $0) file_or_dir [ file_or_dir ....]"
echo " (to report where the file or directory is mounted)"
exit 1
fi
for DIR in $@
do
if [ -f $DIR -o -d $DIR ]
then
MNTPNT=$(/usr/bin/bdf $DIR | /usr/bin/grep -v ^Filesystem | /usr/bin/awk '{print
$NF}')
echo "$DIR is mounted at: $MNTPNT"
else
echo "$DIR is not a file or directory."
fi
done

Hope this helps.

Rob


Learn the rules so you can break them properly.
A. Clay Stephenson
Acclaimed Contributor

Re: lvdisplay

Hi:

I think I know what you are asking and I assume you have a logical volume that you don't know if it is a filesystem or not.

1) Run fsck -m and then do an echo $?
e.g. fsck -F vxfs -m /dev/vg00/lvol13
echo $?
If the resullt is 0; it is a vxfs filesystem suitable for mountinh; if the result is 32 more checks need to be done but it is a vxfs filesystem; 33 means it it already mounted; > 33 indicates that it is not a vxfs filesystem or is very corrupt
If you got a >33 error code then try it as an hfs filesystem
fsck -F hfs -m /dev/vg00/lvol13
echo $?
The same result codes apply.

If you get a 32 you then need to run fsck without -m to clean up the filesystem.
You can then mount the filesystem.
mkdir /mydir
mount -F vxfs (or hfs) /dev/vg00/lvol13 /mydir

If you got a > 33 result code on both types of filesystems, then there is nothing filesystem related there. Perhaps it was used as a dump or swap area. You can also use the dd command to look at /dev/vg00/lvol13.

Clay

If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor
Solution

Re: lvdisplay

First thing to try:

Check your /etc/fstab to see if this is perhaps an LV that is being used for secondary swap. I just happen to have a /dev/vg00/lvol13 myself and it is used for swap. Here is the entry from /etc/fstab:

/dev/vg00/lvol13 ... swap defaults 0 0

Second, go into SAM, then to DISKS AND FILE SYSTEMS, then to LOGICAL VOLUMES. When the logical volume list comes up, look for lvol13 in the vg00 volume group. It will list the LVs use (swap, dump, swap/dump, or HFS or VxFS if it is a filesystem) or its last know mount point. If it lists a mount point you can then try mounting the LV manually by doing:

mkdir /my_mount
mount /dev/vg00/lvol13 /my_mount
cd /my_mount

and then see what you have.
Uday_S_Ankolekar
Honored Contributor

Re: lvdisplay

Thanks Folks,

The lvol is unused. /etc/fstab don't have entry for this.
Good Luck..
John_44
Advisor

Re: lvdisplay

Hello Uday,

It's nice that someone solved your problem but four other people tried to help you. You should assign them points too. Just a thought.

Regards,
John
James R. Ferguson
Acclaimed Contributor

Re: lvdisplay

Hi Uday:

Just because /etc/fstab doesn't contain an entry doesn't necessarily mean that there aren't viable files on the logical volume.

Before you destroy it, you might want to check it with 'fstyp' to see if it returns a filesystem:

# fstyp /dev/vgXX/lvolXX

If it shows "vxfs" or "hfs" then try mounting it on a dummy directory of your choice to see if there's anything you want in it!

Regards!

...JRF...
Uday_S_Ankolekar
Honored Contributor

Re: lvdisplay

Hold on... John,

I'm working on that.. but some time this site is real s.l..o...w!
Thanks
USA
Good Luck..