You are not logged in.

#1 2025-03-04 18:06:32

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Setting up the bootloader for ArchLinux as second install (SOLVED).

The installation guide says:

    Choose and install a Linux-capable boot loader.

This is really not helpful, and neither is the link it points to.

I have just successfully...maybe...installed ArchLinux on a separate SSD in my XUbuntu 20 system. /dev/sda1 is the EFI boot partition. All I need to do is to add an entry to it to point to /dev/sdb5 which is my ArchLinux boot partition.

I have no idea.

Running efibootmgr on my XUbuntu intstall I can see EFI files and...stuff...I have no idea. I presumably need to generate a file on my /boot/efi partition in some way and then use efibootmgr to point to it with a new boot entry?


Please can someone update the installation guide.

Please can someone tell me how to get my existing EFI boot partition to have an entry for my new ArchLinux install.

In addition, I would love to know how to rename my existing "Ubuntu" entry to "XUbuntu 20" as I will soon be installing XUbuntu 24 as well...if I can figure out how to tell the installer EXACTLY which partitions it should be using.

Last edited by JontomXire (2025-07-08 16:40:27)

Offline

#2 2025-03-04 18:28:45

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 272

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Xubuntu uses GRUB right? Can't you just add an entry in there for Arch?

Log into Xubuntu, mount arch drives, run update-grub

If you're dual-booting (or more), then generally you have just the one boot loader on the "primary" OS, in your case that sounds like Xubuntu, which will likely already be running GRUB, so just use that. Effectively you've already installed a boot loader, just not through Arch.

Last edited by Nikolai5 (2025-03-04 18:31:16)


Ryzen 7 9850X3D | AMD 7800XT | KDE Plasma

Offline

#3 2025-03-05 08:09:17

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

In future I want to remove the XUbuntu install and blat all the partitions (except the EFI boot partition) and re-use the disk. Will that stop Arch Linux from working because the XUbuntu boot partition is gone, or does update-grub update the menu provided by efibootmgr which is on the EFI boot partition?

How do I rename entries? When I install XUbuntu 24 I will end up with 2 "Ubuntu" boot entries.

Thanks for your help.

Offline

#4 2025-03-05 09:40:02

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 272

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

If Xubuntu update-grub works in that it picks up Arch and adds an entry, which it should, then that might be the easiest solution for now, and then ther's nothing stopping you when you wipe out everything else if you can't then boot, use the arch ISO, chroot in, install a boot loader like GRUB. and there you go.
If you want to use GRUB on Arch, read the wiki page on it, we don't use update-grub, it's grub-mkconfig.

If you find there are EFI boot entries you want to clean up, you can use efibootmgr, and I believe the comands are:

This to list entries, you'll see a boot current value, 4 digits.

efibootmgr -v

You can use those 4 digits to remove the entry with this command:

sudo efibootmgr -b <bootnum> -B

e.g. sudo efibootmgr -b 0001 -B

-b | --bootnum XXXX   Modify BootXXXX (hex).
-B | --delete-bootnum Delete bootnum.


You can use this to clean up EFI after the fact, the bootloader side of things should be fairly simple. Just give the wiki read for grub, or systemd-boot if you want to use that instead, use whatever you're comfortable with.

Last edited by Nikolai5 (2025-03-05 09:47:13)


Ryzen 7 9850X3D | AMD 7800XT | KDE Plasma

Offline

#5 2025-03-05 10:03:47

kermit63
Member
Registered: 2018-07-04
Posts: 370

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

I'm not saying this is your case, but most newbies expect a one-page solution to their problem from the Arch wiki.

The Arch wiki is not configured that way. It expects you to click on linked pages, and sometimes even linked pages of the 1st level of linked pages, to understand how to configure Arch properly.

-----

If your intention is to remove Xubuntu in the future, in may be worthwhile to install GRUB in Arch, then let Arch grub and os-prober control the other Xubuntu installs. Of course what Nikolai suggested is also possible.

