title: How to load LUKS passphrase from USB, falling back to keyboard?
body: <p>I want to set up a headless Linux (Debian Wheezy) PC with whole disk encryption, with the ability to unlock the disk either with a USB drive, or by entering a passphrase by keyboard.  My starting point is a fresh install using the basic whole disk encryption option in the Debian Installer, which manages everything besides /boot as a LUKS-encrypted logical volume group and gives me the keyboard option.  I will describe my current solution in an answer, in hopes that it will be useful and that others can improve on it.</p>
  
  <p>Here are some of the issues I had:</p>
  
  <ul>
  <li><p>Setting up a passphrase and putting it on the USB drive.</p></li>
  <li><p>Loading the USB modules in time.</p></li>
  <li><p>Waiting for the USB drive to recognized by Linux before trying to read from it.</p></li>
  <li><p>Identifying the correct USB drive (not some other drive that happens to be inserted).</p></li>
  <li><p>Writing a "keyscript" to pull a passphrase off the USB drive.</p></li>
  <li><p>Ensuring that the fall-back to keyboard kicks in in all USB failure cases.</p></li>
  </ul>
  
  <p>I will accept an answer with significant improvements and upvote answers that offer contributions.</p>