Before starting you may want to wipe your entire hard drive.
- dd if=/dev/urandom of=/dev/hda
BackTrack /boot partition (not encrypted)
BackTrack / partition encrypted
Install Windows XP first (200GB)
Boot off BackTrack4 cd. fdisk /dev/hda create a /boot partition (hda2) 200MB create a / partition (hda3) remainder of disk. Setup the encrypted partition.
- modprobe aes-i586
- cryptsetup luksFormat /dev/hda cryptsetup luksOpen /dev/hda3
- rootmkfs.ext3 –j –O extent /dev/mapper/root
Run the BT installer and select /dev/mapper/root to be mounted as / and /dev/hda2 as /boot. Make sure you check the format box for /dev/mapper/root
Do not reboot just yet we need to modify a few files.
- mkdir /mnt/root
- mount /dev/mapper/root /mnt/root
- mount /dev/hda2 /mnt/root/boot
- chroot /mnt/root
- mount –t proc proc /proc
- mount –t sysfs sys /sys
Next we need to edit the /etc/crypttab file. I'm going to keep the name root for / .
- root /dev/hda3 none luks
Next step is to edit /etc/fstab. The / should look like this. Amend if needed.
- /dev/mapper/root / ext3 relatime,errors=remount-ro 0 1 /dev/hda2 /boot ext3 defaults 0 0
Next step is to add a few modules to the kernel.
Edit /etc/initramfs-tools/modules file and add the following to the end of the file.
aes-i586
sha256
dm-mod dm-crypt
Update your initrd with the following command.
- update-initramfs –k all –c
Now time to fix grub.
- cd /boot/grub/ nano menu.lst
Your BackTrack section should look like this.
- title BackTrack 4
- uuid Your uuid of boot partition
- kernel /vmlinuz-2.6.29.4 root=/dev/mapper/root ro initrd /initrd.img-2.6.29.4 quiet
- grub-install /dev/hda
Using TrueCrypt I fully encrypted the windows system partition (not full disk encryption) through TrueCrypt 6.3 and let it write its bootloader to the MBR. This will overwrite GRUB.
Don't worry we'll fix this later.
Boot with BackTrack cd and copied the truecrypt bootloader from the MBR to a file in the /boot partition. In my case hda2
I used these commands to do so:
- dd if=/dev/hda of=/mnt/boot/truecrypt.mbr count=1 bs=512
- dd if=/dev/hda of=/mnt/boot/truecrypt.backup count=8 bs=32256
Reinstalled grub to the MBR using these commands:
- sudo grub
- install (hd0,1)/grub/stage1 (hd0) (hd0,1)/grub/stage2 0x8000 p
title XP
rootnoverify (hd0,0)
makeactive
chainloader (hd0,1)/truecrypt.mbr
boot