LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-17-2010, 09:56 PM   #1
eventmobile
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
Copy grub boot loader from USB to file to use in Win7 bootloader


Hi,

my OS setup on my laptop is a bit complicated, but the answer to my question should be simple

Ive got Windows 7 (1 System partition and one big file partition) installed and then encrypted with truecrypt.
Now ive installed Debian 5.0 into the 30GB i left unused and instructed debian to install the grub bootloader onto an stick.

Logically i cant use grub to boot, since i need the truecrypt bootloader
(i know you can boot into an encrypted OS using grub, been there done that, just everytime you update truecrypt it automaticly rewrites your MBR, too much hassle to always install grub again).

So iam trying to use the Win7 Bootloader to boot into my debian if i feel like.

Now i just need to get the grub bootloader into a file that i can implement into the bootmanager of win7 using easybcd.

I copied the MBR of my USB stick using dd if=/dev/sdb of=bootrec.mbr bs=512 count=1, but when i try to boot this with the win7 bootloader it just print "grub" at the top of the page and nothing happens.

So i guess i either should copy more or less bytes of that usb stick, or do i need to copy it from /dev/sdb1?

Or is something else wrong in my approach?

Thx in advance
 
Old 11-17-2010, 10:14 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Wrong approach.

Install grub to the root/boot partition, then just point EasyBCD at that. Much easier.
 
Old 11-19-2010, 02:34 AM   #3
eventmobile
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Tried that, installed grub to the partition as well. Problem is, easybcd doesnt list the linux partition, i can only choose the ntfs partitions. I will try the grub2 neo smart auto loader, whatever that is doing. much more i cant do with easybcd.

only way would be to change the smart auto loader mbr file with some mbr i copied from the stick i guess
 
Old 11-19-2010, 03:30 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
What version of EasyBCD ?. I needed v2 Beta when I did it 6 or 8 months ago. It's now the supported release.
I didn't use grub2 though ...
 
Old 12-13-2010, 01:22 AM   #5
eventmobile
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 0
I think the problem is that my debian installation is in an extended partition. EasyBCD dont find it there.

Can i maybe make an ISO of that USB Stick and Boot this Iso file?

I managed to boot into grub4dos and tried to boot my debian with this menu.lst entry:
title Debian GNU/Linux, kernel 2.6.32-trunk-amd64
root (hd0,4)
kernel /boot/vmlinuz-2.6.32-trunk-amd64 root=/dev/sdb5 ro quiet
initrd /boot/initrd.img-2.6.32-trunk-amd64

But grub4dos just says partition table error...
 
Old 12-17-2010, 02:48 AM   #6
eventmobile
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 0
After i tried many difficult ways i found out the answer was right in front of my head.
The Truecrypt Bootloader allows to press "ESC", then scans for other bootable partitions.
After i installed grub into sdb5 this partition is bootable, so i dont need the Windows 7
Bootloader to find the sdb5 Debian partition, my Truecrypt Loader just starts into Debian
by pressing ESC.

If somebody else trying to multiboot encrypted Windows 7 with Debian Linux (or other distributions)
here is a short step by step guide:
(i just explain how to use the PC with Truecrypt installed in the mbr, you can also install grub
into the mbr and chainload the Rescue Iso, but this is more complicated and everytime you update
Truecrypt it will overwrite the mbr anyway without asking)


1. Install Windows 7 on the empty disc, I created a 30GB Windows partition and another one for
bigger files. Just be sure to leave enough unused space for the Linux system later.
Windows 7 will actually create one more 100mb partition for boot and rescure purposes, so this already gives you
3 partitions.

2. After Windows is installed you can encrypt the whole system with truecrypt, making all you windows
partitions only available when the truecrypt loader decrypts the drives.

3. Be sure you burned the rescue CD, and if you already have important data on your windows installation
make sure to back it up (using e.g. drive snapshot).

4. When Windows running fine encrypted you still have the unused space left, start up your linux installation (i installed debian 5,
not sure it can work the same way with other distributions).
The Partitioner should give you an example how to use the unused disk space. BE SURE it doesnt use the windows partitions in some
way (e.g. shrink them). If the partitioner gives you an unusable suggestion, create swap and root partition yourself (you should
now what you are doing).
When the grub installer asks you where to install grub. use an empty usb disk (your system should support booting from usb sticks)
and install grub onto the usb stick. Alternatively you can directly install the root partition (sdb5 for me), starting linux itself
first is more easy so, you can make sure by checking the partition table before etc.

5. Now you can boot windows normally again, and if you want to boot into linux you should use the usb stick.

6. Boot into Linux and install the grub bootloader into the root partition. (grub-install /dev/sdb5 *if its sdb5...)

7. Now you should be able boot windows by just typing in the encryption password, and if you want to boot linux press "ESC" when
the truecrypt loader is asking you for the password.

good luck
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub boot loader 'file not found - error 15' sirius57 SUSE / openSUSE 5 10-14-2010 10:13 AM
bootloader, dual-boot with Win7, and large drives? benav Linux - Newbie 10 08-20-2010 09:27 PM
Dual Boot linux/7 saving win7 loader? tetractis Linux - Newbie 5 07-22-2010 07:45 PM
boot usb via grub or bootloader? netsurf Linux - Hardware 5 06-28-2005 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration