LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-30-2019, 08:08 AM   #1
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
dual boot - dual grub


That is an interesting question (at least for me).
I have an ubuntu and a debian installed (and also a win10 and win7). Now the boot loader is installed from ubuntu, therefore if I modify debian (kernel) the boot loader should be updated from ubuntu (if I knew it well).
How can I configure my system so update-grub2 works the same way from debian and ubuntu (=will generate exactly the same grub menu/config).
 
Old 04-30-2019, 09:17 AM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,368

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
What I do is create a /etc/grub.d/25_custom with the following in Ubuntu and run sudo update-grub.
This puts the menu entry before the os-prober entries.

menuentry "Debian"{
set root=(hd0,2) #change accordingly for your Debian install
configfile /boot/grub/grub.cfg
}

That way I don't have to remember to go back to ubuntu to run update-grub when changes are made in Debian due to updates or anything else, just run update-grub in Debian.

Last edited by colorpurple21859; 04-30-2019 at 09:19 AM.
 
1 members found this post helpful.
Old 04-30-2019, 10:03 PM   #3
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,837
Blog Entries: 1

Rep: Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070
http://fm.no-ip.com/Share/Linux/custom.cfg is an example subset of what I do on UEFI systems (which have 6 or more Linux installations). It works much like what colorpurple21859 does, except this file is /boot/grub/custom.cfg, and instead of /etc/grub.d/25_custom, I rename 40_custom to 06_custom, without making any changes to the file's content. This also puts my (much less elaborate) custom entries at the top of the boot menu.
 
Old 05-01-2019, 09:35 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by colorpurple21859 View Post
What I do is create a /etc/grub.d/25_custom with the following in Ubuntu and run sudo update-grub.
This puts the menu entry before the os-prober entries.

menuentry "Debian"{
set root=(hd0,2) #change accordingly for your Debian install
configfile /boot/grub/grub.cfg
}

That way I don't have to remember to go back to ubuntu to run update-grub when changes are made in Debian due to updates or anything else, just run update-grub in Debian.
I am trying this little "trick" and it not working yo.
Code:
menuentry "Void Linux" {
set root='(hd1,7)'
configfile /boot/grub/grub.cfg
}
errors out.
Code:
$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-huge-4.19.37
Found linux image: /boot/vmlinuz-huge
Found linux image: /boot/vmlinuz-generic-4.19.37
Found linux image: /boot/vmlinuz-generic
/etc/grub.d/25_custom: line 1: menuentry: command not found
/etc/grub.d/25_custom: line 3: configfile: command not found
/etc/grub.d/25_custom: line 4: syntax error near unexpected token `}'
/etc/grub.d/25_custom: line 4: `}'
as the other files have a x attached to them and it was not picked up I added one to the 25_custom and now am getting them errors. now what?

should that be in 40_custom instead?

and it is on the second hdd and 7th partition, so should it be counting from 0 to 7 making it hd1,6 or keep it 7?

Last edited by BW-userx; 05-01-2019 at 09:42 AM.
 
Old 05-01-2019, 10:35 AM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,368

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
I think I copied 40_custom to 25_custom and added entries. I'll have to wait till I get home from work to check.
grub2 counts drives starting at 0 and partitions starting at 1

Last edited by colorpurple21859; 05-01-2019 at 10:39 AM.
 
Old 05-01-2019, 10:38 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
thanks, that little bit in the top of 40 might be the why my 25 is not taking.
 
  


Reply



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
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
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 - Software

All times are GMT -5. The time now is 04:08 AM.

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