LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-27-2004, 09:04 AM   #1
mrodent2
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
understanding grub loader


hi,

I am experimenting with linux and dual booting on a computer which is not my main one... I decided to delete (i.e. reformat brutally, from within WXP) all the partitions containing linux ... just to see what would happen!

and of course it now turns out that I can't boot either linux or WXP... I just get taken to the grub loader and haven't got a clue what to do, or how to repair the situation. Indeed, I tried to get the WXP installation disks to repair the situation... surprise...! the grub loader still loads!!

none of this is tragic, as I say I am experimenting with a secondary machine... somehow my linux installation seemed to have taken up a bit too much HD space anyway so it had to be sorted out... how does it know which partitions it is allowed to use anyway...??? another mystery

but I'd also like to know how to change the boot order of the grub loader, assuming I eventually get back to a dual boot situation, so that by default it loads WXP... I couldn't work out how to do this... and yet you would have hoped the designers of linux might've anticipated that newbies would want to do this... hmmmm....

in short, in order to avoid quite a lot of future tears and rage and premature heart conditions I think I need to know a bit more about how the grub loader thingy works... any pointers?

thanks,
mike
 
Old 12-27-2004, 09:22 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,889

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Grub installs a small part of itself to the MBR (master boot record) at the beginning of the harddrive. If only xp were installed, it would do the same with it's bootloader.

Since you can'b boot from the xp install cd, I'd guess that your BIOS isn't set to poll the cd drive before the harddrive. You need to restart the computer and edit the bios to poll the cd before booting from HDD. If I remember correctly, you press the delete key while the computer is running the POST routines. There should be a message at the bottom of the screen telling you which key to press.

Once you get the Bios configured, use the xp install disk to boot, and boot into the xp version of command line mode. Then run 'fdisk /mbr', or maybe it's 'fdisk \mbr' to restore the mbr for xp to be bootable. Then re-install Linux.

Grub boots Linux and some other Unix compatibles natively. For xp, grub used the chainloader command to pass booting from grub to xp's bootloader.

Partitions are formatted for the OS that will be installed there. There are octal (?) codes which designate OS type. I don't remember what it for xp, but Linux swap is something like 0x82 and Linux is 0x83 (or something along those lines). That's how the detection and identification is done.

To change the boot order in grub, there are two ways to do it. In the /boot/grub directory, you will have either a grub.conf or menu.lst file. That's the one used by grub to setup the menu you see when grub starts up.

There is a line: default 0. That tells grub to boot the first OS in the list ad the default (grub numbers start at 0). So, if xp is second in the list, change to default 1, and xp is now the default.
Or, just cut and paste the parts of the list to put the OS you want as default as first in the list, and leave the default 0 as is.

Then, google up a copy of the Grub Manual, and read.
 
Old 12-27-2004, 09:28 AM   #3
mrodent2
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Original Poster
Rep: Reputation: 0
nice one, thanks very much!
 
Old 02-24-2005, 12:30 AM   #4
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,268

Rep: Reputation: Disabled
I have written stuff U won't find in any manual like the cdr and multifloppy way and other juicy stuff in my tutorial
 
  


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
Grub Loader MacaveliMC Ubuntu 5 09-29-2005 12:07 AM
Grub loader BorderPatrol Linux - General 6 12-12-2004 06:36 PM
grub loader derekandjac Linux - Newbie 2 02-26-2003 03:06 PM
GRUB loader tszhim Linux - General 4 02-09-2003 01:00 PM
Help! Grub Loader! djsktbrd Linux - Newbie 5 12-27-2002 01:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration