Can I restore grub in a multiboot in order to boot from a previous distro?
All my machines have had grub installed by Artix for quite a long time.
A few weeks ago I installed Mint Debian and somehow ended up with a grub installed by Mint. I have made quite a few attempts to make it boot from a grub installed by Artix again, without success. I don' t recall having had this problem before, all I am sure is that I have moved from grub in a distro to grub in another distro, many times, but it may have been that in every case I was installing the distro to be the new grub "host".
I am now suspecting that what I am trying is not possible, but I am not sure.
The last time I tried this was booting from an usb stick (/dev/sdc below). Then I did:
artix-live:[root]:/home/artix# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0
iso966 ARTIX_202308 2023-08-14-00-43-51-00 0 100% /run/artix/bootmnt
loop1
squash 0 100% /run/artix/sfs/livefs
loop2
squash 0 100% /run/artix/sfs/rootfs
sda
├─sda1
│ vfat 5A95-31F0
├─sda2
│
├─sda3
│ ntfs CAA295FBA295EBE7
└─sda4
ntfs 98BC3EA5BC3E7DB6
sdb
├─sdb1
│
├─sdb2
│ ext4 DAW15 f6a6caf2-65d3-41f3-9259-d78f25eb161f
├─sdb3
│ swap swap b3ba2d2b-35ab-45aa-8d6e-248d0a061c08
├─sdb5
│ ext4 Artix b831ec28-0001-458e-8233-abf2ab71d0d2
├─sdb6
│ ext4 UbuntuS f6620df0-b417-4b82-aa3b-d194ab6fbe1b
├─sdb7
│ ext4 Void 18430774-c601-4155-bc60-55cf534b6cce
├─sdb8
│ ext4 Fayevid8 87c24924-ff4d-4173-be65-34ad6d495011
├─sdb9
│ ext4 Mint 064eb945-c7b4-4aed-b94a-7de6b83820ef
├─sdb10
│ ext4 Fedora 76bf5ba8-0378-4b63-9a5d-897ae13dcfaf
├─sdb11
│ ext4 Manjaro 47a5d11e-65d4-4420-a7c9-40b444049adc
├─sdb12
│ vfat ESP 4B37-77E9
├─sdb13
│ ext4 StoreMedia 66f97b48-6ce0-49b0-b972-569cac52b488
└─sdb14
ext4 StoreAnnat 7ebd4a9c-8ead-4eea-a27e-a4070d55c956
sdc
├─sdc1
│ ext4 SYS fcaeae55-5b7f-4d3c-90a2-795e31a474ac
├─sdc2
│ ext4 Multi_ISOs 0c2e794c-4881-407f-82a9-2d3e0dbec9d5 3.2G 88% /run/artix/img_dev
├─sdc3
│ vfat EFI 95E3-3884
├─sdc4
│
└─sdc5
swap swap e79cd9bc-81bb-4e97-93ec-5db77c7f5b8c
sr0
artix-live:[root]:/home/artix# swapon /dev/disk/by-label/swap
artix-live:[root]:/home/artix# mount /dev/disk/by-label/Artix /mnt
artix-live:[root]:/home/artix# ls /mnt
bin boot dev etc home lib lib64 lost+found mnt opt proc root run sbin srv sys tmp usr var
artix-live:[root]:/home/artix# ls /mnt/boot
amd-ucode.img efi grub initramfs-linux-fallback.img initramfs-linux.img intel-ucode.img memtest86+ vmlinuz-linux
artix-live:[root]:/home/artix# ls /mnt/boot/efi
artix-live:[root]:/home/artix# mount /dev/disk/by-label/ESP /mnt/boot/efi
artix-live:[root]:/home/artix#
artix-live:[root]:/home/artix# artix-chroot /mnt
sh-5.2# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0
iso966 ARTIX_202308 2023-08-14-00-43-51-00
loop1
squash
loop2
squash
sda
|-sda1
| vfat 5A95-31F0
|-sda2
|
|-sda3
| ntfs CAA295FBA295EBE7
`-sda4
ntfs 98BC3EA5BC3E7DB6
sdb
|-sdb1
|
|-sdb2
| ext4 DAW15 f6a6caf2-65d3-41f3-9259-d78f25eb161f
|-sdb3
| swap swap b3ba2d2b-35ab-45aa-8d6e-248d0a061c08
|-sdb5
| ext4 Artix b831ec28-0001-458e-8233-abf2ab71d0d2 34.5G 23% /
|-sdb6
| ext4 UbuntuS f6620df0-b417-4b82-aa3b-d194ab6fbe1b
|-sdb7
| ext4 Void 18430774-c601-4155-bc60-55cf534b6cce
|-sdb8
| ext4 Fayevid8 87c24924-ff4d-4173-be65-34ad6d495011
|-sdb9
| ext4 Mint 064eb945-c7b4-4aed-b94a-7de6b83820ef
|-sdb10
| ext4 Fedora 76bf5ba8-0378-4b63-9a5d-897ae13dcfaf
|-sdb11
| ext4 Manjaro 47a5d11e-65d4-4420-a7c9-40b444049adc
|-sdb12
| vfat ESP 4B37-77E9 974.7M 2% /boot/efi
|-sdb13
| ext4 StoreMedia 66f97b48-6ce0-49b0-b972-569cac52b488
`-sdb14
ext4 StoreAnnat 7ebd4a9c-8ead-4eea-a27e-a4070d55c956
sdc
|-sdc1
| ext4 SYS fcaeae55-5b7f-4d3c-90a2-795e31a474ac
|-sdc2
| ext4 Multi_ISOs 0c2e794c-4881-407f-82a9-2d3e0dbec9d5
|-sdc3
| vfat EFI 95E3-3884
|-sdc4
|
`-sdc5
swap swap e79cd9bc-81bb-4e97-93ec-5db77c7f5b8c [SWAP]
sr0
sh-5.2# grub-install --recheck /dev/sdb
Installing for x86_64-efi platform.
Installation finished. No error reported.
sh-5.2# rub-install --target=i386-pc /dev/sdb
sh: rub-install: command not found
sh-5.2# grub-install --target=i386-pc /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.
sh-5.2# less /etc/default/grub
sh-5.2# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/artix/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: intel-ucode.img amd-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.
ERROR: mkdir /var/lock/dmraid
Found Fedora Linux 38 (KDE Plasma) on /dev/sdb10
Found Slackware 15.0 x86_64 on /dev/sdb2
Found Ubuntu 22.04.1 LTS (22.04) on /dev/sdb6
Found Void Linux on /dev/sdb7
Found LMDE 6 (faye) on /dev/sdb8
Found LMDE 6 (faye) on /dev/sdb9
Found Artix Linux on /dev/sdc1
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
sh-5.2# ls /boot
amd-ucode.img grub initramfs-linux.img memtest86+
efi initramfs-linux-fallback.img intel-ucode.img vmlinuz-linux
sh-5.2# ls -l /boot
total 65252
-rw-r--r-- 1 root root 81920 Feb 1 19:03 amd-ucode.img
drwxr-xr-x 4 root root 4096 Jan 1 1970 efi
drwxr-xr-x 7 root root 4096 Feb 6 19:35 grub
-rw------- 1 root root 39034670 Feb 5 21:06 initramfs-linux-fallback.img
-rw------- 1 root root 7284069 Feb 5 21:05 initramfs-linux.img
-rw-r--r-- 1 root root 7368704 Feb 1 20:37 intel-ucode.img
drwxr-xr-x 2 root root 4096 Jan 28 18:32 memtest86+
-rw-r--r-- 1 root root 13029888 Feb 5 21:05 vmlinuz-linux
sh-5.2# ls -l /boot/grub
total 128
drwxr-xr-x 2 root root 4096 Oct 16 01:53 fonts
-rw------- 1 root root 35758 Feb 6 19:35 grub.cfg
-rw------- 1 root root 33227 Feb 4 23:33 grub_bup_Mall_240104.cfg
-rw-r--r-- 1 root root 1024 Oct 16 01:53 grubenv
drwxr-xr-x 2 root root 20480 Feb 6 19:27 i386-pc
drwxr-xr-x 2 root root 4096 Feb 6 19:27 locale
drwxr-xr-x 3 root root 4096 Oct 16 01:53 themes
drwxr-xr-x 2 root root 20480 Feb 6 19:26 x86_64-efi
sh-5.2# date
Tue Feb 6 19:39:51 CET 2024
sh-5.2#
artix-live:[root]:/home/artix# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0
iso966 ARTIX_202308 2023-08-14-00-43-51-00 0 100% /run/artix/bootmnt
loop1
squash 0 100% /run/artix/sfs/livefs
loop2
squash 0 100% /run/artix/sfs/rootfs
sda
├─sda1
│ vfat 5A95-31F0
├─sda2
│
├─sda3
│ ntfs CAA295FBA295EBE7
└─sda4
ntfs 98BC3EA5BC3E7DB6
sdb
├─sdb1
│
├─sdb2
│ ext4 DAW15 f6a6caf2-65d3-41f3-9259-d78f25eb161f
├─sdb3
│ swap swap b3ba2d2b-35ab-45aa-8d6e-248d0a061c08
├─sdb5
│ ext4 Artix b831ec28-0001-458e-8233-abf2ab71d0d2
├─sdb6
│ ext4 UbuntuS f6620df0-b417-4b82-aa3b-d194ab6fbe1b
├─sdb7
│ ext4 Void 18430774-c601-4155-bc60-55cf534b6cce
├─sdb8
│ ext4 Fayevid8 87c24924-ff4d-4173-be65-34ad6d495011
├─sdb9
│ ext4 Mint 064eb945-c7b4-4aed-b94a-7de6b83820ef
├─sdb10
│ ext4 Fedora 76bf5ba8-0378-4b63-9a5d-897ae13dcfaf
├─sdb11
│ ext4 Manjaro 47a5d11e-65d4-4420-a7c9-40b444049adc
├─sdb12
│ vfat ESP 4B37-77E9
├─sdb13
│ ext4 StoreMedia 66f97b48-6ce0-49b0-b972-569cac52b488
└─sdb14
ext4 StoreAnnat 7ebd4a9c-8ead-4eea-a27e-a4070d55c956
sdc
├─sdc1
│ ext4 SYS fcaeae55-5b7f-4d3c-90a2-795e31a474ac
├─sdc2
│ ext4 Multi_ISOs 0c2e794c-4881-407f-82a9-2d3e0dbec9d5 3.2G 88% /run/artix/img_dev
├─sdc3
│ vfat EFI 95E3-3884
├─sdc4
│
└─sdc5
swap swap e79cd9bc-81bb-4e97-93ec-5db77c7f5b8c
sr0
artix-live:[root]:/home/artix# swapon /dev/disk/by-label/swap
artix-live:[root]:/home/artix# mount /dev/disk/by-label/Artix /mnt
artix-live:[root]:/home/artix# ls /mnt
bin boot dev etc home lib lib64 lost+found mnt opt proc root run sbin srv sys tmp usr var
artix-live:[root]:/home/artix# ls /mnt/boot
amd-ucode.img efi grub initramfs-linux-fallback.img initramfs-linux.img intel-ucode.img memtest86+ vmlinuz-linux
artix-live:[root]:/home/artix# ls /mnt/boot/efi
artix-live:[root]:/home/artix# mount /dev/disk/by-label/ESP /mnt/boot/efi
artix-live:[root]:/home/artix#
artix-live:[root]:/home/artix# artix-chroot /mnt
sh-5.2# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0
iso966 ARTIX_202308 2023-08-14-00-43-51-00
loop1
squash
loop2
squash
sda
|-sda1
| vfat 5A95-31F0
|-sda2
|
|-sda3
| ntfs CAA295FBA295EBE7
`-sda4
ntfs 98BC3EA5BC3E7DB6
sdb
|-sdb1
|
|-sdb2
| ext4 DAW15 f6a6caf2-65d3-41f3-9259-d78f25eb161f
|-sdb3
| swap swap b3ba2d2b-35ab-45aa-8d6e-248d0a061c08
|-sdb5
| ext4 Artix b831ec28-0001-458e-8233-abf2ab71d0d2 34.5G 23% /
|-sdb6
| ext4 UbuntuS f6620df0-b417-4b82-aa3b-d194ab6fbe1b
|-sdb7
| ext4 Void 18430774-c601-4155-bc60-55cf534b6cce
|-sdb8
| ext4 Fayevid8 87c24924-ff4d-4173-be65-34ad6d495011
|-sdb9
| ext4 Mint 064eb945-c7b4-4aed-b94a-7de6b83820ef
|-sdb10
| ext4 Fedora 76bf5ba8-0378-4b63-9a5d-897ae13dcfaf
|-sdb11
| ext4 Manjaro 47a5d11e-65d4-4420-a7c9-40b444049adc
|-sdb12
| vfat ESP 4B37-77E9 974.7M 2% /boot/efi
|-sdb13
| ext4 StoreMedia 66f97b48-6ce0-49b0-b972-569cac52b488
`-sdb14
ext4 StoreAnnat 7ebd4a9c-8ead-4eea-a27e-a4070d55c956
sdc
|-sdc1
| ext4 SYS fcaeae55-5b7f-4d3c-90a2-795e31a474ac
|-sdc2
| ext4 Multi_ISOs 0c2e794c-4881-407f-82a9-2d3e0dbec9d5
|-sdc3
| vfat EFI 95E3-3884
|-sdc4
|
`-sdc5
swap swap e79cd9bc-81bb-4e97-93ec-5db77c7f5b8c [SWAP]
sr0
sh-5.2# grub-install --recheck /dev/sdb
Installing for x86_64-efi platform.
Installation finished. No error reported.
sh-5.2# rub-install --target=i386-pc /dev/sdb
sh: rub-install: command not found
sh-5.2# grub-install --target=i386-pc /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.
sh-5.2# less /etc/default/grub
sh-5.2# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/artix/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: intel-ucode.img amd-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.
ERROR: mkdir /var/lock/dmraid
Found Fedora Linux 38 (KDE Plasma) on /dev/sdb10
Found Slackware 15.0 x86_64 on /dev/sdb2
Found Ubuntu 22.04.1 LTS (22.04) on /dev/sdb6
Found Void Linux on /dev/sdb7
Found LMDE 6 (faye) on /dev/sdb8
Found LMDE 6 (faye) on /dev/sdb9
Found Artix Linux on /dev/sdc1
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
sh-5.2# ls /boot
amd-ucode.img grub initramfs-linux.img memtest86+
efi initramfs-linux-fallback.img intel-ucode.img vmlinuz-linux
sh-5.2# ls -l /boot
total 65252
-rw-r--r-- 1 root root 81920 Feb 1 19:03 amd-ucode.img
drwxr-xr-x 4 root root 4096 Jan 1 1970 efi
drwxr-xr-x 7 root root 4096 Feb 6 19:35 grub
-rw------- 1 root root 39034670 Feb 5 21:06 initramfs-linux-fallback.img
-rw------- 1 root root 7284069 Feb 5 21:05 initramfs-linux.img
-rw-r--r-- 1 root root 7368704 Feb 1 20:37 intel-ucode.img
drwxr-xr-x 2 root root 4096 Jan 28 18:32 memtest86+
-rw-r--r-- 1 root root 13029888 Feb 5 21:05 vmlinuz-linux
sh-5.2# ls -l /boot/grub
total 128
drwxr-xr-x 2 root root 4096 Oct 16 01:53 fonts
-rw------- 1 root root 35758 Feb 6 19:35 grub.cfg
-rw------- 1 root root 33227 Feb 4 23:33 grub_bup_Mall_240104.cfg
-rw-r--r-- 1 root root 1024 Oct 16 01:53 grubenv
drwxr-xr-x 2 root root 20480 Feb 6 19:27 i386-pc
drwxr-xr-x 2 root root 4096 Feb 6 19:27 locale
drwxr-xr-x 3 root root 4096 Oct 16 01:53 themes
drwxr-xr-x 2 root root 20480 Feb 6 19:26 x86_64-efi
sh-5.2# date
Tue Feb 6 19:39:51 CET 2024
sh-5.2#
I made the mistake of first installing grub as if for bios, before doing it for Bios-GPT.