LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-04-2004, 11:00 AM   #1
Garrett_80
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Rep: Reputation: 0
Install boot loader in ROOT partition problem


Hello everyone,

I'm a little bit confused with this whole "dual-booting story" and i would really appreciate your help.
First of all, i don't want to install the boot loader on MBR. So i decided to load it on the root
partition of Linux. I'm using Mandrake 10.1 and i have one partition for Windows and 3 for linux ( /, /home, /swap).
Just after i installed the boot loader on the root partition i rebooted and there it was the GRUB console. No menus, no OS to boot, no nothing.

Well OK, i knew that there would be no menus. But i expected too that the MBR would have stayed intact and Windows would load without problem and without being aware of the linux presence. What is really happening underneath;
Did the boot loader mess with the MBR or not; What is really happenning ;

Please enlighten me
 
Old 12-04-2004, 02:03 PM   #2
triet
Member
 
Registered: Apr 2003
Distribution: Fedora Core 4
Posts: 34

Rep: Reputation: 15
Sounds like Grub was actually installed on the MBR although you didn't intend to. You might as well make the best of the situation and use it.

Try this at the grub console to boot Windows:

root (hd0,0)
makeactive
chainloader +1
boot

To boot linux:

root (<your_linux_partition>)
kernel /boot/vmlinuz
boot

If that worked for both OS's, you can configure grub.conf to have a boot menu. Post back if you need help doing that.

Good luck.
 
Old 12-04-2004, 02:25 PM   #3
Garrett_80
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for your answer!!

I'm not sure if you can write all these commands in the GRUB console environment.
I'm talking about the "GRUB>" prompt where you press TAB for the list of available commands.
Anyway, i've fixed the MBR using the "fixmbr" from the Windows XP recovery console.

My main QUESTION is the following :
Was this the proper behaviour and why???
I installed the boot loader (whichever that was) in the first sector of the ROOT partition and yet the MBR got messed up. That's what i think cause, windows wouldn't boot any more. I expected Windows to load without a problem...

Quote:
Originally posted by triet
Sounds like Grub was actually installed on the MBR although you didn't intend to. You might as well make the best of the situation and use it.

Try this at the grub console to boot Windows:

root (hd0,0)
makeactive
chainloader +1
boot

To boot linux:

root (<your_linux_partition>)
kernel /boot/vmlinuz
boot

If that worked for both OS's, you can configure grub.conf to have a boot menu. Post back if you need help doing that.

Good luck.
 
Old 12-04-2004, 02:41 PM   #4
triet
Member
 
Registered: Apr 2003
Distribution: Fedora Core 4
Posts: 34

Rep: Reputation: 15
Each of those lines is a separate command actually.

To answer your question: No, it's not normal behaviour. If you didn't set Mandrake installation to install Grub on MBR then it should have left it alone. That's what i do on my system. I leave the MBR in the hand of Windows. I configure Windows boot loader to load up Grub which i put somewhere else and configured to load up all my Linux distros.
 
Old 12-04-2004, 02:51 PM   #5
Garrett_80
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Yes, you are right about the commands. My mistake

That's what i want to do. Leave the MBR for windows to handle
I would be grateful if you could give me more info on that.
Where do you place the boot loader??
I've read a tutorial about creating a "linux.bin" for example using the "dd" command in order to place it in C:\ and let windows thereafter handle the boot process. I assume that you do something similar.
Is a /boot partition needed or not?

Thanks again triet for your answers
 
Old 12-04-2004, 03:21 PM   #6
triet
Member
 
Registered: Apr 2003
Distribution: Fedora Core 4
Posts: 34

Rep: Reputation: 15
You're welcome.

Yes, that's what i did: using dd to write the Grub boot sector to a linux.bin file then making an entry in boot.ini to load it up.

On newer systems, you don't really need a separate /boot partition. The only 2 required partitions are swap and root (/). On older systems, if your root partition is beyond the first 1024 cylinders (~8.5 GB) of the hard drive then you need a separate /boot partition located within the first 1024 cylinders. Old BIOS can't boot a partition beyond the first 1024 cylinders that's why.

