You are not logged in.

#1 2025-02-15 23:14:23

zheyon
Member
Registered: 2025-02-15
Posts: 3

grub-mkconfig: "No such file or directory" Error When Generating grub.

Issue Description:
I'm encountering an issue where grub-mkconfig fails to generate grub.cfg due to a missing file error. The full error message is:

Error: File /boot/grub/grub.cfg.new - No such file or directory

I have tried multiple steps to fix this, but none have worked so far.

System Information:

  • Distro: Arch Linux (fully updated)
    Partitioning: GPT with separate /boot and /boot/efi partitions
    Boot Mode: UEFI
    GRUB Version: 2:2.12-3

Partition Layout (lsblk -f Output):

nvme0n1
├─nvme0n1p1 vfat   FAT32   F2A7-96A9  /boot/efi
├─nvme0n1p2 ext4   1.0     7ff92a87-2680-438a-bc6c-e35a5d69318a  /boot
└─nvme0n1p3 ext4   1.0     49e19daf-4c75-4f21-a32a-cf1ae32cb5f2  /

What I Have Tried So Far:

[root@archlinux zheyon]# lsblk -f
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1                                                                            
├─nvme0n1p1 vfat   FAT32       F2A7-96A9                                 1G     1% /boot
│                                                                                  /boot/efi
│                                                                                  /boot/efi
├─nvme0n1p2 ext4   1.0         7ff92a87-2680-438a-bc6c-e35a5d69318a      1G     1% /boot
│                                                                                  /boot
│                                                                                  /boot
│                                                                                  /boot
└─nvme0n1p3 ext4   1.0         49e19daf-4c75-4f21-a32a-cf1ae32cb5f2  765.5G    13% 

    Checked if /boot/grub/ Exists:
        ls /boot/grub
        Output:

fonts grubenv locale themes x86_64-efi

    Created /boot/grub/ Manually:
       

mkdir -p /boot/grub
        touch /boot/grub/grub.cfg
        chmod 644 /boot/grub/grub.cfg

        Retried grub-mkconfig, but still the same error.

    Reinstalled GRUB:
       

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck
        grub-mkconfig -o /boot/grub/grub.cfg

        Still getting the same "File /boot/grub/grub.cfg.new - No such file or directory" error.

    Checked UEFI Boot Entry:
        efibootmgr -v
        Shows Boot0000* GRUB pointing to /EFI/GRUB/grubx64.efi.

    Checked Filesystem Health:
        Ran fsck on both /boot and /boot/efi partitions to rule out filesystem corruption.

Questions:

  • Why is grub-mkconfig failing to create grub.cfg.new?
    Is there a known issue with GRUB and separate /boot partitions on Arch Linux?

  • How can I manually generate the config file if grub-mkconfig fails?

Any insights or troubleshooting steps would be greatly appreciated! ?

Thanks in advance!

Offline

#2 2025-02-16 00:36:44

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

Re: grub-mkconfig: "No such file or directory" Error When Generating grub.

There is something very suspicious about your lsblk output. It seems you're mounting /boot to several partitions. Multiple times too.

If this is an existing installation that used to boot before, you should check your /etc/fstab configuration.

If this is a new installation and the output you're providing is from arch-chroot, you should provide details on how you're mounting the partitions.


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

#3 2025-02-16 06:24:39

jocheem67
Member
Registered: 2009-11-09
Posts: 250

Re: grub-mkconfig: "No such file or directory" Error When Generating grub.

$ sudo lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                         
nvme0n1
│                                                                           
├─nvme0n1p1
│    vfat   FAT32       D664-1396                             600.7M    40% /boot
└─nvme0n1p2
     ext4   1.0         c74f0d67-96c2-4bc5-85dd-f08209ddbd46  212.1G    50% /

My parttions and mount points. Yours is very peculiar....

Offline

#4 2025-02-16 10:07:27

zheyon
Member
Registered: 2025-02-15
Posts: 3

Re: grub-mkconfig: "No such file or directory" Error When Generating grub.

Hi everyone, and thanks for your time.

I've also noticed the multiple mounts, but I believe they are a direct consequence of my numerous attempts to fix the issue. I've tried so many things—sometimes multiple times—that I might have unintentionally messed up the mounting process.

I'll provide the output of lsblk right after a reboot to give you the cleanest possible view of the situation.

Just to clarify, I'm not using chroot; I've been running this OS for months. However, I've been tinkering with various configurations and external packages during this time, so it's possible that I inadvertently broke something along the way.

Offline

#5 2025-02-16 10:41:57

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

Re: grub-mkconfig: "No such file or directory" Error When Generating grub.

Clear up those weird mounts first — either reboot (if the current grub.cfg will still work), or un-mount /boot/ & /boot/efi/ completely (ie, run `umount /boot/efi` repeatedly followed by `umount /boot` repeatedly until nothing is mounted) then run `mount -a` to mount the partitions as listed in /etc/fstab.

If grub-mkconfig still doesn't work when you only have a single directory listed under the MOUNTPOINT column in the lsblk output please share the output of

stat /boot/grub

Thanks.

And may I ask: why do you need to regenerate grub.cfg? Arch doesn't need to update the configuration after kernel upgrades, unlike most other distributions.


Jin, Jîyan, Azadî

Offline

#6 2025-02-20 22:47:15

zheyon
Member
Registered: 2025-02-15
Posts: 3

Re: grub-mkconfig: "No such file or directory" Error When Generating grub.

Hi everyone,

Apologies for my delayed response, and thanks for your time!

I'm trying to install AppArmor and have been following the official Arch Wiki guide here.

Before diving into anything related to GRUB, I noticed an issue with my pacman database. I'll work on fixing that first and report back to let you know whether the problem was related or if I'll need to trouble you a bit more tongue

Thanks again!

Offline

Board footer

Powered by FluxBB