Subject: Re: Current state of Logical Volumes in NetBSD
To: None <netbsd-users@NetBSD.org, tech-kern@NetBSD.org>
From: Pavel Cahyna <pavel@NetBSD.org>
List: tech-kern
Date: 12/09/2007 13:48:50
On Sun, Nov 25, 2007 at 11:34:49AM +0000, Alistair Crooks wrote:
> On Sun, Nov 11, 2007 at 10:17:57PM +0100, Adam Hamsik wrote:
> > 
> > Yes, that's absolutely true. NetBSD wedges provides linear disk blocks  
> > mapping same as Linux md. IMO it should be not so hard to write simple  
> > volume manager for NetBSD on top of wedges. There are 3-4 options how  
> > to do it:
> > 
> > 1)use this years SOC code from ZFS port. I don't know if this code is  
> > in useable state.
> >   if not it would be good give more effort at this.
> > 
> > 2)port Linux libdevmapper and lvm2 tools to netbsd on top of our  
> > wedges with some support. I think that this way we keep GPL out of  
> > kernel and we can use IMO really good linux lvm NetBSD volume manager.  
> > Intro to Linux Lvm internals [2].
> > 
> > 3) write tools + wedge device library from scratch
> > 
> > I prefer 2 because of
> > 
> > Pros
> > 
> > a) well tested code
> > b) was already done [1]
> > c) I think that linux LVM is better than nothing.
> 
> Thanks for the pointers.
> 
> I wholeheartedly agree with the benefits drawn here.
>  
> > Cons
> > 
> > a) add GPL stuff to netbsd base system :(
> > b) too much people here hate Linux and Linux stuff :).
> 
> I disagree that too many people "hate" Linux. But some of the sources
> that are mentioned are LGPL, not GPL.
> 
> But on to the meat of this mail:
> 
> Looking at reference [1] that you gave below (I missed that one, I was
> on holiday at the time), I managed to get a kindly NetBSD developer to
> forward me through the sources that Christian Limpach provided
> pointers to.  I've brought the devmapper package up to date, and also
> the lvm2 one (latest sources from sourceware.org).  Michael van Elst
> fixed an issue with the PLIST in the lvm2.  I've added Christian's
> lvm.c and lvmvar.h files in the files/ subdirectory of the lvm2
> package.
> 
> I've put them up on
> 
> 	ftp://ftp.netbsd.org/pub/NetBSD/misc/agc/devmapper-pkgsrc.tgz
> 	ftp://ftp.netbsd.org/pub/NetBSD/misc/agc/lvm2-pkgsrc.tgz

Unfortunately the lvm.c which you have put in lvm2-pkgsrc has apparently 
no relation to Christian's code in reference [1] but it is an
implementation of Linux's LVM1 (an old in-kernel LVM implementation) and
has no relation to device-mapper at all.

Does anybody happen to have the sources from [1] ?

> > [1]http://mail-index.netbsd.org/netbsd-users/2003/02/04/0012.html
> > [2]http://mail-index.netbsd.org/tech-kern/2005/06/04/0010.html

Pavel