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 02-22-2006, 05:27 PM   #1
manicman
Member
 
Registered: Oct 2005
Location: England (Southampton)
Distribution: Ubuntu 6.06 , Gentoo
Posts: 62

Rep: Reputation: 15
Boot Partition useing Grub


Hello i am trying to make a boot partion for grub and im not having much luck. at the moment a have a small and empty ext2 partion (hdc2) which i wish to set up grub on and boot from. I installed grub to it useing this command
Code:
sudo grub-install --root-directory=/mnt/boot /dev/hdc2
and it installed it fine with out any errors but when i boot my computer it still loads from my old grub on hdc1 (which is where ubuntu is installed) how do i make it load hdc2 ive tried removeing my old grub set up and changeing the MBR both which have resulted in errors when i booted and i had to change it back could do with some help on this one thanks
 
Old 02-22-2006, 05:59 PM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.1
Posts: 1,469

Rep: Reputation: 46
are you sure you're not installing this in the first sector of the partition hdc2 rather than the mbr of hdc...

i've not au fait with the command you are using, but that would seem to be the symptom at least...
 
Old 02-22-2006, 06:10 PM   #3
manicman
Member
 
Registered: Oct 2005
Location: England (Southampton)
Distribution: Ubuntu 6.06 , Gentoo
Posts: 62

Original Poster
Rep: Reputation: 15
you may be right beacuse im really not that sure how to do this. if i have just installed this in the first sector of hdc2 how do i go about makeing it boot grub on hdc2 ?
 
Old 02-22-2006, 10:05 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
During boot-up, the bios will look for boot code in any of several places--floppy, CD, 1st sector of the first HD. In the HD case, if grub is anywhere except 1st sector of 1st drive (aka the mbr), then **something** needs to be there to point to grub.
What is your end goal?
Why not put grub in the mbr?
 
Old 02-23-2006, 05:54 AM   #5
manicman
Member
 
Registered: Oct 2005
Location: England (Southampton)
Distribution: Ubuntu 6.06 , Gentoo
Posts: 62

Original Poster
Rep: Reputation: 15
Hi pixellany
My end goal is to have my computer boot from hdc2 partion where grub is installed. But this was before you mentioned the MBR i thought that the MBR just pointed to your boot loacation and it didn't have enough memory to install something like grub on it but if thats possible its a much better idea
 
Old 02-23-2006, 06:13 AM   #6
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.1
Posts: 1,469

Rep: Reputation: 46
take a look at this:

http://en.wikipedia.org/wiki/MBR

so the config for your boot sequence can exist on /dev/hdc2 but there can only be one mbr.

however, you can use an mbr boot loader to boot into the 1st sector or a parition. and have another boot loader tehre.

so you could have lilo in your mbr on disk 1. that has a boot option to go to the 1st sector of hdc2. then that has grub.... just as an example.

however it's far eaiser to configure the boot loader in your mbr (of the 1st boot device in your bios) to boot all the partitions you want to boot.
 
Old 02-23-2006, 10:05 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by manicman
Hi pixellany
My end goal is to have my computer boot from hdc2 partion where grub is installed. But this was before you mentioned the MBR i thought that the MBR just pointed to your boot loacation and it didn't have enough memory to install something like grub on it but if thats possible its a much better idea
To be more precise:
A typical situation, but not the only answer
GRUB stage1 in the mbr (or a floppy)
Stage1.5 and and Stage2 in the /boot/grub directory /boot CAN be a separate partition but does not need to.

The GRUB manual will make all this a bit clearer. Also, find any post by Saikee and look at the links in hsi sig.
 
Old 02-23-2006, 10:55 AM   #8
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
A /boot partition like the one you want to use to boot your computer works/is used like this:
-when you install grub the files (stage files, device.map, grub.conf/menu.lst...) are put into /boot/grub/ directory
-a boot record is written to the location you give with this command - in your case this was /dev/hdc2

A /boot partition is useful when you want to boot more than one system easily because you have everything in one place.
With /boot/grub/grub.conf you only have one configuratin file to manage and change and all the kernels for your different OS are also kept there (not neccesarily - but if you don't put everything there it does not make much sense to have a /boot partition)

What you have done: you installed grub to /dev/hdc2
You cannot boot off this partition directly - but only from MBR - as pixellany said
You would need to modify your original grub configuration to include an entry to boot / chainload your grub on /dev/hdc2
This is most certailly not what you wanted.

What you should do:
install grub to the MBR of the device you are booting from - not to a partition on that device.
If you boot off /dev/hdc the command would have been: sudo grub-install /dev/hdc
this is because:
you only need to give the --root-directory if it is NOT where it is per default - which is /boot
(your command installed grub to /boot/boot/grub) !!! /boot (dev/hdc2) needs to be mounted during this !!!

/dev/hdc is the MBR of the whole device - which can be used to boot from (set your Bios to boot from this device)
Normally a system is booted from the first harddisk though...
To actually use this one /boot partition to boot different operating-systems you would copy their kernels to this partition.

You could save all the hassle and use the grub installation you already have - just add an entry to this config-file and off you go.

The advantage of one /boot shared by all systems will be gone then but it would still work - the advantage being:
if you should decide to delete one system you would still have /boot and be able to use the others without any more trouble setting things up
 
Old 02-23-2006, 12:14 PM   #9
manicman
Member
 
Registered: Oct 2005
Location: England (Southampton)
Distribution: Ubuntu 6.06 , Gentoo
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks everyone ive got it working now and i have i boot partion which is working great im now going to make use of this and try out some diffrent distros thanks for all your help
 
Old 05-18-2006, 05:21 PM   #10
enrico_dvchp
Member
 
Registered: Aug 2005
Location: firenze
Distribution: ubuntu
Posts: 106

Rep: Reputation: 15
Installing Grub in the MBR

Hi all,
in my old computer I finally installed Grub in the mbr via Yast (Linux SuSE 9.3), in a dual boot system. But that caused me serious problems once i had to uninstall Linux. I lost both linux and Windows 2000. I'm new to Linux, but I think a better way to have a dualboot windows-linux system is to create a boot partition other than the mbr.
Doesn't true?
Enrico
 
  


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/Dual boot - Windows partition restored via dd won't boot pazzport Ubuntu 1 01-06-2006 02:29 PM
make grub boot from other partition --> only once bglnelissen Linux - Software 2 12-06-2004 07:18 PM
Help with Grub in MBR and /boot partition! zLinuxz Linux - General 11 11-17-2003 12:42 PM
How to boot into linux 8 useing Grub Trillseker General 1 06-19-2003 07:32 PM
GRUB using /boot partition for multiple Linux/Windows boot? cpv204 Linux - Newbie 7 04-01-2003 04:54 PM


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