Re: find LVM volume group of a volume
2009/10/18 Steve Kemp s...@debian.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 :) -- Guillaume -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: find LVM volume group of a volume
On Sun Oct 18, 2009 at 22:15:19 +0200, Guillaume CHARDIN wrote: #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 :) Works for me: r...@gold:~# lvdisplay /dev/mapper/gold--vol-home |grep VG Name VG Namegold-vol This could be due to a version different - As I'm running unstable/sid on my desktop. Steve -- Debian GNU/Linux System Administration http://www.debian-administration.org/ -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: find LVM volume group of a volume
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: --- Logical volume --- LV Name/dev/gold-vol/music VG Namegold-vol LV UUIDiWUDhx-JmPh-Ajzf-yUz7-AMuZ-r1My-ff8gwx LV Write Accessread/write LV Status available # open 1 LV Size42.00 GB .. You can be more specific with: r...@gold:~# lvdisplay /dev/gold-vol/ms --- Logical volume --- LV Name/dev/gold-vol/ms VG Namegold-vol LV UUIDRzwm6s-b67s-3Ixs-3Aj9-ILmT-R4mI-QsAHfr LV Write Accessread/write LV Status available # open 0 LV Size20.00 GB Current LE 5120 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:5 As you can see the VG name is displayed there. Is there a way to easily find the VG of a Logical volume ? Failing that you could just run: r...@gold:~# lvs LVVG Attr LSize Origin Snap% Move Log Copy% Convert home gold-vol -wi-ao 50.00G kvm gold-vol -wi-ao 25.00G msgold-vol -wi-a- 20.00G music gold-vol -wi-ao 42.00G root gold-vol -wi-ao 30.00G schroot-etch gold-vol -wi-a- 1.00G schroot-lenny gold-vol -wi-a- 1.00G schroot-sid gold-vol -wi-a- 1.00G temp gold-vol -wi-a- 10.00G Steve -- Debian GNU/Linux System Administration http://www.debian-administration.org/ -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org