Subject: Re: Current state of Logical Volumes in NetBSD
To: Adam Hamsik <haaaad@gmail.com>
From: Louis Guillaume <lguillaume@berklee.edu>
List: netbsd-users
Date: 11/13/2007 22:43:53
Adam Hamsik wrote:
> 
> On Nov,Sunday 11 2007, at 12:36 PM, Alistair Crooks wrote:
> 
>> On Sun, Nov 11, 2007 at 11:35:45AM +0100, Markus Kolb wrote:
>>> Hi,
>>>
>>> I am thinking of switching to NetBSD.
>>> But I need a Logical Volume Management solution for resizing partitions
>>> and at least expanding the fs on them and I can't find any up-to-date
>>> information related to this.
>>> - Vinum is removed
>>> - ccd seems to only concatenate different physical disks
>>> - dk wedges seem to be for partitioning big disks or have I 
>>> misunderstood?
>>>
>>> If there is anything with PV, PVGroups, LVGroups and LVolumes possible
>>> how is it called in NetBSD?
>>
>> Yes, vinum was removed because it was not really being maintained, and
>> had some bitrot problems.  ccds will span across multiple physical
>> disks, but isn't the dynamic volume manager that you're looking for.
>>
>> I don't want to try to speak for mycroft, but my understanding of
>> his idea of wedges was that they are just simple things, which use
>> the strategy functionality to route requests to different areas
>> on the block device(s). Something crafted on top of this could provide
>> a nice, light volume manager.
> 
> 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.
> 
> Cons
> 
> a) add GPL stuff to netbsd base system :(
> b) too much people here hate Linux and Linux stuff :).
> 

c) There is a major flaw in the way Linux LVM is implemented (from my 
experience.) This is probably a little too detailed in this discussion 
and kind of a tangent, but I'd hate to see this imported to NetBSD 
without modification.

The flaw is in lack of a versatile Inter-Physical Volume Allocation 
Policy. There's something wacky about what is called "striping" of 
physical extents where if you added a PV down the road you have to 
basically take apart the whole LV and start over from backup. Otherwise 
you'll have a bunch of extents that have x stripes and a bunch with x+1. 
And they won't be evenly distributed.

Basically there is no "reorgvg" as there is in AIX.

If NetBSD builds its own LVM, please model it after AIX's LVM, not Linux's.

Louis