]>
Raphaƫl G. Git Repositories - distgen/blob - lib/device.sh
4 for i
in ${SDA} ${SDB}; do
5 # Create empty file of 8GB
6 dd if=/dev
/zero of
=${i} bs
=$((8192*1024)) count
=1024
7 # Create partition table
8 #XXX: we generate gpt table
9 cat << EOF | gdisk ${i}
35 # Add it with partition scan
40 #XXX: grub2 support standard linux raid1 device
41 #mdadm --create /dev/md/${MDBOOT} --level=1 --metadata=0.90 --homehost=${NETHOSTNAME} --name=${MDBOOT} --assume-clean --raid-devices=2 ${LOOPA}p2 ${LOOPB}p2
42 mdadm
--create /dev
/md
/${MDBOOT} --level=1 --metadata=default
--homehost=${NETHOSTNAME} --name=${MDBOOT} --assume-clean --raid-devices=2 ${LOOPA}p2
${LOOPB}p2
43 mdadm
--create /dev
/md
/${MDDATA} --level=1 --metadata=default
--homehost=${NETHOSTNAME} --name=${MDDATA} --assume-clean --raid-devices=2 ${LOOPA}p4
${LOOPB}p4
45 # Create slash luks partition
46 #XXX: low iter time, should need around 100000 minimum
47 echo -n $LUKSPASSWORD | cryptsetup
-c aes
-xts-plain64 -h sha512
-s 512 --iter-time 2000 --use-urandom --uuid ${LUKSDATAUUID} -d - --batch-mode luksFormat
/dev
/md
/${MDDATA}
50 echo -n $LUKSPASSWORD | cryptsetup
-d - --batch-mode luksOpen
/dev
/md
/${MDDATA} ${DATANAME}