grub and fedora and ubuntu
I have both Fedora 17 and Ubuntu 12.04 installed. Fedora was installed last. It rewrote the mbr or whatever that is called. It added the necessary lines to boot Windows and Ubuntu, taken from the actual grub.cfg in Ubuntu, I presume.
Problem is when I get a kernel update in Ubuntu. Ubuntu adds its updated configuration to the Ubuntu /boot/grub/grub.cfg which on boot is duly ignored by the grub installed by Fedora. I can copy the new menuentry { blabla} from the Ubuntu /boot/grub.cfg into the Fedora /boot/grub2/grub.cfg and that is ok. Can I somehow tell either Ubuntu or Fedora only to write updates to grub.cfg to just one grub.cfg, so that I do not have to copy the details over manually?? And of course tell grub to use only this config! |
well if you just change /etc/fstab to reference the same partition for /boot then yes that would work as far as editing the boot line goes, however I'm not sure if that could cause other issues as well. Tentatively I'd say not, but I wouldn't count on it.
It's (almost) interesting to observe how /boot isn't really part of the operating system as such. there is no need to mount it at all, and outside of the grub phase serves no purpose at all. So it should really been seen to not belong to either OS in the first place really. |
Quote:
Below you indicate the new kernel is ignored in Fedora: Quote:
Quote:
|
To clarify:
I don't know how the computer actually boots. What tells it which grub.cfg to look for?? If I knew that, I would be half way to solving the problem. I have a grub.cfg in Ubuntu. I have a grub.cfg in Fedora. If I update Fedora (/dev/sda6), and there is a kernel update, it, quite naturally, changes its grub.cfg The same goes for Ubuntu (/dev/sda4). Quote:
On kernel update, whatever Linux I am using DOES NOT WRITE TO BOTH. That is natural. I wish it would! Of course, Ubuntu does not change the Fedora grub.cfg, and Fedora does not touch the Ubuntu grub.cfg I would like to make both Linices change one grub.cfg on kernel update. In the past I tried putting an entry in /etc/grub.d/40_custom It did not work, for whatever reason, probably me. I did mess up grub completely once, and had to reinstall, so I tend to leave that alone. I found, if I directly insert an entry in grub.cfg, it works, even though at the start of grub.cfg it says 'DO NOT EDIT THIS FILE', so I always do it this way. |
Quote:
I don't use Fedora but, with Ubuntu you could update its grub.cfg file to include a new kernel for Fedora on the machine with: sudo update-grub. I would expect you would be able to use "update-grub" with Fedora, if not try the grub mkconfig command or google updating Grub2 in Fedora. Since you are using the Fedora Grub2 to boot, that would be the best option. My experience with editing the grub.cfg file manually is that when update-grub is run on that OS, the entry disappears if it was not also in the 40_custom file. |
Thanks for that. Do you mean: if I run 'sudo update-grub' in Fedora, or Ubuntu, it will find the new kernels and put them in grub.cfg?
Assume, I am using Ubuntu (/dev/sda4) and /devsda6 is not mounted by default. I open a terminal and run 'sudo update-grub' Will it look in /dev/sda6 (Fedora) for /etc/boot and add things from there?? Quote:
If I am running Fedora, will 'sudo update-grub' find the new Ubuntu kernel and add it to (Fedora)grub.cfg?? |
No.
No. No and no. Sorry, I lost track of which question I was answering there ... Quote:
*ONE* system must own the MBR - that system is the one for which you will see the boot menu. All other systems should install their bootloader to the partition boot record rather than over-write the MBR. They can then be chainloaded if desired - this saves having to continually rebuild the grub.cfg for the "MBR-owning" system for any other (kernel) upgrades. Not such a burden on a 2-system dual boot, but try 5 or 8. Else simply update the "MBR-owning" systems grub.cfg - for F16 that is grub2-mkconfig (note that this is "non-standard"). It will go find the other updates. See the Fedora wiki for syntax. "update-grub" will not work on Fedora - it is a Debianism. So whilst being even more "non-standard", is probably easier to work with. You might want to consider Ubuntu as the "MBR-owning" system. But Fedora will have to be re-configured else it will continue to (seemingly randomly) update the MBR. Depends a lot on which system you use more and want as the default boot. |
Ok, thanks. At the mo, I use Ubuntu more. But Fedora 'owns' the mbr. How do I reverse that? Make Ubuntu the owner again? Short of reinstalling?
The reason I have two flavours of Linux is: this computer, Toshiba laptop C600D has a major, unresolved Linux problem: it crashes any and every time the dsl cable is unplugged. I have reported this to the bugzillas, and any and all forums I could reach. No one has an answer or solution, except 'update'. So I will continue to update, and hope and pray that some sunny day, this problem will vanish into /dev/none! |
There are two separate functions required - on both systems.
You'll need to do Ubuntu first - issue "grub-install" to the device node (/dev/sda say). That will over-write the MBR. Then run update-grub - that should populate grub.cfg and still allow you to select Fedora. Good Ubuntu article here. Seems Ubuntu are pushing people to use "boot repair" - see mention here. On reboot select Fedora and you need to issue "grub-install" on Fedora pointing to it's partition (/dev/sda2 or whatever), then do the grub2-mkconfig. Both commands are mentioned in the wiki article here. Make sure you run the Ubuntu update-grub if new kernel get picked up by Fedora. |
Thanks! That did the trick!
I started Ubuntu, ran grub-install, so now I have Ubuntu in charge of the mbr. To pick up any Fedora installation, the partition must be mounted. Otherwise grub does not see it. Mounting the Fedora partition in Ubuntu is just a click. Then run grub-update. Funnily enough, I did not have to mount the windows partition for it to be found! I wonder why? So in future, if Fedora updates the kernel (they always seem to be a step ahead of Ubuntu) I just: 1) Start Ubuntu 2) Mount Fedora partition 3) Run grub-update, and problem solved, the new kernel is in grub.cfg I see no reason why, if you had more systems, distros, that this should not work. So if you had 5 or 8 distros (why would you do that??), it should pick them up and put them all in one grub.cfg So thanks again, great tip! Thanks for the links! How come I don't see the mbr in say gparted or disk utility?? Where is it?? |
Quote:
I am interested in the technology, not the eye-candy. The MBR is at the start of the disk - outside of any partition. Likewise the partition table. Wikipedia used to have a quite good explanation. |
All times are GMT -5. The time now is 09:05 PM. |