Skip to contentSkip to conversation

Booting TrueCrypt Windows Hard Drive

DISCUSSION Johannes Bauer 4 participants 9 messages Nov 13, 2009 – Nov 14, 2009

lore
Share & tools
lore
#0 lore raw

Dear list,

I've read a whole lot about problems booting Windows through Grub - but found no solution at all. By playing around with the options, I found a solution which *almost* works:

My main (Linux) drive is /dev/sda. / and /boot are on /sda1, i.e. (hd0,1). My crap (Windows) drive is /dev/sdb. There is only one partition /dev/sdb1. The whole drive has been encrypted with TrueCrypt.

I've copied the MBR of /dev/sdb to /boot/truecrypt.mbr. Then I used the following grub entry:

menuentry "Sigh" {
	insmod drivemap
	set root=(hd1,1)
	drivemap (hd0) (hd1)
	drivemap (hd1) (hd0)
	chainloader (hd0,1)/boot/truecrypt.mbr
	boot
}

This gets further than all other tutorials I've read before - it makes Truecrypt actually ask for my password. After I've entered it successfully, the Windows logo comes up and it appears to be booting. However, after about 20 seocnds, it just resets hard. The next time I boot Windows (7, BTW) that way, I get a message saying that it crashed during bootup and if I want to use some kind of boot rescue restore magic. When I say yes, a textmode progressbar comes up. When it reaches 100%, the computer again resets hard.

I have a feeling that I'm almost there but am missing something - can somebody please help me?

Kind regards,
Johannes

#1 lore raw
Quoted 3 lines · Johannes Bauer

I've read a whole lot about problems booting Windows through Grub - but found no solution at all. By playing around with the options, I found a solution which *almost* works:

[...] Using 1.97 - I forgot to mention that, sorry.

Kind regards,
Johannes

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Johannes Bauer
Quoted 3 lines · Johannes Bauer

I've read a whole lot about problems booting Windows through Grub - but found no solution at all. By playing around with the options, I found a solution which *almost* works:

[...] Using 1.97 - I forgot to mention that, sorry.

Kind regards,
Johannes

I suggest chainloading from bootmgr to Grub2, instead of the opposite.
You should give a try and it's not difficult to do.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr9muwACgkQBV7eXqefhqh38wCeLEwuoemAjn3771HDFqIa1Z4m SnQAnRf0ECsJqHWqCi3zE3UNxO/Dk/6d
=yu7F
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 2 lines · Duboucher Thomas

I suggest chainloading from bootmgr to Grub2, instead of the opposite.
You should give a try and it's not difficult to do.

Actually, I'd rather not. The reason for this is that the Linux hard drive is my productive drive and the Windows is only of secondary use and rather dispensable. At any point in time I want to be able to completely remove the Windows drive and have no impairment whatsoever to my productive environment.

Also, I've just seen far too many fuckups with the crappy Windows boot loader - I do not trust it at all. Thinking about booting my productive environment through that junk gives me shivers.

I guess I'll keep try fiddling around.

Kind regards,
Johannes

#4 lore raw
In reply to Johannes Bauer

Am Freitag, den 13.11.2009, 18:28 +0100 schrieb Johannes Bauer:

Quoted 31 lines

Dear list,

I've read a whole lot about problems booting Windows through Grub - but found no solution at all. By playing around with the options, I found a solution which *almost* works:

My main (Linux) drive is /dev/sda. / and /boot are on /sda1, i.e. (hd0,1). My crap (Windows) drive is /dev/sdb. There is only one partition /dev/sdb1. The whole drive has been encrypted with TrueCrypt.

I've copied the MBR of /dev/sdb to /boot/truecrypt.mbr. Then I used the following grub entry:

menuentry "Sigh" {
	insmod drivemap
	set root=(hd1,1)
	drivemap (hd0) (hd1)
	drivemap (hd1) (hd0)
	chainloader (hd0,1)/boot/truecrypt.mbr
	boot
}

This gets further than all other tutorials I've read before - it makes Truecrypt actually ask for my password. After I've entered it successfully, the Windows logo comes up and it appears to be booting. However, after about 20 seocnds, it just resets hard. The next time I boot Windows (7, BTW) that way, I get a message saying that it crashed during bootup and if I want to use some kind of boot rescue restore magic. When I say yes, a textmode progressbar comes up. When it reaches 100%, the computer again resets hard.

Quoted 5 lines

I have a feeling that I'm almost there but am missing something - can somebody please help me?

Kind regards,
Johannes

On launchpad someone made a bugreport where removing the search and drivemap commands from the generated Win 7 menu entry by os-prober breaks booting it.
So I removed drivemap command for Vista and 7.
It wouldn't make much sense if the search line would break it.

