On 2010-07-29, Jan Stary <h...@stare.cz> wrote:
> I have found myself replicating a tiny script that sets up crypto
> on most of my recent machines, either in rc.local directly or calling
> it from rc.local. Is this the right way to do it, or is there some
> support for it in rc(8) already that I missed?
>
>       Jan
>
>
> #!/bin/sh
>
> RAIDPART=/dev/sd0o
> CRYPTOFS=/dev/sd1a
> MOUNTDIR=/crypto
>
> bioctl softraid0 | grep CRYPTO                        \
>|| bioctl -v -c C -l $RAIDPART softraid0       \
> && fsck $CRYPTOFS                             \
> && mount -v -s -o rw,nodev,nosuid,noatime,softdep $CRYPTOFS $MOUNTDIR

The problem is that you can't be sure that the new device that softraid
attaches will be sd1. For example if you have a umass(4) connected when
you boot things will get mixed up.
Earlier today I thought about writing a script based on the
hw.sensors.softraid0.drive0 sysctl value which will tell you whether it
has been attached correctly and what device was attached.

Best regards,
Jona

-- 
Worse is better
    Richard P. Gabriel

Reply via email to