1

I have Gentoo Linux installed on /dev/sda2, with /dev/sda1 being the boot partition (where GRUB files are installed). /dev/sda has a MBR partition table. /dev/sdb1 is a data partition (where I store files that need to be backed up, sort of like a home partition) and /dev/sdb2 is where I installed Arch Linux. /dev/sdb has a GPT partition table. Gentoo is booting fine from GRUB, which I installed from Gentoo. Arch is not. /boot/grub/grub.cfg is https://paste.pound-python.org/show/2TXi8NeWbhoaWsifKeMM/. Here is Arch Linux's part of this file:

        menuentry 'Arch Linux (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_i
d_option 'osprober-gnulinux-/boot/vmlinuz-linux--1db96616-a88a-42a6-9283-a57016bba4c9' {
                insmod part_gpt
                insmod ext2
                set root='hd1,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  1db96616-a88a-42a6-9283-a57016bba4c9
                else
                  search --no-floppy --fs-uuid --set=root 1db96616-a88a-42a6-9283-a57016bba4c9
                fi
                linux /boot/vmlinuz-linux root=UUID=1db96616-a88a-42a6-9283-a57016bba4c9 rw quiet
                initrd /boot/initramfs-linux.img
        }

but when I try to boot it I get an error that hd1,gpt2 doesn't exist. Just so you can see that the partitions I mentioned exist here is what ls /dev/sd* returns:

/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb  /dev/sdb1  /dev/sdb2

If there is more information that you require to help fix this issue, please just tell me how to get it for you.

I have tried re-installing GRUB with grub-install --target=x86_64-efi --efi-directory=/boot /dev/sda and then re-running grub-mkconfig -o /boot/grub/grub.cfg. Still this issue persists.

EDIT: Now this is just perplexing... I just converted my MBR on /dev/sda to GPT using gdisk and now gdisk -l /dev/sda returns:

GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8AD72DC5-C104-4524-8C18-52759DC6C784
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2957 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          264191   128.0 MiB   EF00  EFI System
   2          264192      1953524191   931.4 GiB   8300  Linux filesystem

I re-installed GRUB (which was needed after the GPT change as otherwise I couldn't boot the hard disk) with grub-install --target=x86_64-efi --efi-directory=/boot /dev/sda, then re-generated my GRUB config file and lastly rebooted and try to boot Arch Linux and yet again it failed with the same error. Googling suggested to me that the different partition tables was likely the problem but it seems as though changing partition tables does not work. My new GRUB cfg file is here.

EDIT2: I have now deleted /dev/sdb1 and replaced it with an ESP partition, then installed GRUB on my Arch Linux partition run grub-install --target=x86_64-efi --efi-directory=/boot /dev/sdb && grub-mkconfig -o /boot/grub/grub.cfg. I still cannot boot Arch Linux. I have pressed Esc and checked the boot options and while a live USB of mine shows up the boot menu as does my Gentoo installation my Arch Linux installation does not show. I have also updated Gentoo's GRUB installation and its config and still I cannot boot Arch using Gentoo (with the exact same errors as before).

2
  • Brenton, you're trying too many things at once; please slow down. When dual-booting with GRUB, one of your OS's needs to be the one in charge of the "MBR part"; that's what grub-install does. Then, each OS needs to create it's own grub.cfg; which is what grub-mkconfig does. Given that Gentoo was installed first, leave grub-install to it. So do that, then come back and I'll explain how to get Gentoo's grub.cfg to load Arch's grub.cfg; which is what will allow you to boot both nicely. Jun 22, 2017 at 20:20
  • I changed the partition table on the MBR partition to GPT (I did add it to the question). So you want both partitions to have a grub.cfg, well they already do. I did that a while ago so I could try adding the Arch entry in the grub.cfg to the Gentoo grub.cfg. That didn't work, Arch still failed to boot. Now what do I do? Please don't interpret this as antagonistic I am merely asking what to do now.
    – Josh Pinto
    Jun 23, 2017 at 5:08

2 Answers 2

0

In your Gentoo system you should have the file /etc/grub.d/40_custom. You can add a menu entry to this file to reference Arch's grub.cfg. Something like this:

menuentry 'Arch Linux' {
   set root='hdX,msdosX' 
   configfile /boot/grub/grub.cfg
}

The root entry will need to point to the partition containing Arch's /boot. Then, run grub-mkconfig -o /boot/grub/grub.cfg to regenerate Gentoo's grub.cfg.

1
  • Please try re-reading my question. /dev/sda was where the MBR partition table was, where Gentoo was not Arch. Plus I've switched both disks over to GPT now (read the EDIT: and EDIT2: sections of my question specifically for this info). Guessing this will mean gptX will be needed instead of msdosX.
    – Josh Pinto
    Jun 23, 2017 at 19:48
0

I realize this is an old question, but still deserves an up to date answer

Disk Layout

Let me make sure I have this correct:

  1. /dev/sda1 corresponds to /boot You followed the Gentoo Handbook that recommends a separate partition
  2. /dev/sda2 contains the root of your Gentoo install, i.e. /
  3. /dev/sdb1 is a shareable partition between OS's
  4. /dev/sdb2 is your Arch install which doesn't contain a separate /boot partition

EFI Partition

Since you've said nothing about Windows being installed, we can ignore this Caveat. If future readers have Windows, please read the Caveat

  1. Aside from Windows the UEFI Specification is perfectly fine with multiple ESP Partitions across multiple disks
  2. Each OS should install it's .efi files in a separate directory, i.e. /boot/EFI/arch/bootx64.efi
  3. Although UEFI doesn't care, from personal experience, I recommend using one and only one EFI Partition, unless using a true boot manager like rEFInd

GRUB

  1. Choose the GRUB copy, you want in charge (save this choice for later).
  2. Use a rescue disk or the OS install disk to install your new OS (in your case Arch)
  3. List all disk using gptdisk
  4. Create a mount point for your arch /boot directory, that mounts your Gentoo /boot (Skip this if this is only a grub update) In effect, Gentoo and Arch will now share the same boot directory.
  5. Mount your existing EFI partition, depending on your output from Step 3: mount -t vfat /dev/sda1/EFI /boot/EFI
  6. Point the Grub installer for Arch to the directory you mounted in Step 5 using the --efi-directory option, i.e. grub-install --target=x86_64-efi --efi-directory=/boot/EFI

Step 6 should complete and you'll have the following setup:

/boot/EFI/gentoo/
/boot/EFI/arch/

and each directory should contain the EFI stub loaders for each OS

Boot into the OS you chose in #1, and run the appropriate command to update GRUB (you want the os-prober command to run, which will add the new OS to the menu. You can choose to update both GRUBs but that's rather redundant

You must log in to answer this question.

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