Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I used the Disk Utility to create an encrypted volume on an external drive. When I click the Unlock Volume button in that program, it mounts the drive for me.

Now, I want to automate this process so that it will happen at boot-up.

When I run sudo cryptsetup luksUUID /dev/sdb1, I get this:
ca709269-1e3e-4e9e-9e08-7248f0e6c5a6

So, I create /etc/crypttab like this:
backup_drive UUID=ca709269-1e3e-4e9e-9e08-7248f0e6c5a6 none

And I added this line to /etc/fstab:
/dev/mapper/backup_drive /mnt/backup ext3 default 0 2

When I reboot, Ubuntu tells me that the device is not available to map, so I tell it to skip it. It appears that the /etc/crypttab is not getting run correctly.

How can I debug this?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

I think you need a fourth parameter there to specify the encryption type.

This is what my /etc/crypttab looks like:

home_crypt /dev/disk/by-uuid/6f13e221-69f0-4f0e-9082-e2e7b32fc1dd /mnt/Keys/home-data luks
swap_crypt /dev/sda3 /dev/urandom swap

The Crypttab manpage says that all four fields are mandatory.

To test your settings, you can use the following commands to start and stop the cryptdisks after you make your changes.

cryptdisks_start
cryptdisks_stop
share|improve this answer
    
Thanks, I misunderstood the man page. Also, I like the use of /dev/disk/by-uuid -- that's easy to understand. –  Jeremy Stein Oct 12 '10 at 23:45
    
Thanks for adding the note on how to test! –  Jeremy Stein Oct 23 '10 at 22:49
    
FYI for future travelers, the fourth parameter is no longer mandatory –  Freedom_Ben yesterday
add comment

The format for the /etc/crypttab file is:

encrypteddiskname UUID=xxxxxxxxxxxx /etc/keyfilename

To get the UUID of the disk you need to run: blkid /dev/sdb1

Do not use the blkid of the /dev/mapper/encrypteddiskname.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.