|SOFTRAID(4)||Device Drivers Manual||SOFTRAID(4)|
softraid0 at root
scsibus* at softraid?
softraiddevice emulates a Host Bus Adapter (HBA) that provides RAID and other I/O related services. The
softraiddevice provides a scaffold to implement more complex I/O transformation disciplines. For example, one can tie chunks together into a mirroring discipline. There really is no limit on what type of discipline one can write as long as it fits the SCSI model.
softraid supports a number of
disciplines. A discipline is a collection of functions
that provides specific I/O functionality. This includes I/O path, bring-up,
failure recovery, and statistical information gathering. Essentially a
discipline is a lower level driver that provides the I/O transformation for
the softraid device.
A volume is a virtual disk device that is made up of a collection of chunks.
A chunk is a partition or storage area of fstype “RAID”. disklabel(8) is used to alter the fstype.
softraid supports the following
softraidsupports the use of more than two chunks in a RAID 1 setup.
Initialize the partition tables of all disks:
# fdisk -iy wd1 # fdisk -iy wd2 # fdisk -iy wd3
Now create RAID partitions on all disks:
# printf "a\n\n\n\nRAID\nw\nq\n\n" | disklabel -E wd1 # printf "a\n\n\n\nRAID\nw\nq\n\n" | disklabel -E wd2 # printf "a\n\n\n\nRAID\nw\nq\n\n" | disklabel -E wd3
Assemble the RAID volume:
# bioctl -c 1 -l /dev/wd1a,/dev/wd2a,/dev/wd3a softraid0
The console will show what device was added to the system:
scsibus0 at softraid0: 1 targets sd0 at scsibus0 targ 0 lun 0: <OPENBSD, SR RAID 1, 001> SCSI2 sd0: 1MB, 0 cyl, 255 head, 63 sec, 512 bytes/sec, 3714 sec total
It is good practice to wipe the front of the disk before using it:
# dd if=/dev/zero of=/dev/rsd0c bs=1m count=1
Initialize the partition table and create a filesystem on the new RAID volume:
# fdisk -iy sd0 # printf "a\n\n\n\n4.2BSD\nw\nq\n\n" | disklabel -E sd0 # newfs /dev/rsd0a
The RAID volume is now ready to be used as a normal disk device. See bioctl(8) for more information on configuration of RAID sets.
softraiddriver first appeared in OpenBSD 4.2.
The RAID 1 discipline does not initialize the mirror upon creation. This is by design because all sectors that are read are written first. There is no point in wasting a lot of time syncing random data.
The RAID 4 and 5 disciplines do not initialize the parity upon creation. This is due to the scrub functionality not being currently implemented.
Currently there is no automated mechanism to recover from failed disks.
There is no boot support at this time for any disciplines.
Sparc hardware needs to use fstype “4.2BSD” instead of “RAID”.
Certain RAID levels can protect against some data loss due to component failure. RAID is not a substitute for good backup practices.
|January 2, 2012||OpenBSD-5.1|