Operating System - HP-UX
1837035 Members
2592 Online
110111 Solutions
New Discussion

Re: How do yuo know if a LV is in use? and if a LV is mounted?

 
SOLVED
Go to solution
mVivas
New Member

How do yuo know if a LV is in use? and if a LV is mounted?

Hi all,

How do yuo know if a LV is in use? and if a LV is mounted?

already i have used these:

e.g:

lvdisplay v /dev/vg00/lvol2
lvdisplay -v /dev/vg00/lvol2

mount -v

more /etc/fstab

fuser -c /dev/vg00/lvol2

fuser -u /dev/vg00/lvol2

none of these is displaying what i expect, whitch is, if it is in use, or if it is mounted.

What command may i use for this?


Thanks

12 REPLIES 12
Wouter Jagers
Honored Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

Your mount & fuser commands should do quite ok to find out whether it is mounted and/or used.

# bdf /dev/vg00/lvol2

..should also show whether or not it's mounted, but will probably yield the same results.

When you say "none of these is displaying what i expect": what do they display, and what do you expect ? :-)

Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
Wouter Jagers
Honored Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

By the way: vg00/lvol2 is usually your swap space.. which might explain the confusion ;-)
an engineer's aim in a discussion is not to persuade, but to clarify.
James R. Ferguson
Acclaimed Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

Hi:

One way to know if a filesystem is mounted on a logical volume is to look at 'etc/mnttab'.

# cat /etc/mnttab

If you want to assess what files and/or directories are open, use 'lsof' which is available from the HP-UX Porting Center.

Regards!

...JRF...

Wouter Jagers
Honored Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

Sorry for the extra post(s), submitting too quickly :-/

# swapinfo -tam

--> will show your active swapping devices. It's probably there ;-)

(0 points on this post please, this should have been above)
an engineer's aim in a discussion is not to persuade, but to clarify.
Doug O'Leary
Honored Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

Hey;

mount | grep ${lv}

will tell you if it's mounted.

The other potential option is its used as a raw volume in a database...

ls -ld /dev/${vg}/r${lv##*/}

will show the ownership of the raw volume. If it's not root, then it's probably being used as a raw volume.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
A. Clay Stephenson
Acclaimed Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

For LVOL's which house a file system AND the filesystem is mounted the commands bdf or df will suffice. Now consider the case in which a file system is not currently mounted but you don't want to simply destroy the file system, you should test the LVOL with the fstyp command. Another common use for LVOL's is a device swap space. Swapinfo can tell you that. Now for the most difficult of all: Consider an LVOL used as a raw device. It might be used by a database or (more rarely) used by another application. You can use the lsof command to determine if the LVOL is CURRENLY in use butt lsof (or fuser) can tell you nothing, for example, id the raw LVOL houses a database object but the database is currently down. So the real answer to your question is document, document, document. If you have to ask "now what is that LVOL doing?" then you have already lost the battle.

If it ain't broke, I can fix that.
mVivas
New Member

Re: How do yuo know if a LV is in use? and if a LV is mounted?

thanks, still i have some questions about this.

i have lvol3, lvol12 for swap pri, but swapinfo -tab display lvol2, lvol3 and lvol12, the strange thing is that lvol2 is not in fstab or mntab, why is this happening?

i have lvol4 and i can´t see it, i don´t know if lvol4 is being use. Tried to run lsof but isn´t installed.

how do i know who mounted lvol2 as swap area?

e.g.

taken from fstab:

/dev/vg00/lvol12 ... swap pri=1 0 0
/dev/vg00/lvol3 ... swap pri=1 0 0

swapinfo -tab:
# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 3407 4785 42% 0 - 1 /dev/vg00/lvol2
dev 12288 3420 8868 28% 0 - 1 /dev/vg00/lvol12
dev 8192 3430 4762 42% 0 - 1 /dev/vg00/lvol3
reserve - 17718 -17718
memory 9451 1316 8135 14%
total 38123 29291 8832 77% - 0 -

Patrick Wallek
Honored Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?

/dev/vg00/lvol2 is the PRIMARY HP-UX swap area. It is set up when the OS is installed. You will not see it in /etc/fstab or /etc/mnttab or any of those areas.

vg00/lvol2 should always exist.
DCE
Honored Contributor

Re: How do yuo know if a LV is in use? and if a LV is mounted?



lvol2 is the swap space created when the OS is first installed. It is never "mounted" and hence will never show in the mnttab or fstab. In fact most swap should be device swap, since it is faster.

As stated earlier there are applications (usually datbases) that write directly to the lvol, and do not require a file system to be mounted. In this case, as stated earlier, the only way to truly know if it is in use is documentation - and communication with the DBA's
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How do yuo know if a LV is in use? and if a LV is mounted?

In your case, /dev/vg00/lvol2 is your primary swap area and was automatically enabled when the system booted. No fstab entry is used for the primary swap area. You can verify this by "lvlnboot -v /dev/vg00".

You can get lsof from any of the HP-UX Porting Centres.

http://hpux.its.tudelft.nl/hppd/hpux/Sysadmin/lsof-4.77/
If it ain't broke, I can fix that.
mVivas
New Member

Re: How do yuo know if a LV is in use? and if a LV is mounted?

thanks to all, i´m going to check my swap area.
mVivas
New Member

Re: How do yuo know if a LV is in use? and if a LV is mounted?

bye