how to tell GRUB2 which partition's grub.cfg to read?
Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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
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