NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RAIDframe changes its unit number

On Wed, 30 Sep 2015 17:38:38 +0200
Frank Wille <> wrote:

> Greg Oster wrote:
> >> And wouldn't it be nice to fix RAIDframe, so that a
> >> previous /dev/raid1 is automatically configured as /dev/raid0
> >> again, when raid0 does not exist in the system? Or doesn't that
> >> make sense for some reason?
> >
> > Imagine a system where /dev/raid0a is /, /dev/raid1e is /tmp,
> > and /dev/raid2e is /bigdatabase.  Further, suppose that raid1 'goes
> > away', and that now /dev/raid2e is magically configured
> > as /dev/raid1e. What happens on boot when /tmp is cleared, given
> > that /etc/fstab hasn't changed to reflect the new location
> > of /bigdatabase?
> Ok, that's a valid reason. You really don't want that to happen. ;)
> > I agree that it'd be nice to have an IOCTL for raidctl to change
> > which device a RAID set will show up as on next reboot... It's not
> > that hard to do -- just requires time to do a little coding.
> Yes. I already had a look into the code myself. You only have to
> change the last_unit field in the ComponentLabel? And add a new
> option for raidctl?

Correct.  That should be all that's needed.
rf_update_component_labels() is where the work happens...  There are
two lines in there like this:
                        clabel->last_unit = raidPtr->raidid;

Just change those to:

                        clabel->last_unit = raidPtr->next_raidid;

Initialize next_raidid with raidid when the RAID device is configured,
and make an ioctl to update next_raidid, and that should be it!


Greg Oster

Home | Main Index | Thread Index | Old Index