Make cryptsetup ask the same password only once at boot

initramfs-tools-cryptroot-as-password-onceluks-logoI bought a new hard drive. Because I protect all my harddisk with encryption, I setup LUKS for new harddrive too. But init scripts ask password for every encrypted partition and I want enter my harddisk password only once. I have started with googling but I wasn’t succesfull. I have found this thread about the same problem. But author didn’t provide patch and uploaded *.tar.gz archive is no longer available.Write my own patch for Debian init scripts was the only way. It was very easy task and here is the patch. You can check also my git repository and the commit 3b733b5cfe .

The fastest way to patch your scripts is to run the following command:

wget -O - \
  https://blog.hostname.sk/wp-content/uploads/2014/09/initramfs-tools-cryptroot-as-password-once.patch \
  | patch -p0 \
  && update-initramfs -k all -u

Hoping it is usefull for you and saves you a lot of time.