[CentOS] how to access lvm inside lvm

Peter Peltonen

peter.peltonen at gmail.com
Fri Apr 29 22:05:47 UTC 2011


I have a centos 5.6 server that has xen domUs installed on their on
logical volumes. These logical volumes contain their own volume groups
and again their own logical volumes. I want to access the domU logical
volumes and tried this:

[root at kr ~]# fdisk -l /dev/VolGroup00/LogVol02

Disk /dev/VolGroup00/LogVol02: 274.8 GB, 274877906944 bytes
255 heads, 63 sectors/track, 33418 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                    Device Boot      Start         End      Blocks   Id  System
/dev/VolGroup00/LogVol02p1   *           1          13      104391   83  Linux
/dev/VolGroup00/LogVol02p2              14       16709   134110620
8e  Linux LVM

[root at kr ~]# kpartx -a /dev/VolGroup00/LogVol02
[root at kr ~]# ls -l /dev/mapper/
total 0
crw------- 1 root root  10, 62 Apr 26 02:19 control
brw-rw---- 1 root disk 253, 12 Apr 30 00:45 LogVol02p1
brw-rw---- 1 root disk 253, 13 Apr 30 00:45 LogVol02p2

But when I try make the domU volumegroup accessible I run into problems:

[root at kr ~]# vgscan
  Reading all physical volumes.  This may take a while...
  WARNING: Duplicate VG name VolGroup00: Existing
hxNFYw-c1Z6-DB99-SiiK-yRas-eXiI-1w27Z0 (created here) takes precedence
over KmwQTQ-jT19-lvvu-H6d0-i4T3-s5Jw-JHnx0M
  WARNING: Duplicate VG name VolGroup00: Existing
hxNFYw-c1Z6-DB99-SiiK-yRas-eXiI-1w27Z0 (created here) takes precedence
over KmwQTQ-jT19-lvvu-H6d0-i4T3-s5Jw-JHnx0M
  Found volume group "VolGroup00" using metadata type lvm2
  Found volume group "VolGroup00" using metadata type lvm2

How can I now vgchange to the domU volume group as vgchange does not
take the UUID as an argument, just the volume group name...?

Regards,
Peter



More information about the CentOS mailing list