You are not logged in.

#1 2024-12-22 14:59:05

average_scout
Member
Registered: 2024-06-14
Posts: 114

[Solved] grub-mkconfig -o returns "no such file or directory" error

Running

grub-mkconfig -o /boot/grub/grub.cfg

during installation returns

/usr/bin/grub-mkconfig: line 270: /boot/grub/grub.cfg.new: No such file or directory

This is a fully standard installation of Arch Linux, and I've never encountered such an issue before.

Last edited by average_scout (2024-12-22 15:46:22)

Offline

#2 2024-12-22 15:05:18

average_scout
Member
Registered: 2024-06-14
Posts: 114

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

I have obviously arch-chrooted into /mnt and I also followed the installation guide.

Offline

#3 2024-12-22 15:18:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,681

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

if test "x${grub_cfg}" != "x"; then
  rm -f "${grub_cfg}.new"
  oldumask=$(umask); umask 077
  exec > "${grub_cfg}.new"
  umask $oldumask
fi
ls -l /boot/grub

Offline

#4 2024-12-22 15:25:52

average_scout
Member
Registered: 2024-06-14
Posts: 114

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

Oops, brain fart. Forgot to actually install grub. Anyways,

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

returns

grub-install: error: efibootmgr: not found

perhaps something to do with W*ndows on my other drive?

Offline

#5 2024-12-22 15:26:18

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,726

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

Have you installed grub (grub-install) yet?

Edit: posting at the same time. For the new issue, see the optional deps of the package.

Last edited by Scimmia (2024-12-22 15:27:38)

Offline

#6 2024-12-22 15:27:56

cryptearth
Member
Registered: 2024-02-03
Posts: 2,164

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

no - but on a uefi system it requires efibootmgr as dependency

Offline

#7 2024-12-22 15:34:15

average_scout
Member
Registered: 2024-06-14
Posts: 114

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

Yup, had to install efibootmgr. Yet another brain fart. After running the above commands again, I still can't boot to Grub. It won't appear in my motherboard's boot options at all.

Last edited by average_scout (2024-12-22 15:36:36)

Offline

#8 2024-12-22 15:37:53

cryptearth
Member
Registered: 2024-02-03
Posts: 2,164

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

is this a laptop?
you can also try --removable to install grub into ESP/efi/boot/bootx64.efi

Offline

#9 2024-12-22 15:46:03

average_scout
Member
Registered: 2024-06-14
Posts: 114

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

--removable worked. Also, it's not a laptop. Thanks for the help guys.

Offline

#10 2024-12-22 16:19:28

cryptearth
Member
Registered: 2024-02-03
Posts: 2,164

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

so if the fallback path works it could be a bad uefi implementation not working correctly
maybe look for bios updates or contact the oem support
maybe someone has an idea: so which board is it?

Offline

#11 2024-12-22 16:23:43

average_scout
Member
Registered: 2024-06-14
Posts: 114

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

It's the MSI Pro H410M-B, but I'm pretty sure I'm on the latest version as I updated a few months ago. And I've never had the issue with this MB.

Last edited by average_scout (2024-12-22 16:24:25)

Offline

#12 2024-12-22 16:59:49

cryptearth
Member
Registered: 2024-02-03
Posts: 2,164

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

https://www.msi.com/Motherboard/PRO-H410M-B/support
I don't have experience with intel platform but only amd - but msi should have no issues
on the other side msi is one of the oem which uefi auto-delete entries it can't validate as when the target bootloader can't be found
so it could be for some reason that the regular install correctly added a proper entry for grub but on reboot the entry somehow couldn't be validated and got deleted

Offline

#13 2024-12-22 17:04:33

average_scout
Member
Registered: 2024-06-14
Posts: 114

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

I already updated my BIOS, I'm on the latest version. But this might happen because 1. I have another drive with an EFI and W*ndoze on it and 2. this is an NVME drive, never installed Arch on one of these before.

Offline

#14 2024-12-22 17:36:21

cryptearth
Member
Registered: 2024-02-03
Posts: 2,164

Re: [Solved] grub-mkconfig -o returns "no such file or directory" error

uefi is designed to be the selector between different OSs - so it's by design that each OS has its own esp on its own drive - and its the uefi whats supposed to select which esp to start
being able to use one esp and maybe chain several bootloaders on it after eachother is intented
but many consumer grade products, mainly laptops, are often designed and tested with windows only - and therefore just bug out as soon as some linux tries to install grub or systemd or refind
"abusing" the fallback path in this situation is somewhat of a hack due to the bios dev failed to correctly implement the uefi spec

Offline

Board footer

Powered by FluxBB