⬢ DragonFlyBSD Kernel Audit
DF-5063 / df5063_setup.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-5063 setup-only: drive + v0 (plex p0, sds s0,s1) + build the mknod tool.
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
set -x
kldload vinum
sleep 1
dd if=/dev/zero of=/tmp/disk.img bs=1m count=32
vnconfig -c vn0 /tmp/disk.img
dd if=/tmp/label.bin of=/dev/vn0 bs=512 seek=1 conv=notrunc
sleep 1
ls /dev/vn0s0a
printf 'drive d1 device /dev/vn0s0a\n' > /tmp/c1
printf 'volume v0\nplex name p0 org concat\nsd name s0 drive d1 len 2m\nsd name s1 drive d1 len 2m\n' > /tmp/c2
vinum create -f /tmp/c1
sleep 2
vinum create -f /tmp/c2
sleep 3
vinum start v0
sleep 2
vinum l | head -10
ls -l /dev/vinum/vol/v0 /dev/vinum/plex/p0 /dev/vinum/sd/s0 /dev/vinum/sd/s1
cc -O -o /tmp/mk /tmp/df5063_mknod.c && echo BUILD_OK
printf 'SD-S0-DATA' | dd of=/dev/vinum/sd/s0 bs=512 seek=0 conv=sync 2>/dev/null
echo SETUP_DONE