Artix Linux Forum

Artix Linux => System => Topic started by: mardiyah on 20 April 2023, 20:10:29

Title: [SOLVED] grub-install: error: failed to make directory:
Post by: mardiyah on 20 April 2023, 20:10:29
Tried installing grub to another partition than currently running OS', then met error such:

Code: [Select]
$ sudo grub-install /dev/sda6
Installing for x86_64-efi platform.
grub-install: error: failed to make directory: '/boot/efi/EFI/artix'

found out:

Code: [Select]
$ ls -l /boot
drwxr-xr-x 5 root root 4096 Jan 10 22:29 /boot/
total 98481
drwx------ 3 root root     1024 Jan  1  1970 efi/
drwxr-xr-x 6 root root     4096 Jun  8  2022 grub/
drwxr-xr-x 2 root root     4096 Nov 14 11:27 memtest86+/
-rw-r--r-- 1 root root    51200 Dec 21 02:25 amd-ucode.img
-rw------- 1 root root 33222738 Jan 10 22:29 initramfs-linux-fallback.img
-rw------- 1 root root  6296268 Jan 10 22:28 initramfs-linux.img

...
Now have not rebooted yet.
Any clear idea what's the mistake and definitve steps for solution ?
Title: Re: grub-install: error: failed to make directory:
Post by: DivineLeft on 20 April 2023, 21:04:54
You need to specify the target with
Code: [Select]
--target=x86_64-efi
the boot directory with
Code: [Select]
--efi-directory=/boot
and the bootloader id with
Code: [Select]
--bootloader-id="ID"

Here's the arch wiki's article (https://wiki.archlinux.org/title/GRUB#UEFI_systems) about it.

your cmd should look something like:

Code: [Select]
$ sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="GRUB"