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
    3
    ·
    1 year ago

    If you’re running under UEFI, GRUB typically installs a bootx64.efi file in the EFI partition (typically under its own little GRUB folder), so that when your computer boots up, the BIOS/UEFI can point to that file and start GRUB, which will then look at its configuration file to find all the preconfigured bootable operating systems that it knows about. BIOS is a little bit different, but the premise is the same - a small executable is placed somewhere that the BIOS can find and execute to launch your OS’ bootloader.

    All os-prober does is look at operating systems that are already mounted and adds them to the configuration file. If a system isn’t mounted, then os-prober (and by extension, GRUB, since the grub.cfg file is where all the OS options are placed) won’t know about it.

    Assuming that you have your fstab file for Archlinux configured correctly (where your EFI partition is mounted under a reasonable directory, such as /boot/efi), you can boot into Ubuntu, mount your Archlinux partion under Ubuntu temporarily, and run sudo grub-mkconfig -o /boot/grub/grub.cfg under Ubuntu to generate the necessary boot option for Archlinux.

    You can install the GRUB package under Archlinux, but there’s no need to install the bootx64.efi file (from sudo grub-install) a second time since that file already exists. It would mostly be used for keeping your grub.cfg up to date. The theming can probably be copied over from Ubuntu’s configuration (but I’m not sure of where it is off the top of my head).

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

      Thanks I always thought ther was a grub for each os and they will recognize each other … Following an other user advices I have added a separate /boot partition to Ubuntu but eventhow I have added the line in the fatab on boot it doesn’t mount properly so I have to manually mount it from the recovery mode… if I select to mount it on boot from the GUI (gnome-disks) it adds a couple of lines in the file /run/systems/generator/boot.mount but nothing changes …can u confirm me that this file is not consulted on boot so its not relevant ? So should I mount the /boot/EFI (already mounted) ,/ , /home and /boot (already mounted) on Ubuntu before updating grub ? Doesn’t this tell to mount the arch os when I boot ubuntu ? … I have just realized could the problem be in the fact that during the arch install I have followed a tutorial which have told me to create a /boot /EFI directory on witch I should mount the EFI partition while in Ubuntu the EFI partition is mounted in /boot/efi that could defenetly be it … how should I proceed to fix it remove the EFI directory with all the stuff there’s in it and mount it on /boot/efi? Don’t wanna mess it up removing stuff is always dangerous… Let me know thanks a lot man I feel like we are getting closer

  • silent_water [she/her]@hexbear.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    you should be able to reuse the /boot partition from arch, I’m pretty sure. you can just update the grub configuration ubuntu set up to add arch to it that way.

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

      Sorry I’m trying to install arch after Ubuntu what did u mean by reusing the boot partition from arch you mean try to update grub from the arch install while in Chroot?

      • silent_water [she/her]@hexbear.net
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        1 year ago

        no like you can skip the entire grub-install part and just mount your ubuntu /boot partition as your boot partition in arch and go through the normal install process. then at the end, you just update the grub.cfg to include the arch install.

        edit: if you don’t have a separate ubuntu /boot partition, you’re going to need to reinstall it with a separate boot partition, or configure the bootloader in arch and do grub-install but stick in the ubuntu boot block into grub.cfg. the issue is that you’re still going to need to update the configuration on the ubuntu side so it uses the arch /boot partition and installs kernels there.

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

          Thanks a lot man I would love to tell you I understand everything but unfortunately the only part that I got was the first and I don’t have a separate boot partition :( so what do you mean by stick in the ubuntu boot block into grub config I have to reinstall grub from arch then I update it making a new .Cfg and then remaining in the arch install I should find and add the other two boot entries ? Should I delete grub before installing it again ? Im asking because I think I have already tried to install it and i believe I was still using the ubuntu one … What about updating grub on the Ubuntu side how am I going to boot into it ? Thanks a lot man I don’t want to waste your time u gave me some nice homeworks I will be back in a few days …

          • silent_water [she/her]@hexbear.net
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 year ago

            no worries! you want a separate boot partition on your hard disk to make this all easier. if you don’t have one already, I would make one, then go back through the arch install. at the end, there should be instructions on how to update the grub.cfg for arch. you’ll need to do the exact same thing for Ubuntu. the only hard part is that Ubuntu is set up right now to not mount a /boot partition so when you install updates, the updated boot images won’t get installed in the right place. so you need to boot into Ubuntu first and change /etc/fstab so it mounts the boot partition to /boot. then you need to run:

            sudo update-bootloader --refresh
            

            then you can go back and do the arch install with the same /boot partition and run grub-install. there’s detailed instructions on how to change the boot partition here and the ArchWiki should have the rest.

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

              Thank you so much it’s like a couple of weeks I’m going back and forth on this topic and this is the biggest step I have done … I will surely let you know if I successfully end up bricking my PC :)

              Btw I’m sorry for any previous gender errors I have just noticed the correct pronouns 😅

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

                  Hey do you know if it’s normal then after mounting the /boot partition, adding this … UUID=1f32… /boot ext4 defaults 0 2 … to the fatab and updating grub with grub-update or white grub mkconfig.io… I can’t no longer boot into Ubuntu ?it puts me in some kind of recovery mode Should I proceed anyway with the arch install ? Does the problem come from the fact I haven’t already reinstalled grub ? PS I have tried the --refresh flag but apparently it doesn’t exist …