LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-15-2017, 02:24 AM   #1
sharky
Member
 
Registered: Oct 2002
Posts: 569

Rep: Reputation: 84
Can't add linux install to grub menu


Have grub and linux mint installed on /dev/sda. The OS in on /dev/sda1. Have another linux install on /dev/sdb1. I can mount it while booted into mint and I can see the contents of /boot.

Code:
 > ll /media/lfs/boot/
total 6761
drwxrwxrwx 3 mymachine mymachine    2048 Jan 23 11:22 .
drwxrwxrwx 5 mymachine mymachine    2048 Jan 24 03:32 ..
-rw-r--r-- 1 mymachine mymachine  922342 Jan 17 11:47 initrd.gz
drwxrwxrwx 3 mymachine mymachine    4096 Jan 17 10:21 isolinux
-rw-rw-rw- 1 mymachine mymachine 5992432 Jan 15 10:32 vmlinuz
Is there a utility to add the /dev/sdb1 partition to grub.

The grub.cfg file warns not to manually edit and the syntax is very verbose so I'm not comfortable trying to manually add another menu item.
 
Old 05-15-2017, 02:52 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
For Mint update-grub should do it (use sudo). The actual function is provided by os-prober, which has syntax rules for recognising kernels. Whether it'll accept that, you'll only find out by trying.
If not, you'll have to build your own custom entry - see /etc/grub.d/40_custom. Plenty of how-to's online.
 
Old 05-15-2017, 07:06 AM   #3
sharky
Member
 
Registered: Oct 2002
Posts: 569

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by syg00 View Post
For Mint update-grub should do it (use sudo). The actual function is provided by os-prober, which has syntax rules for recognising kernels. Whether it'll accept that, you'll only find out by trying.
If not, you'll have to build your own custom entry - see /etc/grub.d/40_custom. Plenty of how-to's online.
Added this entry to 40_custom.

Code:
menuentry "Linux From Scratch" {
	savedefault
	insmod ext2
	set root='(hd1,1)'
        linux   /vmlinuz root=/dev/sdb1 ro quiet splash 1
}
Ran 'sudo update-grub' and got this returned.

Code:
Generating grub configuration file ...
Found theme: /boot/grub/themes/poly-light-master/theme.txt
Found linux image: /boot/vmlinuz-4.10.0-20-generic
Found initrd image: /boot/initrd.img-4.10.0-20-generic
Found linux image: /boot/vmlinuz-4.4.0-77-generic
Found initrd image: /boot/initrd.img-4.4.0-77-generic
Found linux image: /boot/vmlinuz-4.4.0-75-generic
Found initrd image: /boot/initrd.img-4.4.0-75-generic
Found linux image: /boot/vmlinuz-4.4.0-53-generic
Found initrd image: /boot/initrd.img-4.4.0-53-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
 
Old 05-15-2017, 07:37 AM   #4
sharky
Member
 
Registered: Oct 2002
Posts: 569

Original Poster
Rep: Reputation: 84
Actually that did add the custom menu entry and I was able to boot into the other installation.

It promptly kernel panic'd and died on me but that another issue.

This issue is resolved.

Thanks for the help.
 
Old 05-15-2017, 07:43 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Add your initrd.
 
Old 05-15-2017, 10:48 AM   #6
sharky
Member
 
Registered: Oct 2002
Posts: 569

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by syg00 View Post
Add your initrd.
That was it. Able to boot into the other installation now.

There should be a way to mark a thread as 'DOUBLE SOLVED'.

Forgot to mention that I also had to add /boot before my 'linux' and 'initrd' entries. Final menu entry looks like this.

Code:
menuentry "Linux From Scratch" {
	savedefault
	insmod ext2
	set root='(hd1,1)'
        linux   /boot/vmlinuz root=/dev/sdb1 ro quiet splash 1
        initrd  /boot/initrd.gz
}
 
  


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
Trying to add Windows 7 Partition to Grub Menu contraversy Linux - General 1 07-22-2013 02:57 PM
LXer: Grub Customizer Lets You Reorder, Add Or Remove GRUB 2 (Or BURG) Menu Entries LXer Syndicated Linux News 0 10-09-2010 05:20 PM
how do I add mythbuntu to my opensuse grub menu Shadowmeph Linux - Newbie 3 09-20-2008 12:27 PM
add windows install to GRUB menu sall Linux - Hardware 4 07-29-2005 05:41 PM
GRUB - How to add Windows to boot menu? geekgyrrrl Linux - Newbie 4 06-04-2005 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:46 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