First experiment with installing on BTRFS

Haha, of course there is something in the AUR for that. I could have bet on it :joy:
That’s so great about the arch eco system, love that

2 Likes

Just take care that you don’t use anything too outdated.
For good measure: https://aur.archlinux.org/packages/?O=0&K=btrfs

1 Like

It is like a huge toy box. You don’t know what you are going to find in the bottom. :joy:

2 Likes

Wow, I was away just 45 min. or so!

At the moment I feel, I need to go back at the top of the thread and start reading everything from the beginning.

Thank you so much everybody for your input/advice/suggestions and insights. I will need to digest a bit all this info and read up a bit more as well. I will be back a bit later on and let you know how things are going.

Now I am facing an issue with suspension (for not mentioning bluetooth) but that is subject for another thread.

Thanks again and see you later!

1 Like

That looks like an os-prober problem, or the co-operation between os-prober and grub is failing.
Someone should debug the code (with bashdb debugger as they are bash code), but that’s not very easy if that person is not at all familiar with the code of os-prober and grub. Let alone the usage of btrfs.

But maybe this workaround could do the trick. It tries to use the grub.cfg of the other OS.
Simply write a menuentry into /boot/grub/custom.cfg of EndeavourOS as root:

menuentry 'Grub menu of the other OS' {
  search --set --fs-uuid "UUID-of-the-boot-partition-of-the-other-OS"
  configfile /boot/grub/grub.cfg
}

The important part is to have the proper UUID of the other OS. Use command lsblk -fm unless you already know it.
Note that instead of UUID it is possible to use LABEL (search --set --label "<label>") or an existing unique file (search --set --file "<unique-file-name>") as a search target.

3 Likes

Excellent as always sir!
I can try tomorrow as I have a Fedora33 beta btrfs on a 2nd drive.
And btw, the bug reports were discussing os-prober failing to find btrfs instances because it was looking for / and /etc on other drives.

1 Like

Please note that I didn’t actually test the workaround with btrfs simply because I’m not using btrfs, at least for now.
So it is just a usual way to use the existing grub menu of another OS.

funny and true. And i want to play with all of it at the same time :laughing:

Haha, i realized as well, there was quite a conversation going on here in your absence…
Take your time and ask again, if new questions arise.

2 Likes

Looks like Manjaro may have a fix for the os-prober btrfs problem: https://bugs.archlinux.org/task/64281

3 Likes

@manuel Yeah, I actually read that page a week ago but I completely forgot about it today somehow. Doh!
Anyway, can you use their patch in Endeavour? Would you want to?

1 Like

It would be interesting to test it, but currently I have no test system for that.

I just looked at that package and it is quite easy to build. A test should be made on a proper environment with btrfs filesystems.

Here’s how to build and install it:

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

As you have a system ready for testing, would you like to test it? :wink:
If it doesn’t work, simply reinstall the official with:

  sudo pacman -S os-prober
3 Likes

Ok sure, I’ll try tomorrow.

2 Likes

The set up I have installed via the wiki works fine with grub if I do a normal install and dual boot. If I use two setups or more of the wiki by @2000 they stay separate and each doesn’t bother picking up the other installation. But I have it set up with rEFInd and then it boots from the grubx64.efi I like the setup using rEFInd with btrfs all on separate drives. I have xfce on an nvme drive, cinnamon on another nvme drive and plasma on an SSD drive. I still have a 4TB hard drive sitting empty. It is a hybrid with 256m cache.

1 Like

In the meantime:

I installed a second EOS (Cinnamon) next to the first one (Plasma). I gave it it’s own ESP to keep things separated and for being able to bring up the bios boot menu and boot one or the other from there.

But oddly enough, somehow the efi boot entry for the first OS got removed.

Tried to manually create a boot entry with efibootmgr giving it the path to grubx64.efi in the ESP of the first partition. I don’t know why, but it failed to create the entry.

Then I used a custom.cfg as per @manuel’s suggestion with the following content from the grub.cfg of the first OS:

menuentry 'EndeavourOS, on linux-zen' --class endeavouros --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-zen-advanced-90793bd8-8680-45f2-88d6-05b1b9968539' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod btrfs
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  90793bd8-8680-45f2-88d6-05b1b9968539
	else
	  search --no-floppy --fs-uuid --set=root 90793bd8-8680-45f2-88d6-05b1b9968539
	fi
	echo	'Loading kernel linux-zen ...'
	linux	/@/boot/vmlinuz-linux-zen root=UUID=90793bd8-8680-45f2-88d6-05b1b9968539 rw rootflags=subvol=@  quiet loglevel=3 nowatchdog
	echo	'Loading initial ramdisk ...'
	initrd	/@/boot/amd-ucode.img /@/boot/initramfs-linux-zen.img
}

And sure enough, upon reboot, I had an entry for booting the first OS from the Grub menu of the second and it worked.

sudo parted -l

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
2 Likes

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