#!/bin/sh # Generate a crypttab file for all the devices that are # present on the system. This is a total hack since the # rd.luks.key=/secret.key should be sufficient. keyfile=/secret.key for dev in /dev/sd*; do uuid=`cryptsetup luksUUID "$dev" 2>/dev/null` || continue echo "luks-$uuid /dev/disk/by-uuid/$uuid $keyfile luks" done