LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-29-2019, 10:28 AM   #1
zeelog
Member
 
Registered: Jan 2008
Posts: 139

Rep: Reputation: 1
Grub 2 configuration for LUbuntu 19.04


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.
 
Old 06-29-2019, 11:24 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567
Blog Entries: 19

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Quote:
Originally Posted by zeelog View Post
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.
 
Old 06-29-2019, 06:00 PM   #3
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Quote:
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.
 
Old 06-29-2019, 06:23 PM   #4
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
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.
 
1 members found this post helpful.
Old 06-29-2019, 07:04 PM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Quote:
edit my /boot/grub/cfg by hand then copy it
I haven't thought about doing it that way.
 
Old 06-29-2019, 07:09 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.

Such is life as a multi-booter.
 
Old 07-01-2019, 09:14 AM   #7
zeelog
Member
 
Registered: Jan 2008
Posts: 139

Original Poster
Rep: Reputation: 1
Grub 2 configuration for LUbuntu 19.04

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.
 
Old 07-01-2019, 09:33 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567
Blog Entries: 19

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
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.
 
Old 07-01-2019, 10:51 AM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
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.

Last edited by yancek; 07-01-2019 at 10:54 AM.
 
  


Reply

Tags
grub, lubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Lubuntu Is Finally Moving to LXQt by Default with the Lubuntu 18.10 Release LXer Syndicated Linux News 0 05-03-2018 12:18 AM
LXer: No Audio in Lubuntu? - Lubuntu Audio Configuration and Volume Control LXer Syndicated Linux News 0 05-22-2016 11:17 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
GRUB GRUB GRUB GRUB "Whats Going on?" Gaweph Linux - Newbie 6 03-26-2004 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration