UbuntuThis forum is for the discussion of Ubuntu Linux.
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 used to understand how to configure Grub 1, no problem.
But I can't seen to understand how to do it for Grub 2.
Does Grub 2 have a configuration file I can alter ?
Where on the system might it reside ?
I will be installing Lubuntu 19.04. It will be my main internet
OS on a multi boot system, so it will have Grub for the
boot loader.
All other operating systems will be Linux ext3.
I just want to make sure I can boot all my operating
systems from the Grub boot menu once Lubuntu 19.04 is
installed.
I hope Grub 2 is as simple as Grub 1 was. And dependable.
Any information would be welcome.
I used to understand how to configure Grub 1, no problem.
But I can't seen to understand how to do it for Grub 2.
Does Grub 2 have a configuration file I can alter ?
Where on the system might it reside ?
Yes, it's called grub.cfg. You should find it in /boot/grub. But I warn you, it isn't designed to be edited by hand. You are supposed to use the update-grub script. See for instance https://www.howtogeek.com/196655/how...aders-settings.
Quote:
I just want to make sure I can boot all my operating systems from the Grub boot menu once Lubuntu 19.04 is installed.
That shouldn't be any problem
Quote:
I hope Grub 2 is as simple as Grub 1 was. And dependable.
Sorry to disappoint you! GRUB2 is dependable but it's not simple. It's fiendishly complex. That's because it's festooned with shell scripts to do all the configuration work that system administrators once used to do by hand with a simple editor. I hate it and never use it, but you'll find plenty of people here who think my attitude is ridiculously old-fashioned.
Yes, it's called grub.cfg. You should find it in /boot/grub. But I warn you, it isn't designed to be edited by hand
The reason for this is Ubuntu distros updates invoke update-grub which recreates the /boot/grub/grub.cfg. During update-grub the os-prober is invoked which scans for other installed os's and creates menu-entries for them in the grub.cfg. The primary files that control update-grub are the files in /etc/grub.d/ and the /etc/default/grub. The /etc/grub.d files are scripts that ran in the order of the numbering.
You can edit the /boot/grub/grub.cfg on distros that don't automatically update the grub.cfg during updates. Custom menu entries can be created in /etc/grub.d/40_custom. If you want to move the custom entries up in the grub.cfg file rename the 40_custom to 25_custom to move them before the os-prober entries and if you want the custom entries to be first rename to 05_custom. The os-prober can be isabled in the /etc/default/grub file if you desire to use custom menu entries.
grub.cfg files of your other distros can also be loaded from a custom menuentry.
Last edited by colorpurple21859; 06-29-2019 at 07:16 PM.
This is just my 2cents
On my laptop whenever it upgrades a kernel (Debian) or Grub it does update-grub and because I have many distros it comes up with multiple boot entries that are identical but just duplicates. So I always edit my /boot/grub/cfg by hand then copy it to the /root/Desktop folder.
Plus I boot lots of live distros off hard drive and edit grub.cfg alot.
It should "just work" - except for the edge cases of course ...
Simply put, whichever is installed last will control grub - so install Lubuntu last. All will be well until one of the other systems gets an update that forces a grub refresh of the config file. Then it will own grub. All your systems will still be bootable, but in a different order.
There are ways around this, but those edge cases keep popping up.
I took a long look at /boot/grub.cfg and it's too weird for me.
I had installed Debian 9.5.0 on /dev/sda6 a few days back and
Grub 2 does not detect it. I think I made a bad error when
the Debian's install program told me I'd not be able to boot
Debian 9.5.0 on /dev/sda6 unless I installed either Grub or Lillo.
So I installed Grub, but on /dev/sda6, because I did not want
to overwrite LUbuntu 19.04 Grub installed in /dev/sda. I foolishly
thought, if it didn't find Debian 9.5.0, I could just adjust grub.conf
and all would be OK. Well, that's not going to happen.
So I got Debian 9.5.0 installed but it's not on the Grub boot menu
I guess I'll have to re-install Debian 9.5.0 on /dev/sda6.
During my new install, do I have to install Gurb or Lillo for
Grub 2 on LUbuntu 19.04 to detect it and list it in the Grub boot menu ?
I assume that if I have to install Debian's grub or lillo, it should be
in /dev/sda6, not /dev/sda ?
Right now Grub 2 boots all my Linux ext3 operating systems, except
the new Debian 9.5.0 on /dev/sda6.
LUbuntu 19.04 is on /dev/sda3 which is the only bootable partition.
None of the other partitions are marked bootable.
Yea, I kind of wish they'd left grub alone. I thought it work just fine.
Grub 2 is no fun.
Thank you all for you very informative replies. It is appreciated.
I think there was a misunderstanding here! When the Debian installer told you that you had to install GRUB or LILO, it was assuming that you didn't already have a bootloader. But you must have had GRUB2 already if you had Ubuntu installed. So you should have ignored Debian's invitation to install another copy of GRUB.
Good practice in such cases is not to install the bootloader at all if you are allowed that choice. Stick with the one you already have because you know it works. If you are forced to install it, you should put it in the first sector of the root partition where it won't do any damage. Then you can run update-grub on your existing GRUB2 bootloader and hope that it picks up your new distro; if it doesn't, you can always add a custom entry in /etc/alternatives/grub.
Using LILO with Debian is not a good idea. I tried that and ran into a lot of trouble.
I took a long look at /boot/grub.cfg and it's too weird for m
Which one? First off, the grub.cfg files standard location is /boot/grub or in some cases /boot/grub2 not in the /boot directory. What exactly does Grub2 does not detect Debian mean? You indicate your primary bootloader is Grub2 of Lubuntu so was Debian not detected when you booted Lubuntu and ran sudo update-grub? That would be the standard method. You should not need to install Grub on Debian if you already have Grub on Lubuntu, it is totally unnecessary as Grub2 will search for the kernel and/or initrd files to put in the menu.
After running update-grub, do you not see an entry for Debian or if you do it doesn't boot? If so, what does happen? Marking a Linux partition bootable is mostly not needed, never done it and don't have any problems booting multiple Linux systems. That's a windows thing that applied also to some older hardware.
Quote:
I could just adjust grub.conf
That won't be possible as the various Ubuntu derivatives have been using Grub2 for almost 10 years and there is no grub.conf or menu.lst file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.