Edit detail for softraid revision 13 of 13

1 2 3 4 5 6 7 8 9 10 11 12 13
Editor: rgouveia
Time: 2012/08/21 16:38:48 GMT+2
Note:

changed:
-# one partition encrypted
-# first make a RAID type partition on the disk
-$ disklabel -E sd2
-  g:        398459605                0    RAID
-
-# then let's do the actual part to get crypto
-# softraid will get you a new disk on the system, sd3
-$ bioctl -c C -l /dev/sd2g softraid0
-
-# so now we configure it as a normal partition
-$ disklabel -E sd3
-$ newfs /dev/rsd3a
-$ mount /dev/rsd3a /encrypt_partition
https://bh.cosmico.net/2012/08/encrypted-partition-on-openbsd

https://bh.cosmico.net/2012/08/encrypted-partition-on-openbsd




# make two partitions on two disks, type RAID
disklabel -E sd0
disklabel -E sd1
# will result on this
  h:        398460195         79762725    RAID

# now make a softraid device with RAID 1 (mirror)
bioctl -c 1 -l /dev/sd0h,/dev/sd1h softraid0
# will get you this
sd2 at scsibus3 targ 0 lun 0: <OPENBSD, SR RAID 1, 004> SCSI2 0/direct fixed
sd2: 194560MB, 512 bytes/sec, 398459605 sec total

# using this new device, define a RAID partition too
disklabel -E sd2
# will result on this
  a:        398459605                0    RAID

# another softraid device now with cryto on top of RAID 1 (will ask for passphrase)
bioctl -c C -l /dev/sd2a softraid0
# finally you have your device
sd3 at scsibus4 targ 0 lun 0: <OPENBSD, SR CRYPTO, 004> SCSI2 0/direct fixed
sd3: 194560MB, 512 bytes/sec, 398459078 sec total

# make a normal partition on it (sd3) with disklabel
disklabel -E sd3
# will result on this:
  a:        398459078                0  4.2BSD   4096 32768    1
# newfs it as usual and mount it
newfs /dev/rsd3a 
mount /dev/sd3a/ /crypto


# next boot bring up the crypto volume (will ask for passphrase)
bioctl -c C -l /dev/sd2a softraid0
# mount it as usual
mount /dev/sd3a/ /crypto


# softraid status
bioctl softraid0
Volume  Status               Size Device
softraid0 0 Online      204011317248 sd2     RAID1
      0 Online       204011349504 0:0.0   noencl <sd0h>
      1 Online      204011349504 0:1.0   noencl <sd1h>

# rebuild drive 1 (sd1h) from the sd2 softraid volume
bioctl -R /dev/sd1h sd2