Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a vague memory of reading about this, but I can't find it.
When GRUB is installed to--eg--the MBR, how is it configured to look at the correct disk/partition for its config file, etc.? By implication, it sets some code based on the location from where it was installed.
As just one example, if you were trying to rescue an existing install, I assume you could not install GRUB from a live CD and expect it to work with the existing setup.
Distribution: elive,sidux,xp,pclinuxos super gamer, mandriva 2007
Posts: 417
Rep:
Heres the long answer http://www.gnu.org/software/grub/manual/grub.html , short answer is if you were to re-install grub in the same position as the original ie grub-install /dev/hda and the /boot/grub/menu.lst still exists, grub will boot up again as before.
Makes perfect sense...
Ergo, if I dump out the GRUB code on the mbr, there will be some bytes that are unique to the installation. Anyone know the details of where this is found?
I've installed grub from one distro, then used the same instillation of grub, and physically copied a new distro the the root partition (in this case it was (hd0,3) and rewrote the /boot/grub/menu.lst and it worked fine.
It's really the location of the menu.lst file that's important, and grub just needs to know where it is, which, as stated above, can be fixed with a simple command.
It's really the location of the menu.lst file that's important, and grub just needs to know where it is, which, as stated above, can be fixed with a simple command.
I know this is a bit esoteric, but the question is HOW grub knows where menu.lst is. there's no config file with that info---ergo it must be actually embedded in the mbr code.
I know this is a bit esoteric, but the question is HOW grub knows where menu.lst is. there's no config file with that info---ergo it must be actually embedded in the mbr code.
It is not in MBR code, it's in stage 1.5, which is can be located in several places outside of filesystems.
Edit: Stage1.5 location is recorded into MBR code, usually stage1.5 is located in empty area right after MBR.
Stage1.5 can read the filesystem it is made for and stage2 from it. This means you can move your stage2 around and stage1.5 will find it as long as the path remains unchanged. You can guess from here. Stage2 can read the filesystem too and reads menu.lst.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.