From mboxrd@z Thu Jan 1 00:00:00 1970 From: "S. J. van Harmelen" Subject: Re: Use LVM on /dev/mapper/diskname and iSCSI Date: Mon, 19 Nov 2007 17:57:10 +0100 Message-ID: <1195491430.6074.30.camel@sanderbal> References: <1195480602.6074.3.camel@sanderbal> <47419854.2000508@linpro.no> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <47419854.2000508@linpro.no> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids P.S. pvs only scanned the real disks and not the /dev/mapper/diskname disks. So some of the scan's where rejected because the path to that path was the redudant path. But I assume that the /dev/mapper/diskname will have the exact same lvm info written on it, ass it is in fact the real disk (/dev/sdi for example)? Sander On Mon, 2007-11-19 at 15:06 +0100, Tore Anderson wrote: > * S. J. van Harmelen > > > I have a couple of LUN's that are handled by the multipath driver. > > This works great, but now I want to use LVM so I can take snapshots > > of one LUN to another LUN. > > > > Can someone tell me how to do this? > > > > When I do pvcreate /dev/mapper/diskname I get an error that the disk > > is already part of an volume group. But I sertainly did not configure > > that. > > > > Can it be that the multipath driver of devmapper did that? > > If you have a PV signature on the volume, LVM might have used one of the > paths instead of using the multipath'ed device under /dev/mapper. You > should be able to check this by running the command "pvs" - it should > list all the detected PVs on your system. > > If this was the problem, you can avoid it by instructing LVM to not scan > SCSI devices directly, by adding a line in /etc/lvm/lvm.conf like this: > > device { > filter = [ "a|^/dev/mapper/.*|", "r|.*|" ] > } > > This will make LVM only look at devices in /dev/mapper/ as possible PV > candidates, ignoring all other devices. Beware if you have a PV on the > internal drives though, you might want to have something like this > instead in that case (if that PV is on /dev/sda2, for instance): > > filter = [ "a|^/dev/mapper/.*|", "a|^/dev/sda2$|", "r|.*|" ] > > Make sure lvm.conf makes its way into the initramfs if you start the LVM > stuff there. I know Ubuntu doesn't include this file by default, at least. > > Regards