Deprecated: Function set_magic_quotes_runtime() is deprecated in /var/www/batland/wb/framework/initialize.php on line 33 batland.de - Disk encryption

Disk encryption

The Problem:
I have encrypted my home partition on my macbook with cryptsetup and I wanted to start the crypt device on startup. But, unfortunately, that doesn't work, because, when cryptdisks starts and asks for a passphrase, I automatically get an keyboard reading error and the startup continues with the other scripts. So I needed to login on console after every boot up and start cryptdisks by hand which is annoying.

Therefore I wrote a small Perl/Tk program which asks me for my passphase and my (sudo) password after I have loged in with gdm so that my home partition can be mounted.

Setup:
Download the program: cryptstart.pl,copy it to /usr/bin/ and make it executable. Please don't forget that you maybe need to install perl/Tk if it hasn't been already installed. Next thing, we need to adjust the program to you computer. So change line 9 and 10 to your needs.
$name needs to be set to the name of the mapper device
$device needs to be set to the actual device
The next thing we need is a minimalistic bash script which first starts cryptstart.pl and then starts gnome. I have called it start_crypt_gnome and I have place it into /usr/bin:


#!/bin/sh

/usr/bin/cryptstart.pl

/usr/bin/gnome-session

Don't forget to make it executable,too!
Now edit your session script. Mine, for gnome, is located in /usr/share/xsessions and is called gnome.desktop. Find the line which looks like:
Exec=/usr/bin/gnome-session
and change it to
Exec=/usr/bin/start_crypt_gnome

No logout, change to a console umount /home and remove the mapper device with
cryptsetup remove home
After a new login you should be greeted with a small window which asks for your passphrase and password.

If you have any problem, feel free to email me:
mipsel (at) gmx (dot) net