You are not logged in.

#1 2024-02-11 18:57:38

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

[SOLVED] sysem bootloader to have snapshots in the boot menu

Im using btrfs , i used the system boot instead of grub as my bootloader during archinstall. H owever now that i followed this guide
https://github.com/Antynea/grub-btrfs/
https://bbs.archlinux.org/viewtopic.php?id=284945

my issue is tthat i cant use this command

sudo grub-mkconfig -o /boot/grub/grub.cfg

since i didnt select grub and as seen bellow my /boot looks like that .



> ls -lR /boot
drwxr-xr-x    - root 11 Feb 09:15  EFI
.rwxr-xr-x 7.4M root  1 Feb 19:16  intel-ucode.img
drwxr-xr-x    - root 11 Feb 19:13  loader
.rwxr-xr-x  13M root 11 Feb 09:14  vmlinuz-linux

/boot/EFI:
drwxr-xr-x - root 11 Feb 09:15  BOOT
drwxr-xr-x - root 11 Feb 20:15  Linux
drwxr-xr-x - root 11 Feb 09:15  systemd

/boot/EFI/BOOT:
.rwxr-xr-x 100k root 24 Jan 18:38  BOOTX64.EFI

/boot/EFI/Linux:
.rwxr-xr-x 60M root 24 Jan 18:38  arch-linux-fallback.efi
.rwxr-xr-x 32M root 24 Jan 18:38  arch-linux.efi

/boot/EFI/systemd:
.rwxr-xr-x 100k root 24 Jan 18:38  systemd-bootx64.efi

/boot/loader:
drwxr-xr-x  - root 11 Feb 09:15  entries
.rwxr-xr-x  6 root 11 Feb 09:15  entries.srel
.rwxr-xr-x 29 root 11 Feb 09:15  loader.conf
.rwxr-xr-x 32 root 11 Feb 19:13  random-seed

there is grub installed automatically  with the system

grub-install --version
grub-install (GRUB) 2:2.12-1

my btrfs subvol list looks like this

ID 256 gen 716 top level 5 path @
ID 257 gen 716 top level 5 path @home
ID 258 gen 716 top level 5 path @log
ID 259 gen 612 top level 5 path @pkg
ID 260 gen 621 top level 5 path @.snapshots
ID 261 gen 18 top level 256 path var/lib/portables
ID 262 gen 18 top level 256 path var/lib/machines


S o my problem is how to update my snapshots to be added to /boot .

Last edited by arch_SENPAI (2024-02-15 12:19:13)


its a bird, its a plane , no its Arch_SENPAI

Offline

#2 2024-02-11 19:21:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

You need /boot mounted and install GRUB then, according to https://wiki.archlinux.org/title/GRUB#UEFI_systems

These outputs show you didn't install with /boot mounted or used the wrong command.

If you actually want btrfs to be able to snapshot /boot you'd mount the ESP at a different location e.g. /efi instead reinstall the kernel and then install GRUB into /efi but generate the config on /boot/grub/grub.cfg

Last edited by V1del (2024-02-11 19:22:34)

Offline

#3 2024-02-12 20:51:01

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

i followed this https://wiki.archlinux.org/title/EFI_sy … _partition
on btrfs.
they say you add /esp , no clue where to add it to .the file path as I reinstall mysystem
I'm also using archinstall

NAME  MAJ:MIN  RM  SIZE       RO  TYPE    MOUNT POINTS
sda1     8  :  1         0      600M    0       part      /mnt/archinstall/boot/esp
sda2     8  :  2         0      2G        0       part      [SWAP]
sda3    8 :    3         0      497G    0       part  /mnt/archinstall/.snapshots
                                                                    /mnt/archinstall/var/log 
                                                                    /mnt/archinstall/var/cache/pacman/pkg
                                                                    /mnt/archinstall/home
                                                                    /mnt/archinstall/

this comment made me try to make changes on the /mnt/boot but I can't see where to add it.

If you want btrfs to be able to snapshot /boot you'd mount the ESP at a different location e.g. /efi instead of reinstalling the kernel and then installing GRUB into /efi but generating the config on /boot/grub/grub.cfg

