You are not logged in.

#1 2025-02-24 10:21:05

stefabat
Member
Registered: 2020-04-21
Posts: 8

[SOLVED] Can't boot into system under UEFI after wiping boot partition

Hello,

I have arch on my laptop installed to boot with UEFI. Yesterday, while trying to format another ssd, I erroneously wiped out the boot partition (and maybe even some other logical volume of my root, but that is not too bad of a problem). Luckily, I realized this before turning off my computer, and reformatted it to fat32, set it to esp mode in gparted and proceeded to reinstall all the bootloader stuff and images.
Notice that I did not mount the partition (I think this could be the problem), and then I simply reinstalled systemd-boot, efibootmgr, efivar, the latest linux kernel and the lts one, and amd-ucode, and I saw that things were reappearing under `/boot/` and felt confident I was fixing everything. I also modified `loader.conf` to point to a newly created `arch.conf`, which I think is correct.
I also issued some `bootctl` commands, but I am not sure what. Also `mkinitcpio -p` was run when I installed the various packages mentioned above.

However, when I reboot, systemd-boot works and I see the same page as I used to see, though, I only have the one entry for rebooting into the firmware of my laptop, and no entry corresponding to `arch.conf`.

After checking the arch docs, many posts online and reddit discussions, I feel that my problem was reinstalling all the packages and creating the `arch.conf` file when the `/boot` partition was not mounted. If this is a possible cause, I need some guidance in how to do this properly and would be very happy if somebody can help me out here.

I can boot with a live image and fiddle things around, which I did already a bit, but without success.

Last edited by stefabat (2025-02-24 14:09:43)

Offline

#2 2025-02-24 10:37:59

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

Re: [SOLVED] Can't boot into system under UEFI after wiping boot partition

Just do it all again but with the /boot/ partition correctly mounted this time. You can mount the root partition, use arch-chroot, then run `mount -a` to mount everything listed in /etc/fstab.

Once you reboot into the fixed system un-mount /boot/ to clean up the mess on the root partition then run `mount -a` again afterwards.


Jin, Jîyan, Azadî

Offline

#3 2025-02-24 11:50:29

stefabat
Member
Registered: 2020-04-21
Posts: 8

Re: [SOLVED] Can't boot into system under UEFI after wiping boot partition

Ok, just to be sure, let me tell you my `fstab` entries, and then the steps I would follow.

# /dev/nvme0n1p2
UUID=...     /                    btrfs      <many options>, subvol=/@   0   0
# /dev/nvme0n1p2
UUID=...     /home                btrfs      <many options>, subvol=/@home   0   0
# /dev/nvme0n1p2
UUID=...     /var/log             btrfs      <many options>, subvol=/@log   0   0
# /dev/nvme0n1p2
UUID=...     /var/cache/pacman/pkg     btrfs      <many options>, subvol=/@pkg   0   0
# /dev/nvme0n1p2
UUID=...     /.snapshots      btrfs      <many options>, subvol=/@.snapshots   0   0

# /dev/nvme0n1p1
UUID=...     /boot     vfat      <many options>, subvol=/@pkg   0   2

Currently, if I boot into the live iso and mount the boot partition with

mount --mkdir /dev/nvme0n1p1 /mnt/boot

I do see inside there all the necessary files: initramfs, amd-ucode, the EFI and loader folders, and so on. The fact that these files and folders exist in my boot partition make me think that I did reinstall stuff correctly. Otherwise, `/boot` would simply be a local folder created on the root partition, no? And if I mount the root partition, I see that I have a boot folder that is empty, where I would normally mount the boot partition. So perhaps the wrong part was to call mkinitcpio -p without mounting the partitions, or something along these lines.

Anyway, I am a bit confused about the mounting order. According to the Arch installation guide, I should first mount everything. So, if I mount the root partition on /mnt first, then I see in /mnt all the subvolumes: @, @home, @log, @pkg, @.snapshots, and I can access them, but I am a bit lost whether I should mount them to their respective location inside @ as well? The same is true for mounting the boot partition, should I mount it on /mnt/boot or to /mnt/@/boot ?
Following your advice, instead, I should just mount root on /mnt and then mount all the rest according to /etc/fstab. However, I get this:

root@archiso ~ # arch-chroot /mnt
mount: /mnt/proc: mount point does not exist.
  bla bla check dmesg for more info
root@archiso ~ # arch-chroot /mnt/@
==> WARNING: /mnt/@ is not a mountpoint. This may have undesirable effects.
root@archiso ~ #

So, the first command fails, because I use subvolumes, and correctly /mnt/proc does not exist, as my "true" root is under /mnt/@. However, the second command gives a warning, hence I am afraid that this is not the right way to do it.
Should I just ignore the warning and proceed with `mount -a` which I think would mount all subvolumes and the boot partition correctly, then run mkinitcpio -p and reinstall the boot loader anyway?

Offline

#4 2025-02-24 13:08:25

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

Re: [SOLVED] Can't boot into system under UEFI after wiping boot partition

The correct invocation should be

mount -o subvol=@ /dev/nvme0n1p2 /mnt
arch-chroot /mnt /bin/su -
[chroot] mount -a

Jin, Jîyan, Azadî

Offline

#5 2025-02-24 14:08:13

stefabat
Member
Registered: 2020-04-21
Posts: 8

Re: [SOLVED] Can't boot into system under UEFI after wiping boot partition

Thanks, I managed to fix it. I figured the trick to mount it as a subvolume, redo the whole thing, but then it was still not appearing up in the bootloader. Checking again all files I realized the rookie mistake: the entry files I created where not placed inside the `entries` folder... Once I moved them there, everything worked.
Thanks for your help and quick answers!

I have one final question. Both from the live iso as well as now booted into the system, if I `cd` into `/boot`, then both `cd efi` and `cd EFI` work and seemingly cd into the same folder... However, if I `ls` when in `/boot` I only see the `EFI` folder. I find this a bit weird: it's like in `/boot` there is no case sensitivity, as the same happens for the folder `loader`. Is this correct and why is that? Is it because of the vfat filesystem?

Offline

#6 2025-02-24 14:21:22

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

Re: [SOLVED] Can't boot into system under UEFI after wiping boot partition

Yes, the FAT filesystem is not case-sensitive.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB