Discussion:
netbsd-6 BETA2: raid starts after cgd.
David Brownlee
2012-07-01 15:43:38 UTC
Permalink
Hi list,
I upgraded my old file server/backup server at home today. It runs cgd
ontop of two disks running as a raid 1 array. It failed and entered
single user with the error "cdconfig: action failed on /etc/cgd/cgd.conf
line 1".
cgd0 /etc/raid1a
cgd1 /etc/raid0b
cgd0 is where I store my files and cgd1 is my encrypted swap.
I noticed that if I manually run "/etc/rc.d/cgd start" in single user
and then do "mount -a" and "swapon -a" then everything mounts as it
should. Due to this I concluded that this is probably because cgd is
started before raidframe...
Everything seems to run as expected if I add "# BEFORE: cgd" to
/etc/rc.d/raidframe, which seems to support that my problem indeed is
that cgd is started before raidframe.
Starting raidframe before cgd makes more sense in my opinion, because
I'd rather run a cgd ontop of a raid instead of a raid ontop 2 cgds.
I'd like to finish off by saying that everything else with NetBSD 6 BETA2
has been smooth sailing, except for this little snag.
I could see a use case either way, though I agree cgd-on-raid is
probably more common than raid-on-cgd.

Would anyone have any objections to changing the default?
David Brownlee
2012-07-11 15:29:01 UTC
Permalink
Post by David Brownlee
Hi list,
I upgraded my old file server/backup server at home today. It runs cgd
ontop of two disks running as a raid 1 array. It failed and entered
single user with the error "cdconfig: action failed on /etc/cgd/cgd.conf
line 1".
cgd0 /etc/raid1a
cgd1 /etc/raid0b
cgd0 is where I store my files and cgd1 is my encrypted swap.
I noticed that if I manually run "/etc/rc.d/cgd start" in single user
and then do "mount -a" and "swapon -a" then everything mounts as it
should. Due to this I concluded that this is probably because cgd is
started before raidframe...
Everything seems to run as expected if I add "# BEFORE: cgd" to
/etc/rc.d/raidframe, which seems to support that my problem indeed is
that cgd is started before raidframe.
Starting raidframe before cgd makes more sense in my opinion, because
I'd rather run a cgd ontop of a raid instead of a raid ontop 2 cgds.
I'd like to finish off by saying that everything else with NetBSD 6 BETA2
has been smooth sailing, except for this little snag.
I could see a use case either way, though I agree cgd-on-raid is
probably more common than raid-on-cgd.
Would anyone have any objections to changing the default?
Just a thought on this - have you tried setting up your raid to
autoconfigure - that should work and not need the rc.d change (plus
also be more robust as it no longer needs the raid config file)....
Alan Barrett
2012-07-22 16:45:43 UTC
Permalink
Post by David Brownlee
[problems because /etc/rc.d/cgd runs before /etc/rc.d/raidframe]
Everything seems to run as expected if I add "# BEFORE: cgd" to
/etc/rc.d/raidframe, which seems to support that my problem indeed is
that cgd is started before raidframe.
Starting raidframe before cgd makes more sense in my opinion, because
I'd rather run a cgd ontop of a raid instead of a raid ontop 2 cgds.
I'd like to finish off by saying that everything else with NetBSD 6 BETA2
has been smooth sailing, except for this little snag.
I could see a use case either way, though I agree cgd-on-raid is
probably more common than raid-on-cgd.
Would anyone have any objections to changing the default?
At present, there's nothing to explicitly set the relative
order in which /etc/rc.d/cgd and /etc/rc.d/raidframe are run.
cgd happens to run first due to an implementation choice in
rcorder(8), but this is not promised by the interface.

I'd suggest leaving the defaults unchanged in NetBSD, and doing one of
the following on the end user's system:

* Use raidframe auto-configuration, to make the kernel
configure the raid(4) devices earlier.

* Edit /etc/rc.d/cgd to add "REQUIRE: raidframe"

* Edit /etc/rc.d/raidframe to add "BEFORE: cgd"

* Add an extra file, /etc/rc.d/cgd-before-aidframe or something,
with both "REQUIRE: cgd" and "BEFORE: raidframe".

--apb (Alan Barrett)
David Brownlee
2012-07-23 14:41:51 UTC
Permalink
Post by David Brownlee
[problems because /etc/rc.d/cgd runs before /etc/rc.d/raidframe]
Everything seems to run as expected if I add "# BEFORE: cgd" to
/etc/rc.d/raidframe, which seems to support that my problem indeed is
that cgd is started before raidframe.
Starting raidframe before cgd makes more sense in my opinion, because
I'd rather run a cgd ontop of a raid instead of a raid ontop 2 cgds.
I'd like to finish off by saying that everything else with NetBSD 6 BETA2
has been smooth sailing, except for this little snag.
I could see a use case either way, though I agree cgd-on-raid is
probably more common than raid-on-cgd.
Would anyone have any objections to changing the default?
At present, there's nothing to explicitly set the relative order in which
/etc/rc.d/cgd and /etc/rc.d/raidframe are run. cgd happens to run first due
to an implementation choice in rcorder(8), but this is not promised by the
interface.
I'd suggest leaving the defaults unchanged in NetBSD, and doing one of
* Use raidframe auto-configuration, to make the kernel
configure the raid(4) devices earlier.
* Edit /etc/rc.d/cgd to add "REQUIRE: raidframe"
* Edit /etc/rc.d/raidframe to add "BEFORE: cgd"
* Add an extra file, /etc/rc.d/cgd-before-aidframe or something,
with both "REQUIRE: cgd" and "BEFORE: raidframe".
It turned out the current situation was actually the best default, as
it allows raid-on-cgd, cgd-on-raid, and raid-on-cgd-on-raid - as long
as the final -on-raid was set to autoconfigure :)

Loading...