You are not logged in.

#1 2024-09-07 08:57:39

4shan
Member
Registered: 2024-09-07
Posts: 8

[SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

I installed Ubuntu 24.04 alongside with Arch linux , now i am not seeing the option to boot into Arch. I have installed both of them on same drive but on different partitions.

lsblk
nvme0n1     259:0    0 476.9G  0 disk
├─nvme0n1p1 259:1    0     1G  0 part /boot/efi
├─nvme0n1p2 259:2    0   175G  0 part
├─nvme0n1p3 259:3    0 150.9G  0 part
└─nvme0n1p4 259:4    0   150G  0 part /

Arch linux is in p2 and Ubuntu is in p4

Last edited by 4shan (2024-09-07 16:32:24)

Offline

#2 2024-09-07 09:53:37

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Did you let Ubuntu install it's version of GRUB?

You probably just have to enable os-prober with this line in /etc/default/grub in your Ubuntu system:

GRUB_DISABLE_OS_PROBER=false

Then update the configuration (in Ubuntu).

Or run the grub-install command again from Arch to let that system control the configuration but then you would have to either update the Ubuntu configuration every time that kernel is updated or make a custom menuentry that points to the /vmlinuz & /initrd.img symlinks in Ubuntu that always point to the current kernel version.

Last edited by Head_on_a_Stick (2024-09-07 09:54:05)


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#3 2024-09-07 10:47:37

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

Did you let Ubuntu install it's version of GRUB?

I did the default installation.
Now can i just remove the partition and reinstall ubuntu without its grub ?

Head_on_a_Stick wrote:

You probably just have to enable os-prober with this line in /etc/default/grub in your Ubuntu system:

so i updated the config and then ran

grub-mkconfig -o /boot/grub/grub.cfg
output:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.0-41-generic
Found initrd image: /boot/initrd.img-6.8.0-41-generic
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
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.
Adding boot menu entry for UEFI Firmware Settings ...
done

i still not see the arch linux in boot menu

Head_on_a_Stick wrote:

Or run the grub-install command again from Arch to let that system control the configuration but then you would have to either update the Ubuntu configuration every time that kernel is updated or make a custom menuentry that points to the /vmlinuz & /initrd.img symlinks in Ubuntu that always point to the current kernel version.

how do i access the arch linux

Last edited by 4shan (2024-09-07 10:49:39)

Offline

#4 2024-09-07 12:08:46

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

4shan wrote:

Now can i just remove the partition and reinstall ubuntu without its grub ?

No need for that, even with Ubuntu. You could let Arch take control by running the grub-install command from there but I think it is actually better to keep Ubuntu for the bootloader while you have it installed. Arch is easier to manage as a subsidiary because the kernel & initramfs images are not versioned. Ubuntu & Debian also offer non-versioned symlinks for those images but grub-mkconfig does not take advantage of them.

4shan wrote:

i still not see the arch linux in boot menu

Was /dev/nvme0n1p1 used by your Arch system? I have no idea if the Ubuntu installer would format the ESP but if it did and you were using that for Arch's /boot/ then Arch's kernel & initramfs would have been wiped, which would mean os-prober wouldn't present an entry for the boot menu.

Check /dev/nvme0n1p2 for /boot/vmlinuz-linux, if that exists then mount that partition in Ubuntu before updaing the configuration again:

# mount /dev/nvme0n1p2 /mnt
# update-grub
4shan wrote:

how do i access the arch linux

Mount the root partition then use arch-chroot to gain a shell in the system with the API filesystems mounted. I don't think that's the best path here though, for reasons outlined above.

EDIT: the arch-chroot command is supplied by the arch-install-scripts package, which should be available for Ubuntu 24.04.

Last edited by Head_on_a_Stick (2024-09-07 12:11:12)


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#5 2024-09-07 12:18:06

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

Was /dev/nvme0n1p1 used by your Arch system? I have no idea if the Ubuntu installer would format the ESP but if it did and you were using that for Arch's /boot/ then Arch's kernel & initramfs would have been wiped, which would mean os-prober wouldn't present an entry for the boot menu.

i dont  remember , but i think that's the cases. i did the default install of arch using arch-intsall. what should i do you if the ESP files are deleted.

Head_on_a_Stick wrote:

Check /dev/nvme0n1p2 for /boot/vmlinuz-linux, if that exists then mount that partition in Ubuntu before updaing the configuration again:

it is mounted here the files in the root , and i checked the boot folder is empty

drwxr-xr-x 1 root root     50 Jul  8 12:41  ./
drwxr-xr-x 1 root root    254 Sep  5 21:27  ../
drwxr-xr-x 1 root root    142 Jul  8 12:44 '@'/
drwxr-xr-x 1 root root     18 Jul 14 13:33 '@home'/
drwxr-xr-x 1 root root    142 Sep  5 15:10 '@log'/
drwxr-xr-x 1 root root 251562 Sep  5 20:26 '@pkg'/
drwxr-xr-x 1 root root      0 Jul  8 12:41 '@.snapshots'/

Offline

#6 2024-09-07 12:42:45

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

4shan wrote:

i did the default install of arch using arch-intsall

You should probably share /var/log/archinstall/install.log here then.

4shan wrote:

what should i do you if the ESP files are deleted

Either (arch-)chroot into the system and re-install the kernel with the Arch system's /boot/ mounted under the ESP or re-install the kernel to the root partition (ie, without /dev/nvme0n1p1 mounted under /boot/ in the Arch system), which I think will be the better option.

So from a normal user shell in Ubuntu:

sudo -i
apt-get install arch-install-scripts # does Ubuntu still use apt-get? I have no idea!
mount -o subvol=@ /dev/nvme0n1p2 /mnt
arch-chroot /mnt /bin/su -
sed -i '/boot/d' /etc/fstab # delete /boot/ line in fstab
mount -a # mount remaining lines in fstab
pacman -Syu linux
exit
update-grub
umount /mnt
apt-get purge arch-install-scripts
exit

EDIT: corrected 1st mount command for subvolume. D'oh!

Last edited by Head_on_a_Stick (2024-09-07 12:55:02)


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#7 2024-09-07 13:26:42

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

You should probably share /var/log/archinstall/install.log here then.

there are no logs

Head_on_a_Stick wrote:

Either (arch-)chroot into the system and re-install the kernel with the Arch system's /boot/ mounted under the ESP or re-install the kernel to the root partition (ie, without /dev/nvme0n1p1 mounted under /boot/ in the Arch system), which I think will be the better option.
.

So from a normal user shell in Ubuntu:

sudo -i
apt-get install arch-install-scripts # does Ubuntu still use apt-get? I have no idea!
mount -o subvol=@ /dev/nvme0n1p2 /mnt
arch-chroot /mnt /bin/su -
sed -i '/boot/d' /etc/fstab # delete /boot/ line in fstab
mount -a # mount remaining lines in fstab
pacman -Syu linux
exit
update-grub
umount /mnt
apt-get purge arch-install-scripts
exit

EDIT: corrected 1st mount command for subvolume. D'oh!

so i ran the commands here's the output
https://paste.mozilla.org/sjrgEbZc

after that when i reboot is see arch in the boot menu but when i select it i see this error
https://imgur.com/a/OnVs3YU

Offline

#8 2024-09-07 13:41:41

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Ah yes, silly me — /dev/nvme0n1p2 needs to be mounted plainly so the subvolumes are exposed correctly to grub-mkconfig.

sudo mount /dev/nvme0n1p2 /mnt
sudo update-grub
sudo umount /mnt

"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#9 2024-09-07 13:46:30

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

Ah yes, silly me — /dev/nvme0n1p2 needs to be mounted plainly so the subvolumes are exposed correctly to grub-mkconfig.

sudo mount /dev/nvme0n1p2 /mnt
sudo update-grub
sudo umount /mnt

now the arch linux option is gone in the boot menu.
i only ran the above 3 command.
do i have chroot again and repeat the process ?

Offline

#10 2024-09-07 13:53:23

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

How about when you run `update-grub` without /dev/nvme0n1p2 mounted at all? I'm not sure how Ubuntu's version works.

Does /dev/nvme0n1p2 contain /@/boot/vmlinuz-linux?


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#11 2024-09-07 13:56:43

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

How about when you run `update-grub` without /dev/nvme0n1p2 mounted at all? I'm not sure how Ubuntu's version works.

still not detected

Head_on_a_Stick wrote:

Does /dev/nvme0n1p2 contain /@/boot/vmlinuz-linux?

yes

drwxr-xr-x 1 root root   [quote=Head_on_a_Stick]   440 Sep  7 10:59 ./
drwxr-xr-x 1 root root      254 Sep  5 21:27 ../
-rw-r--r-- 1 root root   287442 Aug  2 19:15 config-6.8.0-41-generic
drwxr-xr-x 4 root root     4096 Jan  1  1970 efi/
drwxr-xr-x 1 root root       94 Sep  7 18:54 grub/
lrwxrwxrwx 1 root root       27 Sep  5 21:29 initrd.img -> initrd.img-6.8.0-41-generic
-rw-r--r-- 1 root root 70677546 Sep  7 10:59 initrd.img-6.8.0-41-generic
lrwxrwxrwx 1 root root       27 Sep  5 21:29 initrd.img.old -> initrd.img-6.8.0-41-generic
-rw-r--r-- 1 root root   142796 Apr  8 21:12 memtest86+ia32.bin
-rw-r--r-- 1 root root   143872 Apr  8 21:12 memtest86+ia32.efi
-rw-r--r-- 1 root root   147744 Apr  8 21:12 memtest86+x64.bin
-rw-r--r-- 1 root root   148992 Apr  8 21:12 memtest86+x64.efi
-rw------- 1 root root  9058665 Aug  2 19:15 System.map-6.8.0-41-generic
lrwxrwxrwx 1 root root       24 Sep  5 21:29 vmlinuz -> vmlinuz-6.8.0-41-generic
-rw------- 1 root root 14948744 Aug  2 19:39 vmlinuz-6.8.0-41-generic
lrwxrwxrwx 1 root root       24 Sep  5 21:29 vmlinuz.old -> vmlinuz-6.8.0-41-generic

Last edited by 4shan (2024-09-07 13:57:40)

Offline

#12 2024-09-07 13:58:41

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

That looks like an Ubuntu filesystem. I was asking about the (btrfs) filesystem on /dev/nvme0n1p2, which you claimed to be Arch.


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#13 2024-09-07 14:24:32

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

That looks like an Ubuntu filesystem. I was asking about the (btrfs) filesystem on /dev/nvme0n1p2, which you claimed to be Arch.

Sorry my bad , i didn't CD properly

here's the correct one

drwxr-xr-x 1 root root       120 Sep  7 18:12 ./
drwxr-xr-x 1 root root       142 Jul  8 12:44 ../
-rw------- 1 root root 128396317 Sep  7 18:12 initramfs-linux-fallback.img
-rw------- 1 root root  18241730 Sep  7 18:11 initramfs-linux.img
-rw-r--r-- 1 root root  13406720 Sep  7 18:11 vmlinuz-linux

Offline

#14 2024-09-07 16:11:28

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

So it looks like Ubuntu's os-prober and/or grub-mkconfig can't handle the Arch subvolumes properly.

I think the best approach here is to generate /boot/grub/grub.cfg for the Arch system and use that in Ubuntu's bootloader.

So from Ubuntu (all commands need to be run as root):

mount -o subvol=@ /dev/nvme0n1p2 /mnt
arch-chroot /mnt /bin/su -
mount -a
grub-mkconfig -o /boot/grub/grub.cfg
exit

Then add this to the end of the file at /etc/grub.d/40_custom in Ubuntu:

menuentry 'Arch' {
   search --fs-uuid --set=root $uuid
   configfile /@/boot/grub/grub.cfg
}

^ Replace $uuid with the actual filesystem UUID for the Arch partition then save the file and run `update-grub` to add it to Ubuntu's boot menu.

Alternatively write your own custom menuentry for Arch that starts it directly without needing grub.cfg in Arch.


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#15 2024-09-07 16:26:00

4shan
Member
Registered: 2024-09-07
Posts: 8

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

It worked , now i can access Arch.
Thankyou man for all the help.

Also can you guide me if in future i want to dual boot two linux systems , what should be the standard  approach for doing it.

Offline

#16 2024-09-07 17:00:08

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,148
Website

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

For dual-booting with Arch it is usually best to let the other distribution control and configure the bootloader, as we have done here.


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Offline

#17 Yesterday 22:33:02

yxcv
Member
Registered: 2024-02-13
Posts: 38

Re: [SOLVED] Dula boot arch linux & ubuntu, Arch linux not showing in Grub

Head_on_a_Stick wrote:

For dual-booting with Arch it is usually best to let the other distribution control and configure the bootloader, as we have done here.

Some machines, e.g. HP or Asrock for instance can check all blocks,  bootable or not (bootable ich much better :-) an make  list,   HP want some escape and then F9, Asrock wants a decision to manage the setup with F2 or decide per F11 wich bootable Block to start. That's not bad and there ist a list to find, which machine uses what a start needs. HP is a bit courous, but works perfekt. It is older. The fact is by that way, whatever you want to boot, you can boot when it is bootable. It is better or not to use a virtual Machine? But that needs GUI. And then you have a real doubleboot. Think about XEN then.


Elektrische Energie garantiert bis
5024 OHNE neue Uranbergwerke
und ganz ohne westliche Hilfe

Offline

Board footer

Powered by FluxBB