On Friday 27 April 2018 11:17:07 Jordan Geoghegan wrote: > Thanks for the reply, I have rebuilt a softraid mirror before, I was > just hoping for some clarification as the faq wording is a little > ambiguous as to whether drives can be rebuilt in multi user mode or not.
Rebuild is a background kernel operation - you can initiate it in either single user or multi user mode. > I was also curious how the system handles write operations to the array > while it is rebuilding. Writes go to chunks that are in an online or rebuilding state, while reads only come from online chunks. Other than the overhead from the background I/O there is no reason you cannot operate as normal during a rebuild. > Similarly, is the reboot required for the newly repaired array to be > initialized/function? The need to shutdown/reboot is really only hardware dependent - if you have hotplugable devices then there is no need to reboot - you can however reboot half way through a rebuild and it will pick up where it left off (providing the chunks are available). > I have a simple production storage NAS I am setting up, and would > appreciate any input on softraid "best practices". As per some previous advice test - build the volume, pull a disk (or bioctl - O), rebuild, etc - make sure you know how it is going to work before you put data on it. > On 04/26/18 17:48, IL Ka wrote: > > Hello, > > > > No, you do not need to reboot. At least this is how it worked for me > > for raid 1: > > > > 1) bioctl softraid0 said raid degraded > > 2) I installed new disk (sd2). > > 3) kenrel reported on console that disk is detected > > 4) I created MBR using fdisk on it > > 5) I created disklabel with RAID type on it > > 6) bioctl -R /dev/sd2a sd0 > > > > I suggest you to try it yourself, but not on production system) > > > > > > > > On Fri, Apr 27, 2018 at 2:21 AM, Jordan Geoghegan > > > > <jgeoghega...@gmail.com <mailto:jgeoghega...@gmail.com>> wrote: > > Hello, > > > > Sorry for my ignorance, I was hoping someone could clarify for me > > the proper procedure for rebuilding a softraid mirror. The man > > > > page/faq says: > > Rebuilding a mirror > > > > When a drive failure happens, you will replace the failed > > drive, create the RAID and other disklabel partitions, then > > rebuild the mirror. Assuming your RAID volume is sd2 and you > > are replacing the failed device with sd1m, the following > > commands should work: > > > > #*bioctl -R /dev/sd1m sd2* > > #*reboot* > > > > These steps can be performed in either single user mode > > <https://www.openbsd.org/faq/faq8.html#LostPW > > <https://www.openbsd.org/faq/faq8.html#LostPW>> or from the > > install kernel <https://www.openbsd.org/faq/faq4.html#bsd.rd > > <https://www.openbsd.org/faq/faq4.html#bsd.rd>>. > > > > Does this mean that a RAID rebuild can *only* be performed from > > single user mode or install kernel, or is it possible to rebuild > > an array while the system is in full operation? > > > > To phrase my question a different way: > > Is it possible to hot swap drives and rebuild arrays on the fly, > > or will this bork my system? > > > > Thanks, > > Jordan Geoghegan