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 01-17-2014, 12:23 AM   #1
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 21
Use Windows' boot.ini to boot grub-pc.


My friend has a computer with a motherboard exactly like mine. So, I connected a third hard-drive, sdc, on which I installed Debian together with another minimal installation to contain and manage grub-pc. The latter's primary stage was installed to hdc's master boot record. The hard drive was formatted as a GPT drive. grub-pc installed successfully because I could boot Debian on my friend's computer.

The problem is I want Windows' bootloader to be called by the bios. The reason is because my friend wants to keep his Windows installation as intact as possible and because grub-pc may fail rendering his machine unbootable even to use Windows.

I read that one can use boot.ini by adding another line to it like the following:
C:\primary-stage.bin="GNU Linux". Primary-stage.bin is a copy of the boot sector of hdc.

My question is this: how would primary-stage.bin know which hard drive's sectors to load and execute when the disk containing these sectors is configured as the second hard drive?

ADDED LATER:
I found that editing C:\boot.ini by adding the line:
Code:
C:\grub_bootsector.bin="Boot GRUB"
doesn't work as I correctly suspected. The reason for this failure may be that the boot drive as seen by the BIOS was not the primary boot device.

The file C:\grub_bootsector.bin is a copy of the second hard-drive boot sector.

Last edited by edbarx; 01-17-2014 at 06:52 AM. Reason: The method does not work.
 
Old 01-17-2014, 05:55 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
You might check the site below which is about as detailed as I've seen to do what you want. You need to scroll down the page a little to get to the Linux part. This is for xp as vista, 7 and 8 no longer have a boot.ini file and use a different bootloader.
 
Old 01-17-2014, 06:53 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Any use (that I've seen) of adding the Linux boot sector record like that pre-dates gpt disks. I've never tried it using gpt.
It works (on MBR disks) if you install grub to the partition then copy the first sector of the partition - not the MBR.

Doesn't matter if it's the first disk or not, so long as the disk isn't moved after the setup command is run - that saves the enumerated disk id as well as partition number.
 
  


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
Kind souls: help getting Mandriva install 2 boot? edit boot.ini/grub /boot device or NoMoreReinstallMS Linux - Newbie 1 08-09-2006 04:34 AM
GRUB: How to boot WinXP (NTLDR, NTDETECT.COM & BOOT.INI) from boot partition (EXT2) ? Rayen16 Linux - Software 1 05-25-2006 12:09 PM
Using dual boot with boot.ini and grub? Darrell22 Programming 1 12-07-2004 05:26 PM
Boot Linux Suse using boot.ini from Windows XP theewolizer SUSE / openSUSE 10 10-21-2004 01:11 PM
grub.conf and boot.ini billygotee Linux - Newbie 2 11-26-2003 10:53 AM

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

All times are GMT -5. The time now is 07:52 AM.

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