Last edited by kermit63 (2025-03-05 10:27:42)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#6 2025-03-05 17:49:27

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

@Nikolai5 That worked, but after tweaking a few things and installing XFCE, the system crashes as soon as I try to run ArchLinux, before (apparently) even getting anywhere near systemd. Possibly due to my configuring an encrypted partition. I need to investigate.

@kermit63 I clicked on the linked page, but that had so many links - eventually you get lost in lots of twisty passages that all look the same (kudos to anyone who gets the reference...and a zimmer frame). A few examples would be wonderful. I usually find a google search a better way of navigating such wikis, but couldn't find anything this time.

Offline

#7 2025-03-05 18:02:59

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

I get about 4 lines of errors. They don't last long enough for me to make a proper note of them, but the first starts:

    error: no such device: 4321e1...

The UUID is of my Arch linux boot partition. The final line of the errors says something about needing to load a kernel.


I have removed the entries from /etc/crypttab and /etc/fstab that I made earlier and it still doesn't boot.


I wanted something that gave me more control than XUbuntu, and wouldn't require such a major version update every three years that I would essentially need to backup everything and re-install my machine (the major version upgrades always break the system for me). However I wasn't expecting something as low level as Arch Linux. I'm kinda enjoying it when things work...but not so much when it dies like this.

Maybe I need to look at an OS based on ArchLinux, rather than ArchLinux itself.

Offline

#8 2025-03-05 22:50:23

kermit63
Member
Registered: 2018-07-04
Posts: 370

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

You have to provide more concrete data for people here to help you. The error you're getting hints very strongly at a misconfigured /etc/fstab. You need to show us, at the very least:

1. The exact contents of /etc/fstab.
2. The output of lsblk so we can make sense of the UUIDs in /etc/fstab and also to give us an idea of your partitioning scheme.

Since you also mentioned /etc/crypttab, it tells me you're attempting some sort of encryption. That's something you should have mentioned at the very start. You should also tell us more on how you went about encrypting stuff. One possible problem is your /boot is inside your encrypted root. We can't know that since you haven't provided anything to prove or disprove that possibility.

GRUB working with encrypted systems is a major pitfall for arch newbies.

Last edited by kermit63 (2025-03-05 22:53:58)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#9 2025-03-06 10:34:41

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

The encryption is on the main partition (/) for the old XUbuntu install, and the new HDD that I hope to mount on /home in future. /boot and / for ArchLinux are not encrypted.

It booted once successfully. I then:

- Added a number of packages like XFCE.
- Added  a /etc/fstab entry to mount /dev/sda1 on /boot/efi (removing this entry did not solve the problem).
- Added an entry to /etc/crypttab to decrypt /dev/sdd (removing this entry did not solve the problem).

I also removed the entry that I had previously added using efibootmgr, but I am fairly sure I did that before the first successful boot to Arch Linux.

After doing all my updates I rebooted, selected Arch Linux at the grub prompt, and it failed to boot this time. I removed my changes to /etc/fstab and /etc/crypttab, one by one, by booting to XUbuntu 20, mounting the partition, and editing the files. undoing those changes did not solve the boot failure.


Output of lsblk (while running XUbuntu 20):

```
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0            7:0    0  73.9M  1 loop  /snap/core22/1722
loop1            7:1    0  73.9M  1 loop  /snap/core22/1748
loop2            7:2    0  44.4M  1 loop  /snap/snapd/23545
loop3            7:3    0  44.3M  1 loop  /snap/snapd/23258
sda              8:0    0 447.1G  0 disk 
├─sda1           8:1    0   512M  0 part  /boot/efi
├─sda2           8:2    0   732M  0 part  /boot
└─sda3           8:3    0 445.9G  0 part 
  └─sda3_crypt 253:0    0 445.9G  0 crypt /
sdb              8:16   0 223.6G  0 disk 
├─sdb1           8:17   0     8G  0 part 
├─sdb2           8:18   0     1K  0 part 
├─sdb3           8:19   0     2G  0 part 
├─sdb4           8:20   0 105.8G  0 part 
├─sdb5           8:21   0     2G  0 part 
└─sdb6           8:22   0 105.8G  0 part 
sdc              8:32   0 465.8G  0 disk 
└─sdc1           8:33   0 465.8G  0 part  /data
sdd              8:48   0 465.8G  0 disk 
├─sdd2           8:50   0  48.5G  0 part 
└─new_home     253:1    0 465.8G  0 crypt /mnt/new_home
```