Last edited by arch_SENPAI (2024-02-12 21:15:48)


its a bird, its a plane , no its Arch_SENPAI

Offline

#4 2024-02-12 23:36:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

Assuming the setup above

arch-chroot /mnt/archinstall
grub-install --target=x86_64-efi --efi-directory=/boot/esp --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
efbootmgr -uv

post the output of the last command, or all the intermediary commands or definitely those if any throw errors.

Offline

#5 2024-02-13 04:52:25

cryptearth
Member
Registered: 2024-02-03
Posts: 46

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

ESP is short for Efi System Partition - so whenever ESP is referenced is meant to be replaced by your actual ESP - in your case /dev/sda1.
On arch the ESP (your /dev/sda1) is usually mounted to /boot of the systems root partition - in your case to /mnt/archinstall/boot.
The quote you mentioned is about BtrFS be able to also snapshot /boot - for this to work you have to mount your ESP (/dev/sda1) to a different path - like to /efi - in your case: /mnt/archinstall/efi. This way /boot becomes part of the regular root volume and gets snapshot along with it.
The difference is this: With the ESP mounted to /boot the bootloader and the kernel and initrd are directly exposed to the bios - and if something goes wrong you likely have to boot from a rescue media and fix it this way. With ESP mounted to /efi only grub itself as the bootloader is exposed to the bios - but your kernel and initrd are part of the snapshot - so if something goes to way of the dodo you can just reboot and select the previous working snapshot and start over from a point before the latest update.

I personal prefer ZFS and hence have my OS on a regular EXT4. BtrFS has way too many downsides for my taste that it's upsides doesn't make it. If my OS crashes for some reason I just wipe the OS and bootloader - reinstall it - get ZFS working again - mount the pool and back to a working system. I only ever had trouble with BtrFS - hence at least I personal advice against it - at least for the OS itself. If you use it for /home or anything else like external drives or some other cluster is up to you.

Offline

#6 2024-02-13 06:35:05

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

Unlike my first post i deleted my system and reinstalled arch linux again, making grub the bootloader instead of system-boot. that's why my configuration is different.




grub-install --target=x86_64-efi --efi-directory=/boot/esp --bootloader-id=GRUB

im getting

grub-install: error: failed to get canonical path of '/boot/esp'

however when i run, it gives no error

[root@archiso /]# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Installing for x86_64-efi platform.
Installation finished. No error reported

.

