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.
I'm multibooting the 32bit and 64bit versions of redhat and fedora using grub. Grub gets installed to the mbr and looks for grub.conf in the /boot partition of the last OS I install. In other words, if I install the boot partition of rhel_32bit on /dev/sda1, then install the boot partition of rhel_64bit on /dev/sda6, grub only recognizes changes made to the grub.conf that resides on /dev/sda6 (or (hd0,5) in grub terms).
My question is, what is the best way to view and change the config file grub looks for? I was able to change it from /dev/sda6 (hd0,5) to /dev/sda1 (hd0,0) by installing (or re-installing) from the grub shell...
install (hd0,0)/boot/grub/stage1 d (hd0) (hd0,0)/boot/grub/stage2 p (hd0,0)/boot/grub/grub.conf
Is there a better way to do this? Is there a way to view the current config file grub reads? Is there an alternative to the interactive shell so some of this stuff can be scripted (grubby and grub-install don't seem to have the options)?
The configuration file that GRUB uses is called grub.conf or menu.lst. Often times menu.lst is a link to grub.conf. It is found in /boot/grub You can view it in vi, vim, nano, gedit, kedit, etc., etc., ad naseum.
When I install subsequent distributions, I choose not to install the bootloader (GRUB or LILO). I then edit the existing grub.conf to add the new distribution. If you uncomment the hiddenmenu line in grub.conf, you will be presented a choice of distributions when you boot.
The location of the menu.lst file has to be hard-coded into GRUB. This file helps tell GRUB where to go for it's next steps. If there were another file to tell GRUB where to find menu.lst, then where would THAT file go?
Somebody must have figured out what bytes to change, but I've never seen it.
I ended up creating a small partition, installing grub on the mbr, and installing /boot to the small partition. I copied the contents of /boot to the root filesystem and remounted /boot as /boot_common. Then I linked /boot/grub/grub.conf (root filesystem) to /boot_common/grub/grub.conf.
I had to modify grub.conf because technically my initrd and vmlinuz were not under a separate boot partition and were now on hd0,1 not hd0,0.
I chose bootloader --location=partition for my subsequent installs (I could have chosen "none", but that didn't create a grub.conf for that particular install). Then I appended grub.conf from each installation to /boot_common/grub/grub.conf. I also had to mount /boot_common on each new OS. This gave me the ability to edit grub.conf from all OS's.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.