Output of blkid (while running XUbuntu 20):

```
/dev/mapper/sda3_crypt: UUID="51dacb9b-0c05-4fa7-afde-119f0e065dfb" TYPE="ext4"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/sda1: UUID="8ED1-2CC6" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="d40a0986-3179-48d8-8f86-80c14986742b"
/dev/sda2: UUID="0687aa79-d028-4e19-bd6c-f34b675258df" TYPE="ext4" PARTUUID="1f780c7d-e0e6-4ad8-9452-21e21caade67"
/dev/sda3: UUID="48e8a5f1-0083-40ef-bd61-731b5d5e29e0" TYPE="crypto_LUKS" PARTUUID="3534dc02-1414-46d7-b070-f494c71e325f"
/dev/sdb1: LABEL="swap" UUID="754eebd1-bdee-4423-a12e-35893b80dcdb" TYPE="swap" PARTUUID="cac506cf-01"
/dev/sdb3: LABEL="ubuntu_boot" UUID="49a8061e-47e6-46b3-8b47-bf501837655c" TYPE="ext4" PARTUUID="cac506cf-03"
/dev/sdb4: LABEL="ubuntu_root" UUID="b32d2b2d-5d70-43c6-a81b-65a115b5b8a7" TYPE="ext4" PARTUUID="cac506cf-04"
/dev/sdb5: LABEL="arch_boot" UUID="4321e1d7-0523-466f-ac7c-ef520ff899b3" TYPE="ext4" PARTUUID="cac506cf-05"
/dev/sdb6: LABEL="arch_root" UUID="03b24a09-90c3-42ea-919e-465345f65ae9" TYPE="ext4" PARTUUID="cac506cf-06"
/dev/sdc1: UUID="eda659b1-abef-481f-95a9-b56823b3a51a" TYPE="ext4" PARTUUID="aa22faf0-fc7e-4a50-8bb1-1d453b31088c"
/dev/mapper/new_home: UUID="815e5f0e-3e04-4f05-ae61-4e134f1d0964" TYPE="ext4"
```

The /etc/fstab is a bit irrelevant as that is used by systemd much much later. The failure is at the grub stage before any of the initialisation steps begin. Do you want to see the one from XUbuntu 20 or ArchLinux?

Offline

#10 2025-03-06 11:02:31

kermit63
Member
Registered: 2018-07-04
Posts: 370

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Let me see if my grasp of the problem is correct:

1. The grub entry for arch from xubuntu works in the sense that it tries to load the arch kernel. It fails because it can't locate the /boot partition of arch.

2. As far as arch is concerned, only the /home partition is encrypted, hence the need for /etc/crypttab to unlock it.

AFAIK, the /etc/fstab from arch could be important since it defines where /boot is located. Wouldn't hurt to give it a second look. I could be wrong though since I haven't dual-booted 2 linux distros in a very long time.

------

TIP: You should enclose outputs with the code tag to make them more readable. This is particularly useful for very long contents and those that can benefit from tabular alignment.

-----

Are you open to the idea of installing grub on arch, so we can boot arch independently from Xubuntu? The idea here is to make sure your arch installation is working, without having to worry about the linkage between Xubuntu's Grub and the arch installation.

