Postup k vytvoření a případný rebuild software RAID 1 - mirror.
Create mirror RAID:
# cd /dev
# sh MAKEDEV sd1 sd2
MBR boot:
# fdisk -iy sd0
# fdisk -iy sd1
GPT UEFI boot:
# fdisk -iy -g -b 960 sd0
# fdisk -iy -g -b 960 sd1
Create the partition layout on the first device:
# disklabel -E wd0 Label editor (enter '?' for help at any prompt) wd0> a a offset: [64] size: [39825135] * FS type: [4.2BSD] RAID wd0> w wd0> q No label changes.
Copy the partition layout to the second device:
# disklabel wd0 > layout # disklabel -R wd1 layout # rm layout
Assemble the mirror with the bioctl(8) command:
# bioctl -c 1 -l wd0a,wd1a softraid0 scsibus1 at softraid0: 1 targets sd2 at scsibus2 targ 0 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct fixed sd2: 10244MB, 512 bytes/sec, 20980362 sec total
Check status of mirror:
# bioctl sd0
Rebuilding a mirror:
List known hard dirve:
# sysctl hw.disknames
...new device wd1
Create the partition layout on the new device:
# disklabel -E wd1
Label editor (enter '?' for help at any prompt)
sd0> a a
offset: [64]
size: [39825135] *
FS type: [4.2BSD] RAID
sd0> w
sd0> q
No label changes.
Rebuild RAID:
# bioctl -R /dev/wd1a sd0 (wd1a - new device, sd0 - func raid/device)
Check rebuild status of mirror:
# bioctl sd0