View Single Post
  #2   (View Single Post)  
Old 7th April 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Hello and welcome!
Quote:
Originally Posted by dogeoj View Post
It seems the first step to building the mirror is to disklabel the whole drives as RAID (not documented in disklabel manpage as far as I could see)...
Not directly, no. Guidance for the disklabel fstype is in the softraid(4) man page, where it describes the RAID fstype and its requirements for use as a softraid "chunk."

As for the disklabel program, there are two man pages, disklabel(8) and disklabel(5). The first describes the disklabel utility, but doesn't discuss individual fstypes. The latter discusses the on-disk and in-core disklabel and system calls for managing a disklabel programmatically. Neither man page discusses fstypes directly.

On our systems is the header file /usr/include/sys/disklabel.h, which lists all the valid DKTYPENAMES (in disklabel terminology, "fstypes"). But this doesn't necessarily help with use cases.
Quote:
...and then once the softraid device is setup, you disklabel the softraid device all over again with your individual slices. Is this right?
Yes. The use of bioctl(8) creates a virtual softraid disk drive. If you're using RAID 1 (mirroring) with real drives sd0 and sd1, after you've issued the bioctl() command, you'll have a new drive sd2. The virtual drive can then be partitioned with up to 15 separate disklabel partitions (a-b, d-p), etc.
Quote:
So then if a device fails you detach it and then attach a new one. But do you have to disklabel and set it to RAID before you attach, or does the attach do a bitwise copy of the remaining devices in the softraid device automagically.. or something else?
You must create a RAID disklabel partition on the new (or replacement) drive before rebuilding the mirror. See the -R operand of bioctl(8). If the RAID group is intended to be bootable, you would also need to run installboot(8) manually to reinstall boot blocks.
Quote:
After you configure a softraid device is it possible to read the individual drives separately?
No. The data is read and written through the virtual drive only.
Quote:
I'm kinda concerned, given the combination of my lack of UNIX prowess over the past twenty years and the terse doc, that a situation could arise where I can't get my data...which would be directly opposite to the reason I want to do this.
In the event you want to read one of these two mirrors from a "bare metal" system you would need to boot OpenBSD. The mirror can then be used in degraded mode.

If you're nervous, PRACTICE this. Use a pair of USB sticks, or play with it in a virtual machine. You should know how it works normally as well as when there is a loss of one of the drives, and how to recover from drive loss, BEFORE YOU PUT THIS INTO PRODUCTION.
Quote:
Yes, RAID mirror is my backup strategy. I am worried about disk failure, not about doing something dumb.
I'm sorry, you won't want to read this, but unfortunately, RAID mirroring is not a backup strategy. It's not even a backup. Ignoring human error, any application error may still destroy your data. On both mirrors at the same moment.
Quote:
If you have any comments or stories about softraid on recent OpenBSD versions please post your experiences!
I was a RAIDframe user before softraid() existed, and even had a "how to" for Root-on-RAIDframe published in the OpenBSD Journal. I've been a softraid() user since its inception, and I'm using it right now as I type this reply.

At one point in my career I was a business continuity and disaster recovery consultant for one of the world's largest infrastructure vendors. When it comes to RAID as a "backup strategy," I know of what I speak.

Last edited by jggimi; 7th April 2019 at 04:05 PM. Reason: added comment for installboot after rebuild, clarified single-mirror bare metal use
Reply With Quote