[resolved] Dual boot Arch and EndeavourOS on sda and sdb broke

This all started when I screwed-up shrinking sda, where EndeavourOS is installed. I did not wait long enough and Gparted didn’t complete it’s incantations to shrink sda1. I then could not boot EndeavourOS. This was several days ago. After messing things up beyond repair I decided to reinstall EndeavourOS. It runs great, always did. Arch on sdb booted fine before reinstall.

Now Arch won’t boot on sdb6:

This is a bios boot system, old hardware.

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0 195.6G  0 part /
└─sda2   8:2    0   8.8G  0 part 
sdb      8:16   0 931.5G  0 disk 
├─sdb2   8:18   0     1K  0 part 
├─sdb5   8:21   0   7.7G  0 part 
└─sdb6   8:22   0 199.6G  0 part /run/media/martin/Arch_root
sdc      8:32   1     0B  0 disk 
sr0     11:0    1  1024M  0 rom  

$ sudo fdisk -l
[sudo] password for martin: 
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-75Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0584c098

Device     Boot      Start        End   Sectors   Size Id Type
/dev/sda1  *          2048  410234879 410232832 195.6G 83 Linux
/dev/sda2       1935065126 1953520064  18454939   8.8G 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.


Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-00B
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000c6971

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sdb2           499710 1953523711 1953024002 931.3G  5 Extended
/dev/sdb5       1937301504 1953523711   16222208   7.7G 82 Linux swap / Solaris
/dev/sdb6        163192832  581883903  418691072 199.6G 83 Linux

Partition 2 does not start on physical sector boundary.
Partition table entries are not in disk order.

I had both grubs edited per: os-prober issue

Did it again on EndeavourOS new install.

Fallowed New dual boot fix for EndeavourOS

$ sudo sudo grub-mkconfig -o /boot/grub/grub.cfg
[sudo] password for martin: 
Generating grub configuration file ...
Found theme: /boot/grub/themes/EndeavourOS/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  intel-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Arch Linux (rolling) on /dev/sdb6
done

Kernel panic msg:
kernel_panic

Thanks for taking the time to read this post.

Can we see the part of the grub.cfg that was generated to boot Arch?

1 Like

Is this what you want? The Arch grub.cfg is locked/I haven’t figured out how to view it.

}
	menuentry 'Arch Linux, with Linux linux (on /dev/sdb6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--c6a6300e-f0cc-410c-99fb-861a4d014a82' {
		savedefault
		insmod part_msdos
		insmod ext2
		set root='hd1,msdos6'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos6 --hint-efi=hd1,msdos6 --hint-baremetal=ahci1,msdos6  c6a6300e-f0cc-410c-99fb-861a4d014a82
		else
		  search --no-floppy --fs-uuid --set=root c6a6300e-f0cc-410c-99fb-861a4d014a82
		fi
		linux /boot/vmlinuz-linux root=UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82 rw loglevel=3
		initrd /boot/intel-ucode.img
	}

Thanks dalto!

It looks like it missing the initramfs for Arch. It only has the ucode.

1 Like

Sorry I may have not sent enough. Just searched sdb6. Here is a search for UUID .

### BEGIN /etc/grub.d/30_os-prober ###
	menuentry 'Arch Linux (on /dev/sdb6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--c6a6300e-f0cc-410c-99fb-861a4d014a82' {
		savedefault
		insmod part_msdos
		insmod ext2
		set root='hd1,msdos6'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos6 --hint-efi=hd1,msdos6 --hint-baremetal=ahci1,msdos6  c6a6300e-f0cc-410c-99fb-861a4d014a82
		else
		  search --no-floppy --fs-uuid --set=root c6a6300e-f0cc-410c-99fb-861a4d014a82
		fi
		linux /boot/vmlinuz-linux root=UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82 rw loglevel=3
		initrd /boot/intel-ucode.img
	}
	menuentry 'Arch Linux, with Linux linux (on /dev/sdb6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--c6a6300e-f0cc-410c-99fb-861a4d014a82' {
		savedefault
		insmod part_msdos
		insmod ext2
		set root='hd1,msdos6'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos6 --hint-efi=hd1,msdos6 --hint-baremetal=ahci1,msdos6  c6a6300e-f0cc-410c-99fb-861a4d014a82
		else
		  search --no-floppy --fs-uuid --set=root c6a6300e-f0cc-410c-99fb-861a4d014a82
		fi
		linux /boot/vmlinuz-linux root=UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82 rw loglevel=3
		initrd /boot/intel-ucode.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs) (on /dev/sdb6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--c6a6300e-f0cc-410c-99fb-861a4d014a82' {
		savedefault
		insmod part_msdos
		insmod ext2
		set root='hd1,msdos6'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos6 --hint-efi=hd1,msdos6 --hint-baremetal=ahci1,msdos6  c6a6300e-f0cc-410c-99fb-861a4d014a82
		else
		  search --no-floppy --fs-uuid --set=root c6a6300e-f0cc-410c-99fb-861a4d014a82
		fi
		linux /boot/vmlinuz-linux root=UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82 rw loglevel=3
		initrd /boot/intel-ucode.img
	}

### END /etc/grub.d/30_os-prober ###

Your welcome to both .cgs’s.

They look like they are all missing the initrd line.

If you look at your EOS configs you will probably see two initrd lines each

1 Like

I think I see what you mean. This for Eos
initrd /boot/intel-ucode.img /boot/initramfs-linux.img
viz
initrd /boot/intel-ucode.img
the Arch entry.

