Re: find LVM volume group of a volume
2009/10/18 Steve Kemp <firstname.lastname@example.org>:
> On Sun Oct 18, 2009 at 21:56:50 +0200, Guillaume CHARDIN wrote:
>> But, when i try to use it with lvdisplay with
>> '/dev/mapper/VGNAME-LVNAME' as argument, the command fail.
> Try running lvdisplay with no arguments to see a list.
> Then you'll see output like this:
Yes of course.
But my goal is to build a backup script to automaticaly create a
snapshot of an LV mounted somewhere. So either the volume group name
or the logical volume name is unknown
In my process I do a 'reverse' research to find it out. Something like that :
#mount | awk some-args #and return something like this :
[...many mounted devices...]
/dev/mapper/VGNAME-LVNAME /mount/point #the line i want to find !
#lvdisplay /dev/mapper/VGNAME-LVNAME | grep "VG Name"
=> the previous command should return the value of the VG name of my
LV but... Not because it fails :)