LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-09-2006, 02:56 PM   #1
robzane
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Rep: Reputation: 0
where grub is installed?


I would like to learn where the boot loader is installed (mbr or else), and what different solutions do when I must reinstall (format the partition of linux or windows) one of the OSes installed on my pc.

Thank you
 
Old 09-09-2006, 04:02 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
GRUB, like all boot loaders, uses the MBR to pass control to the actual loader software. In GRUB's case, the MBR part is called "Stage 1," and it reads the HD to find the location of "Stage 2" to which it then pases control. Windows XP does, essentially, the same thing, although control is passed to "ntloader" which is, I think, expected to be in the sector right after the MRB.

Anyhow, the point is that the loader is partially in the MBR, and partially not.

If you're reinstalling an OS, what you need to do depends on the OS installation. Most Linux distributions will not change the MBR unless you tell them to do so. Windows installations will, I think, almost always overwrite the MBR.

A simple solution if you need to reinstall, e.g., Windows XP is to copy the MBR into a file in the Windows root directory, and add it to the "boot.ini" file so you can run it when XP kills your MBR.

For example, here's what my XP "boot.ini" file looks like:
Code:
$ cat /mnt/WinXP/c/boot.ini
[boot loader]
timeout=5
default=C:\linux.bin
#default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP" /noexecute=optin /fastdetect
C:\linux.bin="Linux"
If you've got a floppy drive, or a USB drive, you can make either one GRUB bootable, and keep them around as a back-up boot drive so you can boot into Linux even after the HD MBR gets rewritten. Then you can use the GRUB command to re-install GRUB in the MBR.

Bottom line: there's several different ways to address the problem. Use the forum search tools to find one you like.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed But Won't get past GRUB dfego Slackware - Installation 11 07-04-2006 09:45 PM
GRUB is gone... After installed Windows... d_kote23 Linux - Newbie 9 08-27-2004 01:36 AM
Installed Fedora, which installed Grub - how to boot to Knoppix? squall14716 Linux - General 3 03-15-2004 03:11 PM
removing grub from a new pc with no other os installed berrioshernan Linux - General 4 12-02-2003 01:06 PM
GRUB has installed itself over Windows Gramphos Red Hat 3 09-25-2003 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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