[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

here is a look at my /boot directory

[root@archiso /]# ls /boot
EFI  grub  intel-ucode.img  vmlinuz-linux
ls -lR /boot
/boot:
total 19940
drwxr-xr-x 4 root root     4096 Feb 13 08:32 EFI
drwxr-xr-x 6 root root     4096 Feb 13 08:53 grub
-rwxr-xr-x 1 root root  7368704 Feb  1 19:16 intel-ucode.img
-rwxr-xr-x 1 root root 13038080 Feb 13 08:31 vmlinuz-linux

/boot/EFI:
total 8
drwxr-xr-x 2 root root 4096 Feb 13 08:32 BOOT
drwxr-xr-x 2 root root 4096 Feb 13 08:35 Linux

/boot/EFI/BOOT:
total 136
-rwxr-xr-x 1 root root 139264 Feb 13 08:32 BOOTX64.EFI

/boot/EFI/Linux:
total 89420
-rwxr-xr-x 1 root root 59881472 Jan 24 18:38 arch-linux-fallback.efi
-rwxr-xr-x 1 root root 31681536 Jan 24 18:38 arch-linux.efi

/boot/grub:
total 44
drwxr-xr-x 2 root root  4096 Feb 13 08:32 fonts
-rwxr-xr-x 1 root root  4495 Feb 13 08:53 grub.cfg
-rwxr-xr-x 1 root root  1024 Feb 13 08:32 grubenv
drwxr-xr-x 2 root root  4096 Feb 13 08:32 locale
drwxr-xr-x 3 root root  4096 Feb 13 08:32 themes
drwxr-xr-x 2 root root 20480 Feb 13 08:32 x86_64-efi

/boot/grub/fonts:
total 2356
-rwxr-xr-x 1 root root 2411774 Feb 13 08:32 unicode.pf2

/boot/grub/locale:
total 5480
-rwxr-xr-x 1 root root 127048 Feb 13 08:32 ast.mo
-rwxr-xr-x 1 root root 127925 Feb 13 08:32 ca.mo
-rwxr-xr-x 1 root root 119187 Feb 13 08:32 da.mo
-rwxr-xr-x 1 root root 150609 Feb 13 08:32 de.mo
-rwxr-xr-x 1 root root 226560 Feb 13 08:32 de@hebrew.mo
-rwxr-xr-x 1 root root 150573 Feb 13 08:32 de_CH.mo
-rwxr-xr-x 1 root root 188503 Feb 13 08:32 en@arabic.mo
-rwxr-xr-x 1 root root 178004 Feb 13 08:32 en@cyrillic.mo
-rwxr-xr-x 1 root root 178001 Feb 13 08:32 en@greek.mo
-rwxr-xr-x 1 root root 204272 Feb 13 08:32 en@hebrew.mo
-rwxr-xr-x 1 root root 157511 Feb 13 08:32 en@piglatin.mo
-rwxr-xr-x 1 root root 138951 Feb 13 08:32 en@quot.mo
-rwxr-xr-x 1 root root  43353 Feb 13 08:32 eo.mo
-rwxr-xr-x 1 root root 130226 Feb 13 08:32 es.mo
-rwxr-xr-x 1 root root 132438 Feb 13 08:32 fi.mo
-rwxr-xr-x 1 root root 157662 Feb 13 08:32 fr.mo
-rwxr-xr-x 1 root root 102986 Feb 13 08:32 gl.mo
-rwxr-xr-x 1 root root  91712 Feb 13 08:32 he.mo
-rwxr-xr-x 1 root root 130211 Feb 13 08:32 hr.mo
-rwxr-xr-x 1 root root 137911 Feb 13 08:32 hu.mo
-rwxr-xr-x 1 root root  28183 Feb 13 08:32 id.mo
-rwxr-xr-x 1 root root 116895 Feb 13 08:32 it.mo
-rwxr-xr-x 1 root root  45042 Feb 13 08:32 ja.mo
-rwxr-xr-x 1 root root 156841 Feb 13 08:32 ka.mo
-rwxr-xr-x 1 root root 155988 Feb 13 08:32 ko.mo
-rwxr-xr-x 1 root root   7733 Feb 13 08:32 lg.mo
-rwxr-xr-x 1 root root 100889 Feb 13 08:32 lt.mo
-rwxr-xr-x 1 root root 128102 Feb 13 08:32 nb.mo
-rwxr-xr-x 1 root root 126900 Feb 13 08:32 nl.mo
-rwxr-xr-x 1 root root  61770 Feb 13 08:32 pa.mo
-rwxr-xr-x 1 root root 149543 Feb 13 08:32 pl.mo
-rwxr-xr-x 1 root root 131706 Feb 13 08:32 pt.mo
-rwxr-xr-x 1 root root  86540 Feb 13 08:32 pt_BR.mo
-rwxr-xr-x 1 root root 158334 Feb 13 08:32 ro.mo
-rwxr-xr-x 1 root root 170188 Feb 13 08:32 ru.mo
-rwxr-xr-x 1 root root  93884 Feb 13 08:32 sl.mo
-rwxr-xr-x 1 root root 190543 Feb 13 08:32 sr.mo
-rwxr-xr-x 1 root root 128320 Feb 13 08:32 sv.mo
-rwxr-xr-x 1 root root  83529 Feb 13 08:32 tr.mo
-rwxr-xr-x 1 root root 199239 Feb 13 08:32 uk.mo
-rwxr-xr-x 1 root root 162622 Feb 13 08:32 vi.mo
-rwxr-xr-x 1 root root 139089 Feb 13 08:32 zh_CN.mo
-rwxr-xr-x 1 root root  30274 Feb 13 08:32 zh_TW.mo

/boot/grub/themes:
total 4
drwxr-xr-x 2 root root 4096 Feb 13 08:32 starfield

/boot/grub/themes/starfield:
total 2868
-rwxr-xr-x 1 root root   19890 Feb 13 08:32 COPYING.CC-BY-SA-3.0
-rwxr-xr-x 1 root root    1191 Feb 13 08:32 README
-rwxr-xr-x 1 root root     836 Feb 13 08:32 blob_w.png
-rwxr-xr-x 1 root root     178 Feb 13 08:32 boot_menu_c.png
-rwxr-xr-x 1 root root     193 Feb 13 08:32 boot_menu_e.png
-rwxr-xr-x 1 root root     103 Feb 13 08:32 boot_menu_n.png
-rwxr-xr-x 1 root root     193 Feb 13 08:32 boot_menu_ne.png
-rwxr-xr-x 1 root root     184 Feb 13 08:32 boot_menu_nw.png
-rwxr-xr-x 1 root root     102 Feb 13 08:32 boot_menu_s.png
-rwxr-xr-x 1 root root     198 Feb 13 08:32 boot_menu_se.png
-rwxr-xr-x 1 root root     196 Feb 13 08:32 boot_menu_sw.png
-rwxr-xr-x 1 root root      96 Feb 13 08:32 boot_menu_w.png
-rwxr-xr-x 1 root root  153206 Feb 13 08:32

/boot/grub/x86_64-efi:
total 3440
-rwxr-xr-x 1 root root  15896 Feb 13 08:32 acpi.mod
-rwxr-xr-x 1 root root   1832 Feb 13 08:32 adler32.mod
-rwxr-xr-x 1 root root   8080 Feb 13 08:32 affs.mod
-rwxr-xr-x 1 root root   8464 Feb 13 08:32 afs.mod
-rwxr-xr-x 1 root root   2088 Feb 13 08:32 afsplitter.mod
-rwxr-xr-x 1 root root  22040 Feb 13 08:32 ahci.mod
-rwxr-xr-x 1 root root    704 Feb 13 08:32 all_video.mod
-rwxr-xr-x 1 root root   1376 Feb 13 08:32 aout.mod
-rwxr-xr-x 1 root root   5008 Feb 13 08:32 appleldr.mod
grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
$efibootmgr -uv
[root@archiso /]# efibootmgr -uv
BootCurrent: 000C
Timeout: 0 seconds
BootOrder: 0013,0000,0001,0002,0003,0007,0008,0009,000A,000B,000C,000D
Boot0000  Setup FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
      dp: 04 06 14 00 66 8b 1c 72 6c 42 86 4e 8e 99 34 57 c4 6a b0 b9 / 7f ff 04 00
Boot0001  Boot Menu FvFile(126a762d-5758-4fca-8531-201a7f57f850)
      dp: 04 06 14 00 2d 76 6a 12 58 57 ca 4f 85 31 20 1a 7f 57 f8 50 / 7f ff 04 00
Boot0002  Diagnostic Splash Screen FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
      dp: 04 06 14 00 a6 d9 d8 a7 b0 6a eb 4a ad 9d 16 3e 59 a7 a3 80 / 7f ff 04 00
Boot0003  Lenovo Diagnostics FvFile(3f7e615b-0d45-4f80-88dc-26b234958560)
      dp: 04 06 14 00 5b 61 7e 3f 45 0d 80 4f 88 dc 26 b2 34 95 85 60 / 7f ff 04 00
Boot0004  Startup Interrupt Menu FvFile(f46ee6f4-4785-43a3-923d-7f786c3c8479)
      dp: 04 06 14 00 f4 e6 6e f4 85 47 a3 43 92 3d 7f 78 6c 3c 84 79 / 7f ff 04 00
Boot0005  Rescue and Recovery FvFile(665d3f60-ad3e-4cad-8e26-db46eee9f1b5)
      dp: 04 06 14 00 60 3f 5d 66 3e ad ad 4c 8e 26 db 46 ee e9 f1 b5 / 7f ff 04 00
Boot0006  MEBx Hot Key FvFile(ac6fd56a-3d41-4efd-a1b9-870293811a28)
      dp: 04 06 14 00 6a d5 6f ac 41 3d fd 4e a1 b9 87 02 93 81 1a 28 / 7f ff 04 00
Boot0007* USB CD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 86 70 12 96 aa 5a 78 48 b6 6c d4 9d d3 ba 6a 55 / 7f ff 04 00
Boot0008* USB FDD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 6f f0 15 a2 88 30 b5 43 a8 b8 64 10 09 46 1e 49 / 7f ff 04 00
Boot0009* ATA HDD0 VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
      dp: 03 0a 25 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 91 af 62 59 56 44 9f 41 a7 b9 1f 4f 89 2a b0 f6 00 / 7f ff 04 00
Boot000A* ATA HDD1 VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f601)
      dp: 03 0a 25 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 91 af 62 59 56 44 9f 41 a7 b9 1f 4f 89 2a b0 f6 01 / 7f ff 04 00
