hy im trying to install arch as the third os on my windows / ubuntu machine and i cant figure it out how to set the grub bootloader i have already read the friendly manual but probably also due to my non native English origins i coudnt find an answer to my question witch is during the arch install should i reinstall grub with grub-install ? i would prefer to keep the old (ubuntu) one also because its already customized but unfortunately i cant…if i dont install it i dont have the directory /boot/grub in witch i should place the grub.conf file so should i just create this directory ? i have tried with os-prober correctly activated to generate a new grub.conf but it doesnt pick up the arch install …, what are the files i must have to make grub recognize those partitions as a new os to witch assign a new boot entry …

  • mectx02@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Apologies for the longer delay this time, but I needed to have a play with a similar scenario since I haven’t worked with LVM.

    I set up a VM with Kubuntu (just out of preference; everything else compared to Ubuntu should be the same) and Archlinux similar to your setup (sans LUKS encryption - only wanted to test one thing at a time). I started with installing Kubuntu and letting it do LVM however it wanted, then shrunk it down and installed Archlinux afterwards.

    When I was using Ubuntu’s GRUB and letting it do the configuration, it could “find” the Archlinux partition, but it refused to boot it on the basis of “can’t find kernel image” error. Manhandling it produced similar results - it just refused to boot.

    Using Archlinux’s GRUB, however, worked flawlessly. It even detected and booted up Kubuntu just fine.

    Having a look at the GRUB configuration files, it looks like there’s a difference between the options…

    Kubuntu’s GRUB config for booting Archlinux:

    menuentry 'Arch Linux (on /dev/mapper/vgkubuntu-archlinux)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--/dev/mapper/vgkubuntu-archlinux' {
                    insmod part_gpt
                    insmod lvm
                    linux /boot/vmlinuz-linux root=/dev/mapper/vgkubuntu-archlinux rw loglevel=3 quiet
                    initrd /boot/initramfs-linux.img
            }
    

    Archlinux’s default GRUB config:

    menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-42a47177-8802-48bf-93d1-376419d431e5' {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_gpt
            insmod lvm
            insmod ext2
            set root='lvmid/F8XGRm-mOlV-RmRq-sFoj-IBYw-7D8q-lNxCOg/ubT282-XqAq-DvJg-fj4H-bfpQ-1P4f-5215v9'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint='lvmid/F8XGRm-mOlV-RmRq-sFoj-IBYw-7D8q-lNxCOg/ubT282-XqAq-DvJg-fj4H-bfpQ-1P4f-5215v9'  42a47177-8802-48bf-93d1-376419d431e5
            else
              search --no-floppy --fs-uuid --set=root 42a47177-8802-48bf-93d1-376419d431e5
            fi
            echo    'Loading Linux linux ...'
            linux   /boot/vmlinuz-linux root=/dev/mapper/vgkubuntu-archlinux rw  loglevel=3 quiet
            echo    'Loading initial ramdisk ...'
            initrd  /boot/initramfs-linux.img
    }
    

    Notice a difference?

    Granted, there’s a lot of extra fluff in there, but I noticed that it looks like GRUB has no idea where the root is for the LVM when using (K)Ubuntu’s config. Which is, frankly, just lazy - if you go the other way, Archlinux correctly recognizes the required defaults for booting the other operating system. (I suspect a bug report should be filed, but, eh.)

    So, here’s an option:

    1. Boot into Archlinux and have it install its GRUB. (Yes, an extra grub installation with grub-install is necessary since the EFI needs to point to the Archlinux install.)
    2. Generate a GRUB configuration file within Archlinux. (os-prober should work just fine on Archlinux since I’ve seen their version generating much more workable configurations for other operating systems.)
    3. Copy over the theming from Ubuntu’s GRUB into Archlinux’s GRUB config. (This is mostly just for style points - you can theme GRUB however you like).

    Hopefully that works a little better.

    • DNOS@reddthat.comOP
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Wow thanks so much such a dedication this time i thought i have tried them all … yeah i should probably have mentioned that i have only arch on lvm while Ubuntu Is still on a normal partition like Windows but i think your test Is still usefull since somehow while i was trying to make arch appear on the boot screen by mounting all its partition from Ubuntu and generating a new GRUB file and fstab i got the same error you had of loading the kernel First i Will defently give It a shot… since its Easier to recognise what grub I’m using if I don’t theme them the same way I will skip that step … I have a feeling that notthing will change because I have already tried to reinstall grub with gru-install (I believe im not removing it first but I’m installing a new one on top ) but I always get the themed one on boot …

      • mectx02@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        If you reinstall GRUB from ArchLinux and get the Ubuntu themed one on reboot, might be wort going into your UEFI/BIOS and manually selecting which EFI file to boot from. Probably would be labeled “arch” or something similar.