--- encrypt_hook 2011-07-21 13:49:36.141290894 +0200 +++ encrypt_hook 2011-07-21 13:49:44.217757502 +0200 @@ -58,7 +58,7 @@ run_hook () dopassphrase=1 # If keyfile exists, try to use that if [ -f ${ckeyfile} ]; then - if eval /sbin/cryptsetup --key-file ${ckeyfile} luksOpen ${cryptdev} ${cryptname} ${CSQUIET}; then + if eval /sbin/cryptsetup --key-file ${ckeyfile} luksOpen ${cryptdev} ${cryptname} --allow-discards ${CSQUIET}; then dopassphrase=0 else echo "Invalid keyfile. Reverting to passphrase." @@ -70,7 +70,7 @@ run_hook () echo "A password is required to access the ${cryptname} volume:" #loop until we get a real password - while ! eval /sbin/cryptsetup luksOpen ${cryptdev} ${cryptname} ${CSQUIET}; do + while ! eval /sbin/cryptsetup luksOpen ${cryptdev} ${cryptname} --allow-discards ${CSQUIET}; do sleep 2; done fi @@ -90,7 +90,7 @@ run_hook () err "Non-LUKS decryption not attempted..." return 1 fi - exe="/sbin/cryptsetup create ${cryptname} ${cryptdev}" + exe="/sbin/cryptsetup create ${cryptname} ${cryptdev} --allow-discards" tmp=$(echo "${crypto}" | cut -d: -f1) [ -n "${tmp}" ] && exe="${exe} --hash \"${tmp}\"" tmp=$(echo "${crypto}" | cut -d: -f2)