OpenBSD RAID1 (ESPEJADO DE DISCOS) durante la instalación
Setting up a mirror in OpenBSD is quite easy. Boot up the installer and go to shell mode.
Welcome to the OpenBSD/i386 5.5 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? s
By default, OpenBSD will only make a /dev entry for the first drive. This is assuming you have two drives: wd0 and wd1. Let's create the /dev entry for wd1 and set a disk layout.
# cd /dev
# sh MAKEDEV wd1
# dd if=/dev/zero of=/dev/wd0c bs=1m count=1
# dd if=/dev/zero of=/dev/wd1c bs=1m count=1
# fdisk -iy wd0
# fdisk -iy wd1
Next we create the partitions on the disks.
# disklabel -E wd0
Label editor (enter '?' for help at any prompt)
> a a
offset: [64]
size: [20964761]
FS type: [4.2BSD] RAID
We can do it once for wd0 and then just import that same configuration into wd1 - pretty cool!
# disklabel wd0 > bsdnowiscool
# disklabel -R wd1 bsdnowiscool
# rm bsdnowiscool
Create the mirror like so:
# bioctl -c 1 -l wd0a,wd1a softraid0
# exit
In my case, the newly-created pseudo-device was called sd0. Go through the installer as normal, but be sure to choose that device instead of the regular hard drives.
Available disks are: wd0 wd1 sd0.
Which one is the root disk? (or 'done') [wd0] sd0
Reboot and check the status of your array in the new system:
# bioctl sd0
Volume Status Size Device
softraid0 0 Online 2146656256 sd0 RAID1
0 Online 2146656256 0:0.0 noencl <wd0a>
1 Online 2146656256 0:1.0 noencl <wd1a>
Or just verify through dmesg.
# grep sd0 /var/run/dmesg.boot
sd0 at scsibus3 targ 1 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct fixed
sd0: 2047MB, 512 bytes/sector, 4192688 sectors
root on sd0a (fa6620cf9195850e.a) swap on sd0b dump on sd0b
That's it.