8

I have an uncommon setup. I have Ubuntu installed on one, and a backup from a direct copy of an older Arch Linux install on the second. By direct copy, I mean I tar'd the contents of an entire partition initially, and now I've extracted those contents to another partition. So:

1 - Ubuntu, with GRUB2

2 - Arch from a backup

Ubuntu runs and boots fine. After extracting Arch to a partition, I changed fstab to reflect its new partition. But now I'm stuck trying to get Arch to boot. I tried running update-grub in Ubuntu but it doesn't pick up the Arch install. So how can I get this to work?

1
  • Grub doesn't use fstab
    – matzahboy
    Aug 14, 2012 at 5:32

4 Answers 4

9

I had a similar problem after installing Fedora 17. Ubuntu would not pick it up. After finding no answers on the net, I wondered if it was because grub couldn't 'see' the Fedora install. So I mounted the Fedora / partition in Ubuntu and ran update-grub and it found the Fedora install and added it to the boot menu. I use the same technique with Archlinux

1
  • This method didn't work for me. I'm in a Pop_OS trying to make a dual boot to my Arch. Jan 23, 2021 at 17:12
4

Have you tried following the ArchWiki article on Grub2? You probably want to install the package called os-prober on your system before running grub-mkconfig. This will create the correct grub.cfg file for your system.

Let me know if you need more help.

2

Currently you are using grub from your Ubuntu installation, if you want to boot Arch from it, you have to add a custom entry configuring your Ubuntu so each time a package executes update-grub, your new entry is not removed.

The new entry should look quite similar to what you have already for booting ubuntu but referencing Arch's partitions and using Arch's kernel parameters (you could probably use Arch's wiki page on grub2).

For more information, take a look here: https://help.ubuntu.com/community/Grub2/CustomMenus

0

I came to this by google because I had this problem with a Debian Buster installation from Deboostrap, a very minimalist system to build Debian from scratch. I wanted to have my old Debian Stretch still available, so I needed a dual boot. With Debootstrap there is nothing preinstalled so I needed all the other three answers from @sever (mount unknown root filesystem), @darnir (install os-prober) and @tripledes (use custom configuration in /etc/grub.d/40_custom). Here is how I fit it all together.

First install os-prober:

~$ sudo apt install os-prober

But os-prober will not find the old installation if its root filesystem isn't mounted. So do it (my is on /dev/sda1):

~$ sudo mkdir /mnt/oldroot
~$ sudo mount /dev/sda1 /mnt/oldroot

Now I execute grub-mkconfig to get the grub menu entries on stdout and redirect it to a temp file:

~$ sudo grub-mkconfig > /tmp/oldmenu.cfg

Now I edit this file and delete everything except the entries for the old menus so I have just left over menuentry ... {...} and submenu ... {...}. Then I append it to /etc/grub.d/40_custom:

~$ sudo bash -c 'cat /tmp/oldmenu.cfg >> /etc/grub.d/40_custom'
~$ sudo update-grup

Clean up:

~$ sudo umount /mnt/oldroot
~$ sudo rmdir /mnt/oldroot
~$ rm /tmp/oldmenu.cfg

That's it. Now each time a package executes update-grub, the entry for the old installation isn't lost and always added.

You must log in to answer this question.

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