First experiment with installing on BTRFS

If you’re in an experimental state of mind - rEFInd might be worth a try. As you’re planning to use the grub entries anyway, just an install (with no configuring at all) should get you going with an alternative… and it has the advantage that changes and updates in the systems should not affect the boot setup.

Fairly easy to remove too :grin:

2 Likes

At this stage I am open to all alternatives. Just a bit overwhelmed right now with the abundance of possibilities and wealth of info. But sure, I’ll be looking att rEFInd as well. It sounds like a viable option. Thanks for pointing it out!

Here is how the disk looks like so far:

 Model: SKHynix_HFS001TD9TNG-L3A0B (nvme)
Disk /dev/nvme0n1: 1024GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  106MB   105MB   fat32              boot, esp
 2      106MB   53.8GB  53.7GB  btrfs
 3      53.8GB  53.9GB  105MB   fat32              boot, esp
 4      53.9GB  108GB   53.7GB  btrfs
 sudo blkid

/dev/nvme0n1p1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="D79B-9C85" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="689038fd-31b5-454c-a4e2-0e2481a22c15"
/dev/nvme0n1p2: UUID="90793bd8-8680-45f2-88d6-05b1b9968539" UUID_SUB="aa3348e0-34b2-4fdb-b228-ec367f72eecf" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="96d845dc-0970-4cc1-a199-081ac4e4bcb1"
/dev/nvme0n1p3: UUID="7259-3050" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="44bb85af-b67c-4681-ac41-3e9b64c44a16"
/dev/nvme0n1p4: UUID="1a1b20eb-6fb5-46fc-9666-3b0e6f4c4300" UUID_SUB="15e84ebd-2381-4a19-9064-eac3fe7e282b" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="35690940-29f4-43ba-ab65-dff50f389e97"

And here is

efibootmgr -v
BootCurrent: 0005
Timeout: 0 seconds
BootOrder: 0005,0000,0002,0003,2001,2002,2003
Boot0000* EndeavourOS   HD(3,GPT,44bb85af-b67c-4681-ac41-3e9b64c44a16,0x6432800,0x32000)/File(\EFI\EndeavourOS\grubx64.efi)
Boot0001* EFI USB Device (Sony    Storage Media)        UsbWwid(54c,5ba,0,CB07105833BB15C22)/HD(2,MBR,0xa4e000b7,0x73b5c00,0x10000)RC
Boot0002* EFI Hard Drive (SKHynix_HFS001TD9TNG-L3A0B)   PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,GPT,689038fd-31b5-454c-a4e2-0e2481a22c15,0x800,0x32000)RC
Boot0003* EFI Hard Drive 1 (SKHynix_HFS001TD9TNG-L3A0B) PciRoot(0x0)/Pci(0x2,0x3)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(3,GPT,44bb85af-b67c-4681-ac41-3e9b64c44a16,0x6432800,0x32000)RC
Boot0005* EnOS-Plasma   HD(1,GPT,689038fd-31b5-454c-a4e2-0e2481a22c15,0x800,0x32000)/File(\EFI\endeavouros\grubx64.efi)
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC

I can now choose between the two OS from the bios boot menu (EndeavourOS and EnOS-Plasma).

So if the Manjaro’s fix for os-probr with btrfs will work out the I guess I can stick with Grub. Otherwise I should be looking at rEFInd I guess.

1 Like

@Manuel,
Thank you for this! It works perfectly!
Here it is, running from the first os on /dev/nvme0n1p2:

sudo os-prober
/dev/nvme0n1p4:EndeavourOS:EndeavourOS:linux:btrfs:UUID=1a1b20eb-6fb5-46fc-9666-3b0e6f4c4300:subvol=@
 sudo grub-mkconfig -o /boot/grub/grub.cfg 

Generating grub configuration file ...
Found theme: /boot/grub/themes/EndeavourOS/theme.txt
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot: initramfs-linux-zen-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Found EndeavourOS on /dev/nvme0n1p4
done

After reboot, all the entries on Grub menu. Boots fine to both systems.

Thank you @Manuel and the Manjaro devs!

yay

Now I am off to get some sleep.
:sleeping:

3 Likes

