LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't add linux install to grub menu (https://www.linuxquestions.org/questions/linux-software-2/cant-add-linux-install-to-grub-menu-4175605957/)

sharky 05-15-2017 02:24 AM

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.

syg00 05-15-2017 02:52 AM

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.

sharky 05-15-2017 07:06 AM

Quote:

Originally Posted by syg00 (Post 5710769)
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


sharky 05-15-2017 07:37 AM

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.

syg00 05-15-2017 07:43 AM

Add your initrd.

sharky 05-15-2017 10:48 AM

Quote:

Originally Posted by syg00 (Post 5710856)
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
}



All times are GMT -5. The time now is 03:31 PM.