You are not logged in.

#1 2023-01-16 22:20:10

aaflyby
Member
Registered: 2023-01-16
Posts: 2

how to boot (efibootmgr), and keep old system on subvolumes

Hej


"prologue"

I'm quite new to Arch and veeeeery new to the booting process.
My Arch experience so far: 1 install on VM, 1 install (archarm) on raspberry pi, 1 simple install on BIOS PC - all within last week. Looks promising...

What's my goal? I do run my workhorse (dell xps 15) with Manjaro for more than a year now and every once in a while, when I run into an issue, I got stuck.
I want to migrate to Arch, slowly. Get some experience, prepare tools I need, test, go, having fun to learn more and more.....
but not to destroy the old manjaro system.


"my starting point"

Manjaro, full disk encryption, btrfs, installed out of the box: Subvolumes @ = /, @home = /home, @cache = /var/cache, @log = /var/log.
I'm not 100% sure about the boot process, I think it's efiboot, since I can list the efivars and output is:

$ efibootmgr
BootCurrent: 0007
Timeout: 2 seconds
BootOrder: 0007,0001,0000
Boot0000* UEFI PC SN730 NVMe WDC 1024GB 20372S441604 1	PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-1B-44-4A-46-81-C3-80)/HD(1,GPT,d3578e40-494d-db48-880d-83ff46d3782b,0x1000,0x96000)/File(\EFI\Boot\BootX64.efi){auto_created_boot_option}
Boot0001* Linux Firmware Updater	HD(1,GPT,4d00d650-c704-4ff7-8a2c-65cd7bf6b630,0x800,0x12c000)/File(\EFI\fedora\fwupdx64.efi)
Boot0007* Manjaro	HD(1,GPT,d3578e40-494d-db48-880d-83ff46d3782b,0x1000,0x96000)/File(\EFI\Manjaro\grubx64.efi)

but there also is a tree structure containing grub in /boot, that's why I'm unsure:

$sudo tree -L 2 /boot/
/boot/
├── efi
│   └── EFI
├── grub
│   ├── fonts
│   ├── grub-btrfs.cfg
│   ├── grub.cfg
│   ├── grubenv
│   ├── locale
│   ├── themes
│   └── x86_64-efi
├── initramfs-4.14-x86_64-fallback.img
├── initramfs-4.14-x86_64.img
├── initramfs-5.15-rt-x86_64-fallback.img
├── initramfs-5.15-rt-x86_64.img
├── initramfs-5.15-x86_64-fallback.img
├── initramfs-5.15-x86_64.img
├── intel-ucode.img
├── linux414-x86_64.kver
├── linux-515-rt-x86_64.kver
├── linux515-x86_64.kver
├── memtest86+
│   └── memtest.bin
├── vmlinuz-4.14-x86_64
├── vmlinuz-5.15-rt-x86_64
└── vmlinuz-5.15-x86_64

7 directories, 17 files


$ sudo tree -L 2 /boot/efi/EFI                                                                                           ✔ 
/boot/efi/EFI
├── boot
│   └── bootx64.efi
├── Dell
│   └── logs
└── Manjaro
    └── grubx64.efi



"what I've got done, so far"

- I created new subvolumes @archroot and @archhome
- I did basic installation on @archroot, but nothing yet to efi boot partition.

fstab

I simply took the "old" one, edited subvolumes @archroot and @archhome and uncommented cache and log, since I don't want to deal with to many subvolumes.

$cat /mnt/etc/fstab
# <file system> <dir> <type> <options> <dump> <pass>
UUID=4630-0996                            /boot/efi      vfat    umask=0077 0 2
/dev/mapper/luks-4b396838-2403-4494-90be-6b95640cd9ad /              btrfs   subvol=/@archroot,defaults,noatime,autodefrag,compress=zstd 0 0
/dev/mapper/luks-4b396838-2403-4494-90be-6b95640cd9ad /home          btrfs   subvol=/@archhome,defaults,noatime,autodefrag,compress=zstd 0 0
#/dev/mapper/luks-4b396838-2403-4494-90be-6b95640cd9ad /var/cache     btrfs   subvol=/@archcache,defaults,noatime,autodefrag,compress=zstd 0 0
#/dev/mapper/luks-4b396838-2403-4494-90be-6b95640cd9ad /var/log       btrfs   subvol=/@archlog,defaults,noatime,autodefrag,compress=zstd 0 0
/dev/mapper/luks-f062c76b-61c0-4167-a0e9-8053bce39268 swap           swap    defaults,noatime 0 0
Questions

I'm worried to break my manjaro boot, That's why I want to understand:

  1. do I have to manually copy anything to to efi-boot partition?

  2. or is it done by running something like

    efibootmgr -c -d /dev/sdb -p 1 -l /vmlinuz-linux -L "Arch Linux" -u "root=/dev/sdb3 rw quiet initrd=intel-ucode.img initrd=initramfs-linux.img"

    ??

  3. any conflicts expected? kernel versions?

  4. is the (no.2) the complete command? I've seen some fallback stuff?

  5. what do I use to replace volume identifiers

    /dev/sdb

    and

    /dev/sdb3

    , since I do use btrfs subvolumes. I think, that's the most unclear part to me??

  6. anything else to think of?

If I didn't miss anything I'm ready for my first boot, then. Looking forward, to do so wink))

thx in advance, aaflyby

Last edited by aaflyby (2023-01-17 16:19:34)

Offline

#2 2023-01-18 19:34:18

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 270
Website

Re: how to boot (efibootmgr), and keep old system on subvolumes

It should work without problems, except if you have conflicting file names in /boot.

1. No
2. yes, but see 5
3. post

ls /boot

I don't know how manjaro name their initial ramdisks (i guess it's the same), but this is the only thing that might conflict. solutions would be:
a) different kernel (maybe zen smile )
b) mount the efi partition to /efi and use a unified kernel image
c) another efi partition

4. For the fallback option you have to run a slightly different command:

efibootmgr -c -d /dev/sdb -p 1 -l /vmlinuz-linux -L "Arch Linux [fallback]" -u "root=/dev/sdb3 rw quiet initrd=intel-ucode.img initrd=initramfs-linux-fallback.img"

edit according to the files present in the efi partition
5. See persistant block device naming in the wiki
6 note that for booting manjaro, you will have to enter the firmware's boot options(pressing f12 on boot), so if you want to boot manjaro regularly i would recommend a proper boot loader

Last edited by jl2 (2023-01-18 20:36:08)


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Offline

#3 2023-01-19 07:00:34

topcat01
Member
Registered: 2019-09-17
Posts: 125

Re: how to boot (efibootmgr), and keep old system on subvolumes

This is quite an ambitious setup for someone new smile but it is cool.

  1. You are booting grub in UEFI mode (it can do both).

  2. Use persistent device naming as suggested above, e.g. UUIDS (or some people prefer labels).

  3. Instead of writing boot entries directly into the EFI, why not just write your own grub config? You can boot both Manjaro and Arch from the same grub menu. I have a multiboot USB disk with several permanently installed distros plus Ventoy with live ISO images which works similarly. Since it is removable there are no firmware entries at all.

  4. Make sure you have backups of important data in case something gets messed up. Things will go wrong more often than not!

Good luck!

Offline

#4 2023-01-22 17:00:47

aaflyby
Member
Registered: 2023-01-16
Posts: 2

Re: how to boot (efibootmgr), and keep old system on subvolumes

Great - thank you for your posts. It's very helpful for me.
I'll dig into that and see, what I (can) do. ...and let you know the other day.

Offline

Board footer

Powered by FluxBB