@pebcak Aaah, young Jedi !

1 Like

Hello btrfs users! Testing needed!

All btrfs (and grub) users here, please test the following (same commands as above) and report the results here!
Maybe we can make this a package later, if this works for all. :smile:

cd /tmp
git clone https://gitlab.manjaro.org/packages/community/os-prober.git
cd os-prober
makepkg -cf
sudo pacman -U os-prober-1.*.pkg.tar.*        # this line installs it
6 Likes

You need to add cd os-prober after git clone …

2 Likes

Thanks! Just added it.

3 Likes

I’ve installed Endeavour on 2 drives (GPT) both with btrfs (and both with their own /boot/efi fat32) and they see each other (only after the manjaro os-prober) so it’s a success.

But they can’t see my KDE Neon (Ubuntu 20.04) partition on a 3rd drive which is also btrfs with a fat32 boot, I know this isn’t the same thing, just saying !

OK, it is not a general solution yet. But sounds quite strange.

Do you have any idea why they can’t see KDE Neon?

I’ve got a pending update now for os-prober 1-77-1 >> 1-77-2. Will this overwrite Manjaro’s os-prober that I installed?

Yes, it should do that as far as I know.
Should check what they have changed.
However, it is also easy to test both and use the one that works for you.

EDIT: os-prober from Arch is already 1.77-2. Manjaro has 1.77-1, and that makes it always get the Arch version.
You may consider adding IgnorePkg = os-prober into /etc/pacman.conf.

Alternatively, you could create a small script that:

  • checks if Arch version is different from the Manjaro version
  • is so, then reinstall Manjaro version

You just need to run that script if os-prober is updated by Arch. To optimize a bit, the script could be executed always when grub-mkconfig is run…

So either way, a bit more work than usual.

2 Likes

@manuel I’m not sure (I’ve checked it does have lsb-release) but after reading online it seems to have to do with having multiple kernels with different names which ubuntu’s grub takes care of so it may be using a different schema.
However, due to the multiple kernels, I think it would be far less problematic to use Ubuntu’s grub to find the Arch installs whose kernel names don’t change (which it won’t do coz it obviously doesn’t have the Manjaro patch). So that won’t work until Ubuntu patch their grub, groan!
Anyway, if you want I’ll try and test things but it’s really not a bother to me.

1 Like

I’m not “pushing” you to test this, but of course if you have the willingness and time to do that, I’d appreciate! :smile:
But it is totally up to you.

1 Like

Ok sure, what do you want me to check?
This is Neon’s /boot:

config-5.4.0-45-generic      memtest86+.elf
config-5.4.0-47-generic      memtest86+_multiboot.bin
efi                          System.map-5.4.0-45-generic
grub                         System.map-5.4.0-47-generic
initrd.img                   vmlinuz
initrd.img-5.4.0-45-generic  vmlinuz-5.4.0-45-generic
initrd.img-5.4.0-47-generic  vmlinuz-5.4.0-47-generic
initrd.img.old               vmlinuz.old
memtest86+.bin

This is /boot/grub:

fonts  gfxblacklist.txt  grub.cfg  grubenv  themes  unicode.pf2  x86_64-efi

Grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}"
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}"
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; fi
}
function recordfail {
  set recordfail=1
  # GRUB lacks write support for btrfs, so recordfail support is disabled.
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod btrfs
set root='hd3,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  f8ba0579-95d1-4242-abe1-31b8436b0006
else
  search --no-floppy --fs-uuid --set=root f8ba0579-95d1-4242-abe1-31b8436b0006
fi
    font="/@/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod btrfs
set root='hd3,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  f8ba0579-95d1-4242-abe1-31b8436b0006
else
  search --no-floppy --fs-uuid --set=root f8ba0579-95d1-4242-abe1-31b8436b0006
fi
insmod gfxmenu
loadfont ($root)/@/boot/grub/themes/breeze/unifont-bold-16.pf2
loadfont ($root)/@/boot/grub/themes/breeze/unifont-regular-14.pf2
loadfont ($root)/@/boot/grub/themes/breeze/unifont-regular-16.pf2
loadfont ($root)/@/boot/grub/themes/breeze/unifont-regular-32.pf2
insmod png
set theme=($root)/@/boot/grub/themes/breeze/theme.txt
export theme
if [ "${recordfail}" = 1 ] ; then
  set timeout=5
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
if [ $grub_platform = efi ]; then
  set timeout=5
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
        if [ "${1}" = "keep" ]; then
                set vt_handoff=vt.handoff=7
        else
                set vt_handoff=
        fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Neon GNU/Linux' --class neon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f8ba0579-95d1-4242-abe1-31b8436b0006' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod btrfs
        set root='hd3,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  f8ba0579-95d1-4242-abe1-31b8436b0006
        else
          search --no-floppy --fs-uuid --set=root f8ba0579-95d1-4242-abe1-31b8436b0006
        fi
        linux   /@/boot/vmlinuz-5.4.0-47-generic root=UUID=f8ba0579-95d1-4242-abe1-31b8436b0006 ro rootflags=subvol=@ resume=UUID=80b9f07f-0593-48ae-8621-959d21dbfe3f quiet splash $vt_handoff
        initrd  /@/boot/initrd.img-5.4.0-47-generic
}
submenu 'Advanced options for Neon GNU/Linux' $menuentry_id_option 'gnulinux-advanced-f8ba0579-95d1-4242-abe1-31b8436b0006' {
        menuentry 'Neon GNU/Linux, with Linux 5.4.0-47-generic' --class neon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-47-generic-advanced-f8ba0579-95d1-4242-abe1-31b8436b0006' {
                recordfail
                load_video
                gfxmode $linux_gfx_mode
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod btrfs
                set root='hd3,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  f8ba0579-95d1-4242-abe1-31b8436b0006
                else
                  search --no-floppy --fs-uuid --set=root f8ba0579-95d1-4242-abe1-31b8436b0006
                fi
                echo    'Loading Linux 5.4.0-47-generic ...'
                linux   /@/boot/vmlinuz-5.4.0-47-generic root=UUID=f8ba0579-95d1-4242-abe1-31b8436b0006 ro rootflags=subvol=@ resume=UUID=80b9f07f-0593-48ae-8621-959d21dbfe3f quiet splash $vt_handoff
                echo    'Loading initial ramdisk ...'
                initrd  /@/boot/initrd.img-5.4.0-47-generic
        }
        menuentry 'Neon GNU/Linux, with Linux 5.4.0-45-generic' --class neon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-45-generic-advanced-f8ba0579-95d1-4242-abe1-31b8436b0006' {
                recordfail
                load_video
                gfxmode $linux_gfx_mode
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod btrfs
                set root='hd3,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  f8ba0579-95d1-4242-abe1-31b8436b0006
                else
                  search --no-floppy --fs-uuid --set=root f8ba0579-95d1-4242-abe1-31b8436b0006
                fi
                echo    'Loading Linux 5.4.0-45-generic ...'
                linux   /@/boot/vmlinuz-5.4.0-45-generic root=UUID=f8ba0579-95d1-4242-abe1-31b8436b0006 ro rootflags=subvol=@ resume=UUID=80b9f07f-0593-48ae-8621-959d21dbfe3f quiet splash $vt_handoff
                echo    'Loading initial ramdisk ...'
                initrd  /@/boot/initrd.img-5.4.0-45-generic
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

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

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
        fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

I think this should do it for the moment. But then should i keep track of Manjaro’s os-probers’s updates on the GitLab page?

@pebcak Did you check the difference? I am sure I remember that the version numbers of Arch and Manjaro were the same when an author online tested this and Manjaro’s patch wasn’t in Arch’s files even though they were the same version.

No, I haven’t yet but I’ll do that.

Thanks! I have already put Arch’s on the ignore list.

1 Like

And if I’m right then yes you should block Arch’s os-prober and manually update Manjaro’s as you deem necessary.

1 Like

Yes.
That is quite easy to do if you clone the gitlab repository:

mkdir -p ~/where/you/want/to/keep/this
cd ~/where/you/want/to/keep/this
# Assuming you have already done this: git clone ...
git pull

If git pull says something has changed, then Manjaro has a new version. The same procedure can be applied again, starting with command cd os-prober.

1 Like