Boot000B* ATA HDD2 VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f602)
      dp: 03 0a 25 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 91 af 62 59 56 44 9f 41 a7 b9 1f 4f 89 2a b0 f6 02 / 7f ff 04 00
Boot000C* USB HDD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 33 e8 21 aa af 33 bc 47 89 bd 41 9f 88 c5 08 03 / 7f ff 04 00
Boot000D* PCI LAN VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 78 a8 4a af 2b 2a fc 4e a7 9c f5 cc 8f 3d 38 03 / 7f ff 04 00
Boot000E* IDER BOOT CDROM PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,1,0)
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 02 16 / 03 01 08 00 00 01 00 00 / 7f ff 04 00
Boot000F* IDER BOOT Floppy PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,0,0)
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 02 16 / 03 01 08 00 00 00 00 00 / 7f ff 04 00
Boot0010* ATA HDD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f6)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 91 af 62 59 56 44 9f 41 a7 b9 1f 4f 89 2a b0 f6 / 7f ff 04 00
Boot0011* ATAPI CD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a354)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b ae a2 09 0a df de 21 4e 8b 3a 5e 47 18 56 a3 54 / 7f ff 04 00
Boot0012* PCI LAN VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)
      dp: 03 0a 24 00 d2 38 78 bc 82 0f 60 4d 83 16 c0 68 ee 79 d2 5b 78 a8 4a af 2b 2a fc 4e a7 9c f5 cc 8f 3d 38 03 / 7f ff 04 00
