7 keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
8 mdconfig -a -t malloc -s `expr $sectors + 1` -u $no || exit 1
12 dd if=/dev/random of=${keyfile} bs=512 count=16 >/dev/null 2>&1
14 geli init -B none -P -K $keyfile md${no}
15 geli attach -p -k $keyfile md${no}
16 if [ -c /dev/md${no}.eli ]; then
21 # Be sure it doesn't detach before 'detach -l'.
22 dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null
24 if [ -c /dev/md${no}.eli ]; then
29 geli detach -l md${no}
30 if [ -c /dev/md${no}.eli ]; then
35 dd if=/dev/md${no}.eli of=/dev/null 2>/dev/null
37 if [ ! -c /dev/md${no}.eli ]; then