Did you keep your linux partitions? What's the layout of your partitions (primary? extended? logical?)?
 
Old 12-04-2004, 03:39 PM   #7
Garrett_80
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Original Poster
Rep: Reputation: 0
I am aware of the 1024 cylinder limit but i didn't know that because this limit is broken the /boot partition is obsolete. Nice to know that

First of all i'm using a SATA drive. There are two partitions dedicated to Windows.
One primary which hosts the Windows installation and one extended which hosts 4 logical partitions in the following order. The one is NTFS and the other three are for Linux ( /, /home, /swap). I'm not sure if it matters (i think not) but both C:\ and D:\ are NTFS formatted.
I know that i may encounter problems in the future and that i can't write on NTFS from within Linux. Anyway suppose that i convert them to FAT32 to make my life easier....
 
Old 12-04-2004, 07:42 PM   #8
Garrett_80
LQ Newbie
 
Registered: Nov 2004
Posts: 8

Original Poster
Rep: Reputation: 0
I've done my research in the web and i've come with 2 possible explanations. Please, correct me if i'm wrong.
1) I've installed the bootloader on logical partition which isn't bootable.
2) I have to make active the ROOT partition.

What do you think????
 
Old 12-05-2004, 05:20 AM   #9
triet
Member
 
Registered: Apr 2003
Distribution: Fedora Core 4
Posts: 34

Rep: Reputation: 15
I'm afraid those two are not the right reasons. Grub is easy. It can boot up any partition and it doesn't have to be active. Based on your descriptions, this is your layout:

/dev/hda
/dev/hda1
/dev/hda2
/dev/hda5 (NTFS)
/dev/hda6 (/)
/dev/hda7 (/home)
/dev/hda8 (swap)

You might want to consider adding a FAT32 partition somewhere to share files between the 2 OS's.

You want to install Grub at the start of the root (/) partition which is /dev/hda6. Exactly step by step how to do it is a bit different depends on the distro. I use Fedora Core 3 so i don't know how it goes in Mandrake, but here are the general steps:

1. You need to boot into linux. Insert your Mandrake CD and boot from it. When you are prompted for boot options, type:

linux rescue

This'll take you to rescue mode. The menu here offers several options. Select the one that takes you to the console.

2. From the command line, install grub to /dev/hda6 by:

# grub-install /dev/hda6

3. Write the boot sector into a linux.bin file:

# dd if=/dev/hda6 of=linux.bin bs=512 count=1

4. Insert a floppy. Copy linux.bin to the floppy:

# mount /dev/fd0 /mnt/floppy (or mount it to wherever of your choice)
# cp linux.bin /mnt/floppy/

5. Boot into Windows. Copy linux.bin from the floppy to your C:\. Add the 2 blue lines to your C:\boot.ini file (careful with this file. A typo could prevent you from boot up your Windows. So have your Windows CD ready for a rescue):

[boot loader]
timeout=-1
default=c:\linux.bin
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn
c:\linux.bin="Linux"

6. Now try rebooting and you should be presented with a menu with options to boot to Windows or "Linux." Selecting Linux would activate Grub. Since you already installed Grub before, menu.lst should have been configured for you already. You should see a linux boot menu. If that's not the case and you're thrown to grub command line, do this to boot linux:

root (hd0,5)
kernel /boot/vmlinuz
boot

After getting into Linux, configure a menu.lst for a boot menu so you won't have to type those commands everytime.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to re-Install the Boot Loader systemhackerz SUSE / openSUSE 7 08-20-2009 07:39 AM
Need to install a boot loader pruhnke Linux - Software 3 08-24-2005 12:26 PM
RH9 install didnt install boot loader! justin9 Linux - Newbie 5 08-07-2003 04:43 PM
WinXP Pro,Win98SE,RedhatProV8.0(boot loader, partition) Michael Cool Linux - General 1 05-06-2003 02:50 PM
Where to install the boot loader? Fernandoch Linux - Software 4 03-29-2002 11:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:26 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