Boot0013* GRUB HD(1,GPT,8c379565-d343-452f-995d-c0f0400fc067,0x800,0x12c000)/\EFI\GRUB\grubx64.efi
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 c0 12 00 00 00 00 00 65 95 37 8c 43 d3 2f 45 99 5d c0 f0 40 0f c0 67 02 02 / 04 04 30 00 5c 00 45 00 46 00 49 00 5c 00 47 00 52 00 55 00 42 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00

Last edited by arch_SENPAI (2024-02-13 07:50:35)


its a bird, its a plane , no its Arch_SENPAI

Offline

#7 2024-02-13 07:42:30

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

ESP is short for Efi System Partition - so whenever ESP is referenced is meant to be replaced by your actual ESP - in your case /dev/sda1.
On arch the ESP (your /dev/sda1) is usually mounted to /boot of the systems root partition - in your case to /mnt/archinstall/boot.

From my understanding  this command

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

configures GRUB to recognize the ESP

as shown in my previous reply

[root@archiso /]# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Installing for x86_64-efi platform.
Installation finished. No error reported.

[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

The quote you mentioned is about BtrFS be able to also snapshot /boot - for this to work you have to mount your ESP (/dev/sda1) to a different path - like to /efi - in your case: /mnt/archinstall/efi. This way /boot becomes part of the regular root volume and gets snapshot along with it.
The difference is this: With the ESP mounted to /boot the bootloader and the kernel and initrd are directly exposed to the bios - and if something goes wrong you likely have to boot from a rescue media and fix it this way. With ESP mounted to /efi only grub itself as the bootloader is exposed to the bios - but your kernel and initrd are part of the snapshot - so if something goes to way of the dodo you can just reboot and select the previous working snapshot and start over from a point before the latest update.

I see my current set up  how do I go about doing what is quoted above .

Last edited by arch_SENPAI (2024-02-13 08:23:54)


its a bird, its a plane , no its Arch_SENPAI

Offline

#8 2024-02-13 08:23:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

The file structure of /boot in the above reply and the fact that grub-install went through without a hich shows that that was not the case once again.

You need to mount your ESP to some other place that is not /boot. you can pick /esp /efi /heresmyboot whatever else. you then need to install GRUB into that other mount point location (e.g. /efi), and reinstall the linux packages so they get generated on /boot (which should now be either some standalone btrfs subvolume or part of your @-root volume)

Last edited by V1del (2024-02-13 08:25:07)

Offline

#9 2024-02-13 15:11:56

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

what if i remove the /efi dir from boot and install gub in it


its a bird, its a plane , no its Arch_SENPAI

Offline

#10 2024-02-13 15:36:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

No, that's a directory on your ESP and it should and will remain on said ESP. Your entire FAT32 ESP partition needs to be mounted somewhere that isn't /boot. This will naturally, by the definition of what a partition and a mount point is, will move the entire current contents of your "/boot" to some other place, let's use "/efi".

I have a strong feeling you fundamentally don't understand how the mount command and partitions work, you're strongly suggested to read up on that. Using e.g. https://wiki.archlinux.org/title/File_s … ile_system as a starting point.

Assuming you're booted now (can you actually boot into the current system? or are you still operating from the live disk? if from the live disk, you need to chroot into the installation first, see posts above) the chain of commands you'd need to run would be

umount /boot
ls -l /boot #This should be empty
mkdir /efi
mount /dev/sda1 /efi
ls -lR /efi #These contents should look familiar to what you had under /boot
cp /efi/vmlinuz* /efi/initramfs* /efi/intel-ucode.img /boot/
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

And you will also need to fix  your /etc/fstab so that the ESP partition that was pointing to /boot is now mounted on /efi instead.

Last edited by V1del (2024-02-13 15:48:58)

Offline

#11 2024-02-13 17:26:46

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

[root@archiso /]# ls -lR /efi
/efi:
total 1

9940
drwxr-xr-x 4 root root     4096 Feb 13 19:51 EFI
drwxr-xr-x 6 root root     4096 Feb 13 19:51 grub
-rwxr-xr-x 1 root root  7368704 Feb  1 19:16 intel-ucode.img
-rwxr-xr-x 1 root root 13038080 Feb 13 19:51 vmlinuz-linux

/efi/EFI:
total 8
drwxr-xr-x 2 root root 4096 Feb 13 19:51 BOOT
drwxr-xr-x 2 root root 4096 Feb 13 19:52 Linux

/efi/EFI/BOOT:
total 136
-rwxr-xr-x 1 root root 139264 Feb 13 19:51 BOOTX64.EFI

/efi/EFI/Linux:
total 89420
-rwxr-xr-x 1 root root 59881472 Jan 24 18:38 arch-linux-fallback.efi
-rwxr-xr-x 1 root root 31681536 Jan 24 18:38 arch-linux.efi

/efi/grub:
total 44
drwxr-xr-x 2 root root  4096 Feb 13 19:51 fonts
-rwxr-xr-x 1 root root  4495 Feb 13 19:51 grub.cf
-rwxr-xr-x 1 root root  1024 Feb 13 19:51 grubenv

Can't find initrmfs. I'm guessing it's likely because the mkinitcpio script is still looking for the /boot directory in its default locations.

[root@archiso /]# cp /efi/vmlinuz* /efi/initramfs* /efi/intel-ucode.img /boot/
cp: cannot stat '/efi/initramfs*': No such file or directory

tried to run this itbrings the error

[root@archiso /]# mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -U /boot/EFI/Linux/arch-linux.efi --splash /usr/share/systemd/bootctl/splash-arch.bmp --microcode /boot/intel-ucode.img
==> ERROR: Unable to write to path: '/boot/EFI/Linux/arch-linux.efi'
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -U /boot/EFI/Linux/arch-linux-fallback.efi -S autodetect --microcode /boot/intel-ucode.img
==> ERROR: Unable to write to path: '/boot/EFI/Linux/arch-linux-fallback.efi'
[root@archiso /]# mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -U /boot/EFI/Linux/arch-linux.efi --splash /usr/share/systemd/bootctl/splash-arch.bmp --microcode /boot/intel-ucode.img
==> ERROR: Unable to write to path: '/boot/EFI/Linux/arch-linux.efi'
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -U /boot/EFI/Linux/arch-linux-fallback.efi -S autodetect --microcode /boot/intel-ucode.img
==> ERROR: Unable to write to path: '/boot/EFI/Linux/arch-linux-fallback.efi'

Last edited by arch_SENPAI (2024-02-13 17:59:45)


its a bird, its a plane , no its Arch_SENPAI

Offline

#12 2024-02-13 18:03:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

initramfs is generated by mkinitcpio when installing a kernel, push comes to shove just reinstall the linux package... you did run that from a chroot right and not from the ISO itself?

Please don't try to fumble  your way to a solution, do you understand what you need to do when we talk about chroot? You're obviously not booted into the actual system judging by the hostname but afaik that doesn't necessarily need to change assuming you've chrooted.

Edit: Ah that makes more sense... change the linux.preset files mentioned there and remove the uki config or fix the path: https://wiki.archlinux.org/title/Unifie … reset_file

Last edited by V1del (2024-02-13 18:06:13)

Offline

#13 2024-02-13 19:59:53

cryptearth
Member
Registered: 2024-02-03
Posts: 46

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

V1del wrote:

I have a strong feeling you fundamentally don't understand how the mount command and partitions work, you're strongly suggested to read up on that.

I was looking for a polite way to ask the same as the replies so far brought the same thoughts in my mind.

@OP
You posted

grub-install --target=x86_64-efi --efi-directory=/boot/esp --bootloader-id=GRUB
fails with
grub-install: error: failed to get canonical path of '/boot/esp'

Well - to me this looks like you get something very wrong here - and I'm honestly a bit surprised how you managed to get a system up and running using systemd-boot instead of something way more common like grub.

From your further replies you still seem to struggle quite hard - so let me try to help you get up to speed:

For the most simple setup on a modern uefi system (in uefi mode) you need two partitions: the efi system partition ESP - and the root partition of your OS (doesn't matter if ext4/btrfs/zfs for linux or ntfs for windows - the basics are the same).
The ESP has to be formatted with FAT32 as part of the UEFI specs - and it's sole purpose is to store bootloaders and thier configs (although this function can be combined with more features like holding a linux kernel and initrd).
So, just by these simple rules the most basic setup looks like this:

/dev/sda
- /dev/sda1 - ESP
- /dev/sda2 - root partition of the OS

Following the Arch-Wiki install guide you likely end up sda2 being an EXT4 - and, by spec, with sda1 as FAT32.
The archiso live system is a regular linux environment - but it resides in RAM instead of any secondary fixed non-volatile storage. So in order to do anything with your new clean harddisk (no matter if ssd or hdd, no matter if ide, sata, sas, nvme, (i)scsi) you first have to mount the root partition - usually directly to /mnt:

mount /dev/sda2 /mnt

Now you have to define a point for where to mount the ESP to - this can be anything like /boot, /efi, /esp or whatever you come up with - it only has to be unique and unless it's /boot or /efi it must not interfere with other default top-level folder names - see here:
https://en.wikipedia.org/wiki/Filesyste … y_Standard
https://man.archlinux.org/man/file-hierarchy.7

To keep it simple - and when dealing with GRUB - according to the Arch-Wiki it seems comon to combine the function of storing the boot loader and the files required to start the linux system in one place - so next step is to mount the ESP to /boot

mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

Now we go along with the usual arch install with pacstrap and arch-chroot - and when you finally arrive at installing grub it is as simple as (from within chroot)

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg

NOTICE: I only used /boot - not /boot/esp like you did - because I have NOT defined /boot/efi as the mountpoint for the ESP - but only /boot itself directly - so I have to target /boot for the grub install ... I guess this is where you seem to went the way of the dodo the first time.

after exiting the chroot and unmounting the harddisk your uefi bios should now have a new boot entry "grub" along with all that other wierd default stuff and it should be the highest priority - so when the system restarts you should be granted with the grub screen and the top most entry the default linux kernel start into your new system.

I can't tell exactly where - but somewhere between setting up your partitions and installing grub as the bootloader it seems you got lost. And unfortunately by your replies you seem to have missed it, too.
I'm not quite sure yet if you were actually able to set up a running arch install - as changing from systemd-boot to grub should be a thing of 30 seconds and should work right away without any issues (mostly).

In order for us to be able to help you it is important that you follow our instructions and reply back what you get - in exactly the way it shows up on your screen. When you do have two nvme sticks - then please to NOT replace them with sda and sdb or with C and D for simpler typing - please write them out the way it shows up on your screen.

ALSO: As you mention dual-booting with windows - I highly suspect that something very wrong is going to happen - if you're lucky you just wipe the windows boot loader - which can be fixed quite simple - if you're unlucky you may lose all your data stored on any of the NTFS partitions. Please do a proper backup of your important files if you don't have already - we are not responsible for any damage.

// edit
Seems I got a bit confused with https://bbs.archlinux.org/viewtopic.php?id=292785 - sorry. Two topics around a very similar topic ... seems I mixed up something.

Last edited by cryptearth (2024-02-13 20:04:27)

Offline

#14 2024-02-14 00:46:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

IMO this also shows why I'm less than fond of the archinstall script. You'd probably be faster at your desired goal if you went through the installation guide and you'd understand more about the system, rather than having to retroactively rearchitect a core component of the installation, created and predetermined by a script that now created a setup that's much harder to get away from again.

Offline

#15 2024-02-14 05:59:43

cryptearth
Member
Registered: 2024-02-03
Posts: 46

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

I haven't played around with the install script yet as I wasn't aware of it being a thing. But I sure screwed up the first time I tried to set up arch as I completely ignored the two lines about setting up the network and bring along an editor.
Does the archinstall script install any editor like vim or nano when selecting the minimal option? Or is the plan that most select server or desktop anyway?

Offline

#16 2024-02-14 11:56:06

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

Does the archinstall script install any editor like vim or nano when selecting the minimal option? Or is the plan that most select server or desktop anyway?

it does but you have to specify in the additional packages  option


its a bird, its a plane , no its Arch_SENPAI

Offline

#17 2024-02-14 19:37:12

cryptearth
Member
Registered: 2024-02-03
Posts: 46

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

arch_SENPAI wrote:

Does the archinstall script install any editor like vim or nano when selecting the minimal option? Or is the plan that most select server or desktop anyway?

it does but you have to specify in the additional packages  option

WOW - if it was ONE thing that I expected from an "convenience" script - it would had been to bring along vim, nano and emacs without have to specify one of them by hand.
It's kind of how the plasma meta-pack doesn't include Konsole by default.
Some decisions tho ...

anyway

@OP
Got you any further by have grub successfully set up yet?
If not I would say: just nuke the setup and restart over again - and just chose grub this time as bootloader - or don't use the install script at all but do it by hand.

Offline

#18 2024-02-15 11:42:01

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

@cryptearth it helpt actually i nuked and downloaded everything from scratch . the arch install is no more


How does one close a topic

Last edited by arch_SENPAI (2024-02-15 11:43:23)


its a bird, its a plane , no its Arch_SENPAI

Offline

#19 2024-02-15 11:48:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,100

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

You can edit the title in the first post and add [SOLVED] or so, you might hit the character limit so you might have to shorten it a bit.

Also I have to commend your attitude here, while this was likely somewhat of a frustrating exchange for all of us, you took the proper takeaways and ended up working out a proper solution. and hopefully learned how to administer the system better/how the lower bits and pieces interact with each other.

Last edited by V1del (2024-02-15 11:53:11)

Offline

#20 2024-02-15 12:10:02

arch_SENPAI
Member
Registered: 2024-02-11
Posts: 10

Re: [SOLVED] sysem bootloader to have snapshots in the boot menu

yes@v1del . its my 3rd wk with linux . I'm was a windows person. so I'm eager to learn


its a bird, its a plane , no its Arch_SENPAI

Offline

Board footer

Powered by FluxBB