Discussion:
raidframe - a configf question
y***@SDF.ORG
2014-08-29 17:34:22 UTC
Permalink
I am preparing a replacement system for my 10 year old home
firewall/nat/webserver.

The new system is i386 (amd 2600, 2.25 G RAM, 3x 120 GB HD), running
NetBSD_6_Stable w/Generic kernel.

I had 3 disks, so *loosely* followed Ch. 16 (raidframe setup) of The Guide.
Initially I installed 6.1.4 release onto wd0, upgraded it to 6_Stable,
configured raid on wd1/wd2 using the example config from the guide:
START array
1 2 0

START disks
/dev/wd1a
/dev/wd2a

START layout
128 1 1 1

START queue
fifo 100

Now to my question....
I've already reconfigured wd0 as a raid disk, installed bootblocks with -t
raid and verified I can use it in the array manually.
But I think I'd like to add wd0 into raid0 as a hot spare.
I can do this interactively, but it is not persistent.
Is this as easy as updating the config file to:

START array
1 2 1

START disks
/dev/wd1a
/dev/wd2a

START spare
/dev/wd0a

START layout
128 1 1 1

START queue
fifo 100

(raidctl -c config_file raid0)

1) It was not clear from my reading of the man page or guide, if I could
reconfigure a raid array without destroying it.

2) If what I propose is OK, what other steps might I need or want to take?

thanks,
gene
Patrick Welche
2014-08-30 10:17:00 UTC
Permalink
Post by y***@SDF.ORG
I've already reconfigured wd0 as a raid disk, installed bootblocks with -t
raid and verified I can use it in the array manually.
But I think I'd like to add wd0 into raid0 as a hot spare.
I can do this interactively, but it is not persistent.
For the "not persistent" part of your question, see raidctl(8):

-A yes dev
Make the RAID set auto-configurable. The RAID set will be
automatically configured at boot before the root file system is
mounted. Note that all components of the set must be of type
RAID in the disklabel.

(and other parameters if you want to boot from it as a root partition)

Cheers,

Patrick
y***@SDF.ORG
2014-08-30 15:40:49 UTC
Permalink
Post by Patrick Welche
Post by y***@SDF.ORG
I've already reconfigured wd0 as a raid disk, installed bootblocks with -t
raid and verified I can use it in the array manually.
But I think I'd like to add wd0 into raid0 as a hot spare.
I can do this interactively, but it is not persistent.
-A yes dev
Make the RAID set auto-configurable. The RAID set will be
automatically configured at boot before the root file system is
mounted. Note that all components of the set must be of type
RAID in the disklabel.
(and other parameters if you want to boot from it as a root partition)
Hi Patrick,

My question must not be clear. I already have raid0 set as -A root raid0.

Here is a live example where I try to add wd1 as a hot spare. I seem to be
able to get any two disks to be the raid0 set, but I cannot get any disk
to become a persistent hot spare:
root 27 # raidctl -v -s raid0
Components:
/dev/wd0a: optimal
/dev/wd2a: optimal
No spares.
Component label for /dev/wd0a:
Row: 0, Column: 0, Num Rows: 1, Num Columns: 2
Version: 2, Serial Number: 2014081612, Mod Counter: 1986949234
Clean: No, Status: 0
sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
Queue size: 100, blocksize: 512, numBlocks: 234441472
RAID Level: 1
Autoconfig: Yes
Root partition: Yes
Last configured as: raid0
Component label for /dev/wd2a:
Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
Version: 2, Serial Number: 2014081612, Mod Counter: 1986949234
Clean: No, Status: 0
sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
Queue size: 100, blocksize: 512, numBlocks: 234441472
RAID Level: 1
Autoconfig: Yes
Root partition: Yes
Last configured as: raid0
Parity status: clean
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.
root 28 # raidctl -a /dev/wd1a raid0
root 29 # raidctl -v -s raid0
Components:
/dev/wd0a: optimal
/dev/wd2a: optimal
Spares:
/dev/wd1a: spare
Component label for /dev/wd0a:
Row: 0, Column: 0, Num Rows: 1, Num Columns: 2
Version: 2, Serial Number: 2014081612, Mod Counter: 1986949234
Clean: No, Status: 0
sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
Queue size: 100, blocksize: 512, numBlocks: 234441472
RAID Level: 1
Autoconfig: Yes
Root partition: Yes
Last configured as: raid0
Component label for /dev/wd2a:
Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
Version: 2, Serial Number: 2014081612, Mod Counter: 1986949234
Clean: No, Status: 0
sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
Queue size: 100, blocksize: 512, numBlocks: 234441472
RAID Level: 1
Autoconfig: Yes
Root partition: Yes
Last configured as: raid0
/dev/wd1a status is: spare. Skipping label.
Parity status: clean
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.
root 30 # shutdown -r now
[reboot]
root 1 # raidctl -v -s raid0
Components:
/dev/wd0a: optimal
/dev/wd2a: optimal
No spares.
Component label for /dev/wd0a:
Row: 0, Column: 0, Num Rows: 1, Num Columns: 2
Version: 2, Serial Number: 2014081612, Mod Counter: 1986949244
Clean: No, Status: 0
sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
Queue size: 100, blocksize: 512, numBlocks: 234441472
RAID Level: 1
Autoconfig: Yes
Root partition: Yes
Last configured as: raid0
Component label for /dev/wd2a:
Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
Version: 2, Serial Number: 2014081612, Mod Counter: 1986949244
Clean: No, Status: 0
sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
Queue size: 100, blocksize: 512, numBlocks: 234441472
RAID Level: 1
Autoconfig: Yes
Root partition: Yes
Last configured as: raid0
Parity status: clean
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.
************************

Note that the spare does not persist across the reboot.

How can I fix this?

thanks,
gene
Christos Zoulas
2014-08-30 16:31:56 UTC
Permalink
Post by y***@SDF.ORG
Note that the spare does not persist across the reboot.
How can I fix this?
I don't think that persistent spares are supported. Someone needs to write
some code. Greg should be able to provide some guidance.

christos
Greg Oster
2014-08-31 16:51:23 UTC
Permalink
On Sat, 30 Aug 2014 16:31:56 +0000 (UTC)
Post by Christos Zoulas
Post by y***@SDF.ORG
Note that the spare does not persist across the reboot.
How can I fix this?
I don't think that persistent spares are supported. Someone needs to
write some code. Greg should be able to provide some guidance.
Persistent spares are not currently supported. The easy workaround is
to add something like:

raidctl -a /dev/wd1a raid0

to /etc/rc.local . (Of course, you might want to do something a bit
more elaborate to make sure that /dev/wd1a is indeed the right device
at the time of adding it, but this would be the general idea.)

Later...

Greg Oster

Loading...