[linux-lvm] determining lv from mount point

Montgomery, Kendal L kendal.montgomery at qwest.com
Tue Sep 23 16:34:01 UTC 2003

Well.. The reason I say to do it this way is because lvdisplay doesn't
seem to give an "error" code on return (it's always 0) when it's not a
logical volume.  It does display an error message that you'd have to
parse the output for a specific error message.

This should work for LVM, but not sure about LVM2 because I haven't
personally had a chance to play with it. It may work for both, but I'm
not sure.


-----Original Message-----
From: Galen Seitz [mailto:galens at seitzassoc.com] 
Sent: Tuesday, September 23, 2003 5:20 PM
To: linux-lvm at sistina.com
Subject: Re: [linux-lvm] determining lv from mount point 

Montgomery, Kendal L <kendal.montgomery at qwest.com> wrote:

> DEVICE=$(df ${1} | grep -v ^Filesystem | awk '{ print $1 }')
> lvscan | grep ${DEVICE} > /dev/null 2>&1

Is using lvscan preferable to something like this
lvdisplay ${DEVICE} > /dev/null 2>&1

I'm currently using LVM, not LVM2 (sorry, I should have said that in the
first message).  Will this method work for LVM2 as well?


linux-lvm mailing list
linux-lvm at sistina.com
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

More information about the linux-lvm mailing list