LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-07-2013, 04:44 AM   #1
jhooly
LQ Newbie
 
Registered: Apr 2013
Location: EU
Distribution: Mint is home, many distros for fun.
Posts: 2

Rep: Reputation: Disabled
how to tell GRUB2 which partition's grub.cfg to read?


i've been using various linux distros for about 18 months, still running on an old WinXP box. at the moment i have about a dozen linux variants installed on my main hard drive though XP is still there and i do need to keep it around for the time being. i think i'm still pretty n00b, don't actually know much, so i opted to post here in the Newbie forum.

the trouble i've encountered with my distro hopping is that it's always a gamble with GRUB when doing a new distro installation: some are well behaved and ask you if they can mess with GRUB, others not so much and they just go ahead and do it. in other words if you've had a nicely tweaked grub menu on one particular partition you might lose access to it because of a new install.

for instance, as part of my linux learning process, i have a well-hacked version of grub.cfg (please see below for more on this) sitting on one particular install partition, Mint 14 on /dev/sda10 as it happens and this is currently my main working installation.

of course i've been going about my distro hopping ways and tried Bodhi 2.3.0 the other day and sure enough, it stomped on GRUB and now the boot menu on it's partition -- sda12 -- is what i saw when my system rebooted. trouble is that boot menu includes the results of OS-prober and to make a long story short it sucks and i want to go back to using my tweaked and tailored boot menu from sda10. i know i'll have to hack in the menuentry for Bodhi in order to have access to it but that's old news for me at this point and i have no fears that i'll be able to manage it.

so, the question is: how do i tell GRUB to go to sda10 (Mint 14) for grub.cfg instead of sda12 (Bodhi 2.3.0)?

i should mention a few things:

(1) i know i can just copy the preferred grub.cfg over to sda12 -- already done it -- but that's not really the solution of choice because, as it happens, i'll probably dump Bodhi in a few weeks and so ... i'll still need to tell GRUB where to look blah blah blah.

(2) i know that hacking grub.cfg is not the "right" way to do things. truth is (a) it works for me now and (b) i'll learn how to do the custom menu stuff later. as i see it there is value in messing with grub.cfg because you learn a hell of a lot about what GRUB is up to, etc. that's why i say i'm doing this for the learning and i'll learn the right way later.

(3) i'm pretty familiar with the Boot Rescue boot disc and have used it a lot. unfortunately is seems to assume that you don't want to do what i want to do which is tell GRUB to go to a particular partition for the grub/boot menu files. when you start BR it already knows which partition GRUB redirects to and doesn't appear to offer you the opportunity to change that, afaik.

(4) i have trolled around through forums and man pages for the answer but all i find is a ton of other stuff that is all very interesting but it doesn't answer my immediate question. hence my immediate question, here.

any assistance much appreciated.
ty.

Last edited by jhooly; 04-07-2013 at 04:47 AM.
 
Old 04-07-2013, 05:07 AM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi

Have a look here
http://askubuntu.com/questions/14809...ult-boot-entry
sorry i,m not on linux at the moment but that should fix it
 
Old 04-07-2013, 05:08 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
If you install each distro in its own partition then how about installing the distro's boot manager into the partition boot sector and the partition's /boot directory rather than the disk's boot sector and a /boot partition -- and chainloading the partition boot loader from the disk's boot loader?

The advantages of this scheme are that each new distro doesn't add clutter to the disk's boot loader and is automatically discarded when you install another distro. You don't even have to change the disk's boot loader config -- it can continue to have an entry to chainload sda12 (or whatever).

I read somewhere that GRUB2 does not support being used as a partition boot loader but I ran it that way with Ubuntu 12.04 in the partition without a problem (except for feeling tainted by having Ubuntu installed ).

EDIT: that assumes the distro installation does allow installing its boot loader to its partition instead of the disk. Backups are prudent

Last edited by catkin; 04-07-2013 at 05:11 AM.
 
1 members found this post helpful.
Old 04-07-2013, 05:23 AM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,126
Blog Entries: 1

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Hi

I have done a blog on installing grub2 as a standalone it might help, It dosn,t require any OS to be installed to run,The only thing I cant get right is the chainload that catkin mentioned for distros on extended partition
 
1 members found this post helpful.
Old 04-07-2013, 05:38 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,833

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Quote:
Originally Posted by jhooly View Post
so, the question is: how do i tell GRUB to go to sda10 (Mint 14) for grub.cfg instead of sda12 (Bodhi 2.3.0)?
On Ubuntu-derived distros "update-grub" should work. So just boot into Mint, and run it.

Else see the doco for grub-mkconfig. Won't work for Fedora of course, but they always like to be non-conforming ...
 
1 members found this post helpful.
Old 04-07-2013, 06:22 AM   #6
jhooly
LQ Newbie
 
Registered: Apr 2013
Location: EU
Distribution: Mint is home, many distros for fun.
Posts: 2

Original Poster
Rep: Reputation: Disabled
lots to investigate! my thanks to all.
 
Old 04-07-2013, 11:13 AM   #7
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 172

Rep: Reputation: 25
The "--root-directory=/path" for the grub-install command can tell the bootloader where to look.
 
1 members found this post helpful.
  


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
[SOLVED] GRUB2 doesn't read the right grub.cfg TKH Linux - Software 2 07-31-2012 10:58 PM
grub.cfg file in grub2 sheine Linux - Software 2 01-22-2011 01:06 PM
GRUB2 doesn't recognize grub.cfg file dragos240 Linux From Scratch 3 07-27-2010 11:16 AM
[SOLVED] How does Grub2 find the grub.cfg file? LenW Linux - Software 8 03-15-2010 04:28 AM
Creating a Grub2 boot-cd with a (grub.cfg) menu ..my solution ssenuta Linux - General 3 02-04-2010 07:16 PM


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