]>
Raphaƫl G. Git Repositories - distgen/blob - lib/device.sh
1957287df014d66560349bf4012640f12bc0c8e7
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 then fake mbr compat one
9 cat << EOF | fdisk ${i}
83 # Add it with partition scan
88 mdadm
--create /dev
/md
/${MDBOOT} --level=1 --metadata=0.90 --homehost=${NETHOSTNAME} --name=${MDBOOT} --assume-clean --raid-devices=2 ${LOOPA}p1
${LOOPB}p1
89 mdadm
--create /dev
/md
/${MDSLASH} --level=1 --metadata=default
--homehost=${NETHOSTNAME} --name=${MDSLASH} --assume-clean --raid-devices=2 ${LOOPA}p2
${LOOPB}p2
90 mdadm
--create /dev
/md
/${MDDATA} --level=1 --metadata=default
--homehost=${NETHOSTNAME} --name=${MDDATA} --assume-clean --raid-devices=2 ${LOOPA}p4
${LOOPB}p4
92 # Create slash luks partition
93 #XXX: low iter time, should need around 100000 minimum
94 echo -n $LUKSPASSWORD | cryptsetup
-c aes
-xts-plain64 -h sha512
-s 512 --iter-time 2000 --use-urandom --uuid ${LUKSSLASHUUID} -d - --batch-mode luksFormat
/dev
/md
/${MDSLASH}
97 echo -n $LUKSPASSWORD | cryptsetup
-d - --batch-mode luksOpen
/dev
/md
/${MDSLASH} ${SLASHNAME}
99 # Create data luks partition
100 #XXX: low iter time, should need around 100000 minimum
101 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}
103 # Open luks partition
104 echo -n $LUKSPASSWORD | cryptsetup
-d - --batch-mode luksOpen
/dev
/md
/${MDDATA} ${DATANAME}