Did you try without drivemap?
You could also try to directly chainload MBR with (hd1)
Note that there's a difference if you use set root=(hd1,1) chainloader +1 or just chainloader (hd1,1)+1
So you could also play around a bit with them.
The root device gets into %dl register and so the bootcode can make use of that one.
If you specify the device inside chainloader command only GRUB itself knows that one.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
#5 lore raw
Quoted 5 lines · Felix Zielcke

On launchpad someone made a bugreport where removing the search and drivemap commands from the generated Win 7 menu entry by os-prober breaks booting it.
So I removed drivemap command for Vista and 7.
It wouldn't make much sense if the search line would break it.

Well, without the drivemap command, it doesn't boot up at all...

Quoted 1 line

Did you try without drivemap?

Yup. TrueCrypt immediately complains:

TrueCrypt Boot Loader
Loader Damaged! Use Rescue Disk: [blabla]

Quoted 1 line

You could also try to directly chainload MBR with (hd1)

Well, that's the same as "chainloader (hd0,1)/boot/truecrypt.mbr", isn't it? I tried it and they yielded the same result.

Quoted 2 lines

Note that there's a difference if you use set root=(hd1,1) chainloader +1 or just chainloader (hd1,1)+1

The "chainloader (hd1,1)+1" which was what I originally tried does not work at all since (hd1,1) is encrypted at that point and thus grub does not know recognize the file format and won't boot - forcing the chainload with "--force" causes the system to lock up at boot.

Quoted 5 lines

So you could also play around a bit with them.
The root device gets into %dl register and so the bootcode can make use of that one.
If you specify the device inside chainloader command only GRUB itself knows that one.

Note that when I change the boot order in the BIOS to make the Windows Disk the boot disk, the Windows boots up just fine. Is there any way which is more "convincing" than drivemap?

Kind regards,
Johannes

#6 lore raw
Quoted 9 lines · Johannes Bauer
Quoted 1 line

Did you try without drivemap?

Yup. TrueCrypt immediately complains:

TrueCrypt Boot Loader
Loader Damaged! Use Rescue Disk: [blabla]

There are 2 kind of booters:
Type (a) always try to boot from first disk. They need drivemap. Type (b) respect the disk passed in %dl and boot from it. Apparently truecrypt is of type (a) and win7 is of type (b) and is additionally incompatible with drivemap. I see 2 solutions:
1) Ask truecrypt to make their loader respect %dl and don't use drivemap
2) Find out why our drivemap isn't compatible with win7. I suspect we need to modify some more info about disks for it to work. I've heard that BIOS supplies mapping between its own drives and hardware drives. I guess we need to modify it, however don't know the details. Can you gather the documentation about this subject?

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
#7 lore raw
In reply to Johannes Bauer

Am Samstag, den 14.11.2009, 13:22 +0100 schrieb Johannes Bauer:

Quoted 14 lines
Quoted 5 lines · Felix Zielcke

On launchpad someone made a bugreport where removing the search and drivemap commands from the generated Win 7 menu entry by os-prober breaks booting it.
So I removed drivemap command for Vista and 7.
It wouldn't make much sense if the search line would break it.

Well, without the drivemap command, it doesn't boot up at all...

Quoted 1 line

Did you try without drivemap?

Yup. TrueCrypt immediately complains:

Quoted 7 lines

TrueCrypt Boot Loader
Loader Damaged! Use Rescue Disk: [blabla]

Quoted 1 line

You could also try to directly chainload MBR with (hd1)

Well, that's the same as "chainloader (hd0,1)/boot/truecrypt.mbr", isn't it? I tried it and they yielded the same result.

I meant with set root=(hd1) or set root=(hd0) and with/without drivemap. As I said there's a difference if you do set root=(hd1) chainloader (hd0)+1 or set root=(hd0) ; chainloader +1

Quoted 8 lines
Quoted 2 lines

Note that there's a difference if you use set root=(hd1,1) chainloader +1 or just chainloader (hd1,1)+1

The "chainloader (hd1,1)+1" which was what I originally tried does not work at all since (hd1,1) is encrypted at that point and thus grub does not know recognize the file format and won't boot - forcing the chainload with "--force" causes the system to lock up at boot.

MBR would be (hd1) or (hd0) not (hd1,1)

But maybe it's really like Vladimir thinks and Truecrypt loader and windows bootloader are different in this case.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
#8 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Felix Zielcke

MBR would be (hd1) or (hd0) not (hd1,1)

But maybe it's really like Vladimir thinks and Truecrypt loader and windows bootloader are different in this case.

If you have a 'pro' version of Windows Seven, you can give a try with Windows BitLocker.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr+tUsACgkQBV7eXqefhqj6aACfSbfDldbCXa//qS6olc4gai6P mqMAnjqRA+2mEh9icRjsU4dYrFNHgKa1
=lo04
-----END PGP SIGNATURE-----