Subject: another RAIDframe oddity....
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 10/19/2003 13:44:54
Just while doing the final reconstruction of my new RAID-1 for root I
noticed the following message on the console:

	Warning: truncating spare disk /dev/sd1e to 17601280 blocks

This happened as I added the second component as a spare to replaced the
"failed" fake component with "raidctl -v -a /dev/sd1e raid2".

I'm assuming this is because the partition size is not an exact multiple
of the stripe-unit size, though I note it truncated 160 sectors whie the
sectPerSu is only 128 and there's only one row so I'm not quite sure why
it threw away a whole stripe-unit....

Both disks are identical models and have identical labels:

#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:    181737        63     4.2BSD   2048  8192    88   # (Cyl.    0*- 99)
 c:  17783177        63     unused      0     0         # (Cyl.    0*- 9781*)
 d:  17783240         0     unused      0     0         # (Cyl.    0 - 9781*)
 e:  17601440    181800       RAID                      # (Cyl.  100 - 9781*)

After adding the spare the array status was:

	# raidctl -v -s raid2           
	Components:
	           /dev/sd0e: optimal
	          component1: failed
	Spares:
	           /dev/sd1e: spare
	Component label for /dev/sd0e:
	   Row: 0, Column: 0, Num Rows: 1, Num Columns: 2
	   Version: 2, Serial Number: 11112222, Mod Counter: 1819045110
	   Clean: No, Status: 0
	   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
	   Queue size: 100, blocksize: 512, numBlocks: 17601280
	   RAID Level: 1
	   Autoconfig: Yes
	   Root partition: Yes
	   Last configured as: raid2
	component1 status is: failed.  Skipping label.
	/dev/sd1e status is: spare.  Skipping label.
	Parity status: DIRTY
	Reconstruction is 100% complete.
	Parity Re-write is 100% complete.
	Copyback is 100% complete.

After the reconstruction finishes the status is:

	# raidctl -v -s raid2            
	Components:
	           /dev/sd0e: optimal
	          component1: spared
	Spares:
	           /dev/sd1e: used_spare
	Component label for /dev/sd0e:
	   Row: 0, Column: 0, Num Rows: 1, Num Columns: 2
	   Version: 2, Serial Number: 11112222, Mod Counter: 1819045111
	   Clean: No, Status: 0
	   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
	   Queue size: 100, blocksize: 512, numBlocks: 17601280
	   RAID Level: 1
	   Autoconfig: Yes
	   Root partition: Yes
	   Last configured as: raid2
	component1 status is: spared.  Skipping label.
	Component label for /dev/sd1e:
	   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
	   Version: 2, Serial Number: 11112222, Mod Counter: 1819045111
	   Clean: No, Status: 0
	   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
	   Queue size: 100, blocksize: 512, numBlocks: 17601280
	   RAID Level: 1
	   Autoconfig: Yes
	   Root partition: Yes
	   Last configured as: raid2
	Parity status: clean
	Reconstruction is 100% complete.
	Parity Re-write is 100% complete.
	Copyback is 100% complete.


(I do note in this case the "Autoconfig" and "Root partition" values
have been properly propagated to the new component.  Perhaps the problem
with doing this in 1.5W for my old RAID-5 array has been fixed?)


BTW, is there any easy way to change the "Last configured as" value in
the component labels?  It would be more elegant to have my root disk
configure as "raid0".  I suppose I could boot single-user and
un-configure them all then re-configure them in the desired order?  In
the mean time though I'm going to leave well enough alone since it's all
hopefully working reliably at the moment.  :-)

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>