My knoledge is not very deep here… thanks for the help. How to fix it?

I’ve been reading a bit about os-prober. This quote caught me

Since every version of linux does things slightly differently, this is no mean feat, techniques used include parsing /etc/fstab, rummaging around in /boot, parsing grub menu.lst files, etc.

So I checked my Arch fstab and it’s bogus! I accumulated comments that just cause potential errors with parsing.

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82 LABEL=Arch_root
/dev/sdb7           	/         	ext4      	rw,relatime,data=ordered	0 1
#original sdb6 not swap
#/dev/sdb6 none swap defaults 0 0
/dev/sdb5 none swap defaults 0 0

the UUID line is correct but commented. /dev/sdb7 is wrong swap is correct. How did this work?

Should I edit it to: (edited again using UUID)

# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
#
UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82   /   ext4        rw,relatime,data=ordered        0 1
UUID=cb512c15-b12f-4330-be81-07bfbd596992  none  swap  defaults 0 0

I see comparing Eos fstab swap is not listed ???

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=d65191dc-5320-4ec4-9e3b-9f8455fc4f11 /              ext4    defaults,noatime 0 1

:thinking:

I’m not very good at this either but i think you want to look at /boot/grub/grub.cfg :thinking:

1 Like

Thanks Rick that section of the Eos /boot/grub/grub,cfg is referenced in post #5.
Here is a link to the whole Eos grub.cfg
and the Arch grub.cfg. as well.
Thanks for your interest and all help is welcome.
:grinning_face_with_smiling_eyes:

I’m assuming EndeavourOS is in control of booting on your machine, right?

What happens if you reinstall grub on EndeavourOS and reboot?

1 Like

Neither Arch

 menuentry 'EndeavourOS Linux (rolling) (on /dev/sda1)' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-d65191dc-5320-4ec4-9e3b-9f8455fc4f11' {
    savedefault
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  d65191dc-5320-4ec4-9e3b-9f8455fc4f11
    else
      search --no-floppy --fs-uuid --set=root d65191dc-5320-4ec4-9e3b-9f8455fc4f11
    fi
    linux /boot/vmlinuz-linux root=UUID=d65191dc-5320-4ec4-9e3b-9f8455fc4f11 rw loglevel=3 nowatchdog
    initrd /boot/intel-ucode.img
}

nor EnOS

  menuentry 'Arch Linux, with Linux linux (on /dev/sdb6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--c6a6300e-f0cc-410c-99fb-861a4d014a82' {
        savedefault
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos6 --hint-efi=hd1,msdos6 --hint-baremetal=ahci1,msdos6  c6a6300e-f0cc-410c-99fb-861a4d014a82
        else
          search --no-floppy --fs-uuid --set=root c6a6300e-f0cc-410c-99fb-861a4d014a82
        fi
        linux /boot/vmlinuz-linux root=UUID=c6a6300e-f0cc-410c-99fb-861a4d014a82 rw loglevel=3
        initrd /boot/intel-ucode.img
    }

seems to have produced the correct initrd line for the other OS.

Has there been any changes/updates to the package grub lately?

EDIT
I can see:

Last Updated: 2021-09-09 11:07 UTC
https://archlinux.org/packages/core/x86_64/grub/

Could it be some bug/regression? :thinking:

—> 727,1GiB missing

—> 724,21GiB missing

Where is it?

And about the missing initramfs in the ARch entry … this should not happen on EndeavourOS if you do not uninstall:

endeavouros/grub-tools 1.6.5-1
    Fixes, additions and enhancements to grub and os-prober.

Is grub being regenerated after re-install? (on EnOS, preferably)

Ditch os-prober @kmartin. Avoid strange issues like this one.

I always recommend a primary Linux system (ie first in efi boot order), and grub chainload all others.

In your case EndOS is primary and Arch would be secondary, but you could also chainload EndOS just as easily within Arch system.

This is much easier to manage, much less prone to stupid os-prober / grub issues & regressions, and is the same simple syntax for encrypted or non encrypted systems.

/etc/grub.d/40_custom :

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "[Distro Name]" {
    set root="hdX,gptY"
    chainloader /EFI/[OS]/grubx64.efi
}

root is the efi partition of the distro you wish to chainload, which is basically a passthrough the that systems grub prompt. hdX is zero based, gptY is 1 based.

chainloader is the path to the grub efi stub within the efi boot partition.

Add one entry for each distro system, you can group them by submenus, or not, organize it however you wish.

You can even add your Windoze grub entry manually, just copy it from an existing grub.cfg.

1 Like

@kmartin 's seems to be a Legacy/MBR install. What would /etc/grub.d/40_custom look like in such a case?

Dunno, never use MBR.

Not me either! But I like your solution. I’ll make a note of it if I’ll build systems using Grub. I have switched to systemd-boot recently. No Grub issues ever again here :blush:

I found

Chainloading another bootloader to GRUB2 is fairly easy.

Something as simple as the following example is enough to boot another disk that uses a “Custom Super Bootloader” FILE /etc/grub.d/40_custom Chainloading another bootloader


menuentry "Custom Super Bootloader Example" {
     insmod part_msdos
     insmod chain
     chainloader (hd1,1)+1
}

at

https://wiki.gentoo.org/wiki/GRUB2/Chainloading

Needs to be modified for taking into account the actual setup.

1 Like

I just use rEFInd…problem solved!

Edit: Grub is…Grubish! :laughing:

2 Likes