[SOLVED] grub2 indirect booting from separate partition
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 multiple distros that I chainload and I have installed a grub2 shell to the partition and can boot manual. I can not seem to get a grub.cfg file to work. Is there a directory that needs to be built for this file?
grub2 is completly different from grub "legacy".
Do not make changes to directly to grub.cfg this is a generated file.
There is quite good documentation for grub2 here: https://help.ubuntu.com/community/Grub2
Once you have installed grub2 you probably just need to run update-grub (as root), but please read the documentation first.
I have read and do not fully understand, I want it to stand alone in a boot partition fully independent of any distros. I have no problems installing it to boot from this partition but it still uses the ubuntu /etc partition. The reason I want it independent is so if I upgrade ubuntu tomorrow I will not have to redo grub. I know with grub2 this is not much of a problem except upgrade-grub has trouble getting the names of some of the ext2 and 3 distros. Once installed to boot indirect grub legacy it never used to give any problems.
Last edited by Larry Webb; 10-02-2010 at 01:21 PM.
I have read and do not fully understand, I want it to stand alone in a boot partition fully independent of any distros.
By "it", I assume you mean grub2, and the best place (for me) has been to put grub2 is on the MBR of the first disk.
When you do grub-install, grub2 looks at all partitions, and finds bootable OSs. It then puts them in a menu for the next boot.
grub2, like grub "legacy" still needs to keep its /boot/grub/* files on a partition somewhere.
If you have several OSs then the solution that works for me is to make one partition just for /boot.
That's where grub will keep ALL its config files. Also the real files of the different kernel versions. And it "just works": Boots the selected kernel, then mounts the appropriate root for the selected kernel/distro.
I learnt (the hard way) that if you have multiple distros, each with their own /boot directory, on different partitions, chaos can easily happen. So now I always select, at install time, to have /boot as a single, separate partition, and use the same one always. All distros install their boot files there. Which file is selected to be the kernel at boot time is decided by grub ( "legacy" or grub2 )
You can (temporarily) get around this (clumsily) by copying vmlinuz.* System.map.* initrd.img.* config-* and abi-* from your running kernel's /boot directory to the /boot directory of the partition grub(legacy or 2) thinks is its base.
If this doesn't help you, please search on the LQ user Saikee, who seems to be the LQ boot guru.
@tredegar, I think you've missed the point.
If you need to update the menu you (should) update /etc/defaults/grub, custom entries go in /etc/grub.d/
They are not likely to be on a /boot partition.
Larry, try something independent of the distro like gag. I tried it years ago, but desisted because (legacy) grub did all I needed, as I needed. Grub2 doesn't.
Just had a look - it appears to use the "unused" sectors after the MBR. This won't work for gpt disks (grub2 suffers the same issue).
I may go back to my old way, just thought I would try and get modern. I will give it a short rest before deciding and maybe someone will come up with a solution. If nothing else I guess I could strip down an ext4 distro to boot with and then chainload the rest of my distros. As long as I use grub2 just ignore the distro. It just seems to be a work around and a waste.
syg00 I will check into alternatives, grub2 seems to have some good points but I think there could be a simpler file stucture.
Last edited by Larry Webb; 10-02-2010 at 06:16 PM.
I use legacy grub as my control - separate boot partition, patched for the larger inode support for ext[34] and chainload like you.
I install grub2 in the partition boot sector - it complains, but seems to work. So far.
After taking a couple of weeks off I came back and accomplished getting grub 2 with its own partition chainloading all ext files. After getting the grub shell installed on the partition just make a grub.cfg file and install it in /boot/grub/. It will not automatically update, you will have control every time it boots. This was an education for an old man set in his ways.
@Larry
Can you describe your solution a little bit more in detail. Thanks.
I want to have Grub2 separately as a stand-alone boot manager in his own partition.
So it doesn't matter what OS I install or what image I restore in my three different OS partitions.
Right now, I can only think of a minimalistic stand-alone Ubuntu/Debian Linux, which just contains Grub2.
Then chain load all other partitions, no matter if Linux, Windows or whatever.
Or do I miss something?
First I partition my hds. My grub partition I try to make at approx. 2 meg. This partition can be the first, second, third or so on - primary or logical. This computer had two hds and I made the first partition of my second hd grub. I do all this work from a live cd that uses grub2.
Here are the steps I took after partitioning the hd.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.