1

I have Ubuntu Linux 20.04 and Kali 2021 installed, and before reinstalling both, I had two grubs, the main one showed up when I started the pc, it was the Ubuntu one, and the second one showing up when I selected the Kali option in the Ubuntu Linux's grub. The grub on which the pc started was the Ubuntu one, and if I chose to start Kali, it would start again and show me a Kali grub menu. How can I get both back to what they were ? Thanks for your replies, but please, do not say "It is not possible", as I did have both of them fine and working. Thanks

1
  • Could it have been one in the GPT/MBR, then second one installed as volume bootloader, at the start of a partition? In the OS installer you should see a select which lets you pick where to install grub in the partitioning setup phase. One will be something like /dev/sda, and a volume bootloader would be on something like /dev/sda1
    – doug65536
    Apr 7, 2021 at 1:46

2 Answers 2

1

It is strange that you say it was set up this way before, because normally Ubuntu just adds menu entries to boot the other distro's kernel directly rather than to load its menu. You can manually edit your grub.cfg though and use the source command to load the other distribution's grub.cfg file. That will then present the menu options as they appear there.

1

Add a custom menuentry to your /etc/grub.d/40_custom:

#!/bin/sh
exec tail -n +3 $0

  menuentry "Kali Linux custom configuration" {
    search --set=root --fs-uuid <UUID_HERE>
    configfile "($root)/boot/grub/grub.cfg"
  }

Then update grub:

sudo update-grub

6.4 Multi-boot manual config

E,g: let say your Kali root partition is /dev/sda7.

UEFI boot: the /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0



menuentry "Kali Linux custom configuration" {

    search --set=root --label Kali --hint hd0,gpt7
    configfile "(hd0,gpt7)/boot/grub/grub.cfg"
  }

Then run:

sudo grub-mkconfig -o /boot/efi/EFI/ubuntu/grub.cfg

Legacy boot: the /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0

  menuentry "Kali Linux custom configuration" {

    search --set=root --label Kali --hint hd0,msdos7
    configfile "(hd0,msdos7)/boot/grub/grub.cfg"
  }

Then run:

sudo grub-mkconfig -o /boot/grub/grub.cfg
17
  • if I don't have a 40_custom, is it okay to create one ? Or does it need some special formatting ? Mar 30, 2021 at 17:05
  • I'm sorry for being such a newbie, but I copied it to a newly created 40_custom, then proceeded to update-grub, yet nothing happened neither changed. (I mean, I restarted my pc then chose Kali as the OS, but it opened Kali. Then I tried any other option related to Kali, to no avail.) Did I do something wrong, or am I supposed to do something else ? Thanks for putting time in this Mar 30, 2021 at 17:43
  • i've seen it, very clear and precise, thanks a lot In my case, Kali is /dev/sda7, so I have to remplace the /hd0/gpt9 by /hd0/sd7, is that right ? Mar 30, 2021 at 18:32
  • 1
    @ChuckLennon Right hd0,gpt7
    – GAD3R
    Mar 30, 2021 at 18:36
  • 1
    @ChuckLennon switch to Kali Linux, check the /boot/grub/grub.cfg file. If it doesn't exist create it through: sudo grub-mkconfig -o /boot/grub/grub.cfg.
    – GAD3R
    Mar 30, 2021 at 19:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .