This above tutorial is not working anymore since ubuntu 11.10 and above uses lightdm instead gdm. I am posting this tutorial for Ubuntu 12.04 and for anyone who needs ubuntu + truecrypt + home folder encrypted.
My home folder is /home/ionut
My truecrypt drive is /home/drive
Start truecrypt and create your volume.
sudo apt-add-repository ppa:michael-astrapi/ppa && sudo apt-get update && sudo apt-get install truecrypt
I created my volume in /home. The name of my volume is drive. This is my path for drivecrypt volume: /home/drive.
Mount your new created volume
Copy all our data from your home profile, mine is /home/ionut to mnt/tmp
sudo mkdir /mnt/tmp
truecrypt /home/drive /mnt/tmp
Delete everything in your home folder
rsync -aHv /home/ionut/ /mnt/tmp
Then we need to create this script
Add these lines to your truecrypt.sh
sudo nano /usr/share/truecrypt.sh
Replace /home/drive and /home/ionut with your own volume and home directory paths.
if !(echo `mount` | grep -q "/home/ionut type")
truecrypt /home/drive /home/ionut
Don't forget to add permisions for your truecrypt.sh file
Now we edit lightdm.conf
chmod a+x /usr/share/truecrypt.sh
sudo nano /etc/lightdm/lightdm.conf
we add this line
If you want to disable guest account, as I did add also the following line to the lightdm.conf
So /etc/lightdm/lightdm.conf should look like this:
Restart and test.
Now if you did everything as above you should be asked for truecrypt password before logon screen. Feel free to correct me if I'm wrong.
Hope it helps.