Subject: Re: NetBSD 3.0, vinum and a FreeBSD 4.11 built vinum RAID-1 array
To: None <tls@rek.tjls.com>
From: Mark Cullen <mark.r.cullen@gmail.com>
List: netbsd-users
Date: 06/10/2006 01:57:37
Thor Lancelot Simon wrote:
> On Fri, Jun 09, 2006 at 11:15:30PM +0100, Mark Cullen wrote:
> 
>>Geert Hendrickx wrote:
>>
>>>On Fri, Jun 09, 2006 at 09:53:17PM +0100, Mark Cullen wrote:
>>>
>>>
>>>>Hi all,
>>>>
>>>>I am looking to 'upgrade' my little home server from FreeBSD 4.11.
> 
> 
> I've been doing quite a bit of development on a platform based on FreeBSD
> 4.11 recently.  I can agree that it will be a very substantial upgrade
> indeed!  FreeBSD 4 is pretty old and crusty (in particular, the age of its
> network stack really shows).

That, it very is :-)

The main reason I am looking to switch to something else is actually 
mainly just stability. There's a certain issue that I have with routing, 
which I hope will not show up in whatever I end up upgrading to. My ADSL 
modem works using what I believe is called 'half-bridge' mode -- when 
connected, the modem assigns itself the internet IP address it receives, 
lets say 1.2.3.4, and the DHCP client running on it is telling the 
receiver (the BSD box, in this case) to set it's IP address to 1.2.3.4 
AND the default route to 1.2.3.4. Now, this works perfectly fine on 
Windows (of course it would...), but with FreeBSD, I get some very 
strange 'lockups'. I think it's actually some sort of infinite loop 
somewhere, as I start getting a flood of strange arp messages on the 
console from what I remember. I can't actually even get the 'net 
responsive without a modified dhclient-script, infact. I don't precisely 
know what I am talking about here, but it seems the dhclient script just 
assumes a "normal" route, as in:

   `route add default $router`

When what I actually need, apparently, is:

`route add default -iface $router`

I can't remember where I saw this, but I picked up a snippet of code for 
dhclient-script which adds functionality to determine whether the -iface 
part is needed or not. A patch against the default dhclient-script in 
NetBSD 3.0 would look like:

#--- start patch ---
--- dhclient-script.old 2006-06-12 05:11:57.000000000 +0000
+++ dhclient-script     2006-06-12 05:12:27.000000000 +0000
@@ -58,7 +58,11 @@

  add_new_routes() {
         for router in $new_routers; do
-               route add default $router
+               if [ "$router" = "$new_ip_address" ]; then
+                       route add default -iface $router
+               else
+                       route add default $router
+               fi
         done >/dev/null 2>&1

         set -- $new_static_routes
#--- end patch ---

(I have no idea of the correctness of that, by the way, all I can say is 
"it works for me". I guess this should go to the dhclient people though?)

With that, in FreeBSD and DragonFlyBSD at least, my internet starts 
working correctly. I thought it also totally cured this 'lockup' 
behaviour on FreeBSD, but for some reason it happened just the other 
day, out of the blue. I also hit some strange filesystem bug, but that 
may well have been a one off. I don't think I have actually seen a panic 
for a long time on 4.11.

> 
> 
>>In FreeBSD, the device names are always:
>>
>>ad0 = Primary Master
>>ad1 = Primary Slave
>>ad2 = Secondary Master
>>ad3 = Secondary Slave
> 
> 
> This is only the case because the default FreeBSD kernel configuration
> installed by the system installer has an option that causes it to be
> so.  You can build a NetBSD kernel like that too; just hardwire the disks
> to the channels and master/slave positions in your kernel config file,
> instead of using * and ? to wildcard them.
> 
> However, with RAIDframe this is not necessary, because it will find the
> disks by their component labels.
> 
> Thor
> 

Ah ha. Now that I didn't realise! And it is good to know that RAIDFrame 
picks up on it anyway, and so it's not so much an issue. I may look in 
to hardwiring them as you said though, as I quite like that functionality.

Anyhow, I have had a little mess about with RAIDFrame and I did manage 
to create a RAID-1 array successfully it seems. 'time proven' to be very 
stable too? I had some serious data corruption when I tried to use 
softupdates + vinum on FreeBSD (luckily one of the disks was pulled for 
that disk, so the array could be rebuilt). Is it safe to use softdep and 
a RAID-1 RAIDFrame configuration?

Thanks for the tip! Most helpful!