Notes on chainloading TrueCrypt from GRUB2 (install GRUB2 on primary partition)

by jmones

This just a short post to give some more information on installing a dual boot configuration (Windows and Linux) that uses TrueCrypt to encrypt Windows and GRUB 2 as a bootloader for Linux (as does Ubuntu).

Precedents are here:

  1. Perfect dual boot crypted hard disk setup with Truecrypt and LUKS by Mikko Ohtamma for GRUB version 1 configurations.
  2. Ubuntu forum post: How to chain GRUB for Ubuntu from Truecrypt & its bootloader (multiboot alongside XP) for GRUB version 2 configurations.

In my case, I had a dual boot configuration: Windows XP and Ubuntu 10.4 using GRUB 2. I wanted to encrypt all Windows drive using TrueCrypt. After having followed instructions from the second link, I had a system which had TrueCrypt bootloader in MBR. When introducing the passphrase it booted Windows correctly.

If, instead of entering a passphrase, ESC is pressed, TrueCrypt boots from next bootable partition. TrueCrypt bootloader finds it by searching a partition which has a bootloader installed or, for Windows partitions, since they have a bootloader installed in all partitions, checking also if the active flag is on.

In my setup, GRUB2 was installed in an extended partition (/dev/sda6) and TrueCrypt bootloader reported:

Error: No bootable partition found

So TrueCrypt wasn’t able to find GRUB2 at /dev/sda6. To solve this problem I converted the logical partition to a primary partition by editing the partition table using fdisk (I don’t intend to explain how to do this, but the procedure is removing extended partition and adding primary partitions with exactly the same start and end sector numbers of former logical partitions).

I’m not 100% sure that converting logical partitions to primary partitions will work to anyone facing this problem, but it worked for me. Since I didn’t find any resources on the Internet on how TrueCrypt bootloader finds next bootloaders, I’ve decided to post this note in the hope it is useful to somebody. No warranties.

References

Ohtamma, Mikko (2008), Perfect dual boot crypted hard disk setup with Truecrypt and LUKS by Mikko Ohtamma, mFabrik – web and mobile development.
Ubuntu Forum (2010), How to chain GRUB for Ubuntu from Truecrypt & its bootloader (multiboot alongside XP).