Last edited by kermit63 (2025-03-06 11:12:45)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#11 2025-03-07 07:22:16

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Ok, so firstly some hopefully useful information. I tried again this morning and was able to write down the part of the error message that said "disk hd1,msdos5 not found". Looking in the grub.cfg in my XUbuntu's /boot/grub, I see:

    menuentry 'Arch Linux (on /dev/sdb6)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-03b24a09-90c3-42ea-919e-465345f65ae9' {
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos5'
        if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  4321e1d7-0523-466f-ac7c-ef520ff899b3

I see "hd1,msdos5" mentioned in several places there. Also note that it says Arch Linux ison /dev/sdb6, which is correct, but not where the kernel is. The kernel etc. is on /dev/sdb5. This file is auto generated so I don't see much point making edits that will just get overridden. I am going to investigate to see if there is a way I can set something up so it adds a "custom" entry.

--------

Your grasp of the problem looks absolutely correct. I am totally open to installing grub on arch, if you can tell me how to get the efibootmgr to look on /dev/sdb5 and how I can set it up. I already installed it using pacman, but there are still no grub files on /dev/sdb5 at all.

------

<quote>
TIP: You should enclose outputs with the code tag to make them more readable. This is particularly useful for very long contents and those that can benefit from tabular alignment.
</quote>

I tried. You see the "```" before and after? It works on other sites and gitlab. This forum does not have a handy helpful bar with quick formatting buttons. I cannot, anywhere, see a link to a page that describes the formatting options. These are things that I have come to expect from such sites.

I modified the grub.cfg to try and achieve this with indenting, which works on StackOverflow and other such sites. Still no joy.

Please forgive my lack of omniscience. I have no clue how to achieve this and this site is not trying to educate me AT ALL in this regards.

Offline

#12 2025-03-07 07:58:22

kermit63
Member
Registered: 2018-07-04
Posts: 370

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

click on the BBCode link at the bottom of the screen. It should give you some idea on how to format stuff on this forum. Note the use of square brackets instead of less than and greater than sign.

-----

Let's forget about Xubuntu for the moment. I really want to see your /etc/fstab from arch.

Take a look at the GRUB wiki page for details on how to get GRUB working on Arch. You have to be very careful about the following:

1. It's very important that the arguments you passed on to the grub-install command is consistent with how the partitions are being mounted according to /etc/fstab. Of special interest are the EFI partition and the /boot partition.

2. The grub-mkconfig command looks at the file /etc/default/grub for configuration instructions. Have a look at that file.

3. Check if your /boot partition contains the grub folder, plus the vmlinuz and initramfs files. If they're not, you did something wrong during initial installation and must be corrected. We'll cross that bridge when we get there.

-----

I'm assuming you're already familiar wtih arch-chrooting into your installed arch. Once arch-chrooted, check if the appropriate partitions are being mounted to the proper mount points before doing grub-install and grub-mkconfig.


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#13 2025-03-07 08:01:20

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Actually, I think I would prefer to put grub under Arch Linux. One of the reasons I am moving away from XUbuntu is the fact that the LTS now only lasts 3 years. If I am going to be re-installing every 3 years, then I would prefer not to have to repeat grub configuration every time. However it would be good if the grub boot entry for XUbuntu automatically updated every time the kernel updated.

Would it be possible to have an Arch Linux maintained grub that had entries for XUbuntu and Arch Linux, and if you pick XUbuntu it triggers a second grub maintained by XUbuntu?

Offline

#14 2025-03-07 08:08:31

kermit63
Member
Registered: 2018-07-04
Posts: 370

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

JontomXire wrote:

Would it be possible to have an Arch Linux maintained grub that had entries for XUbuntu and Arch Linux, and if you pick XUbuntu it triggers a second grub maintained by XUbuntu?

I haven't been dual-booting for a long time, but IIRC arch's grub will create an entry for xubuntu using os-prober. It will boot directly into xubuntu without going through xubuntu's grub.

Perhaps someone with more recent experience on dual-booting can validate this.

Last edited by kermit63 (2025-03-07 08:09:03)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#15 2025-03-07 08:23:55

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

I just wrote a custom grub entry in /etc/grub.d based on what the os-prober produced and using "gpt5" instead of "hd5". I then disabled the os-prober and ran update-grub.

I am so embarrassed.

My entry is definitely there in /boot/grub/grub.cfg, but when I reboot the bootloader goes straight to XUbuntu and no longer even shows the menu.

Here is the grub.cfg entry. Please don't laugh:

### BEGIN /etc/grub.d/11_arch_linux ###

menuentry "Arch Linux" --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-03b24a09-90c3-42ea-919e-465345f65ae9' {
    recordfail
    load_video
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt5'
    if [ x = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 4321e1d7-0523-466f-ac7c-ef520ff899b3
    else
        search --no-floppy --fs-uuid --set=root 4321e1d7-0523-466f-ac7c-ef520ff899b3
    fi
    linux /vmlinuz-linux root=UUID=03b24a09-90c3-42ea-919e-465345f65ae9
    initrd /initramfs-linux.img
}

### END /etc/grub.d/11_arch_linux ###

I also just realised that "BBCode" just under this window is actually a link. It doesn't have an underline!

Offline

#16 2025-03-07 09:30:55

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Using `gpt` instead of `msdos` didn't work.

Offline

#17 2025-03-07 09:38:11

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 272

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Might be a silly question, but does initramfs-linux.img exist?

It should be in /boot

It's produced by mkinitcpio


Ryzen 7 9850X3D | AMD 7800XT | KDE Plasma

Offline

#18 2025-03-07 17:04:28

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

It's failing WAAAY before that.

So I logged into the grub console after making notes on the contents of the grub.cfg. When I run the "search" command for the XUbuntu boot partition, it finds it. When I do the same command for the Arch linux boot partition it didn't. And I didn't double check that the UUID was correct, I triple checked it. Twice. It looks like the search command is only searching the first hard drive.

I am wondering if I need an efibootmgr entry for Arch Linux just to get it to scan the other SSD.

Offline

#19 2025-03-07 17:16:40

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

So that worked. No idea why.

What worked? This:

  • I copied the "ubuntu" folder under /boot/efi to "arch_linux".

  • I deleted all the EFI files except the "grubx64" one.

  • I tweaked the grub.cfg to use the UUID and hd/gpt values for the Arch Linux boot partition.

  • I used efibootmgr to add an entry pointing to the grub EFI file under the "arch_linux" folder.

  • I rebooted.

The new entry was first in the list but, probably because there is no actual boot loader on the Arch Linux boot partition, I got the grub menu from the XUbuntu boot partition. Maybe forcing it to scan that boot partition first set up some data for the grub search command to work correctly when the XUbuntu grub bootloader ran.

This article seems relevant, but I am not sure I really understand it: https://askubuntu.com/questions/1252071 … disk-drive

I am definitely finding all this challenging and interesting, I am learning new stuff, but I am not as young as I used to be, I have a mentally challenging day job, and my brain is starting to hurt. Sometimes I just want stuff to "just work".

Offline

#20 2025-03-08 17:55:44

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

JontomXire wrote:

Would it be possible to have an Arch Linux maintained grub that had entries for XUbuntu and Arch Linux, and if you pick XUbuntu it triggers a second grub maintained by XUbuntu?

Add this stanza at the end of the file at /etc/grub.d/40_custom (replace $uuid with the actual filesystem UUID for Xubuntu's root partition):

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

Use grub-mkconfig(8) to add the new menuentry to /boot/grub/grub.cfg in Arch.


Jin, Jîyan, Azadî

Offline

#21 2025-03-10 07:18:40

JontomXire
Member
Registered: 2025-03-04
Posts: 48

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

Thanks.

Wouldn't `update-grub` work just as well as `grub-mkconfig`?

Offline

#22 2025-03-10 07:31:07

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Setting up the bootloader for ArchLinux as second install (SOLVED).

The update-grub command is just a thin wrapper around grub-mkconfig: https://salsa.debian.org/grub-team/grub … pdate-grub

And anyway it isn't available in Arch.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB