1

Backstory: I backed up windows 10 and restarted my laptop on a boot drive loaded with the Arch linux iso that was created with Rufus. I entered cfdisk and deleted all partitions except for the "EFI System" and the "Lenovo boot partition" partitions. When I tried to install the base packages with pacstrap, it told me that the partition block size was too small so I expanded the EFI System partition upwards (There was a gigabyte of extra space and I thought that might help). It didn't work and a while later I tried remounting my linux file system (/dev/sda4) and it worked. I skipped over a bunch of other steps I took, but I thought these would be most relevant.

Whenever I try to run the command to install grub:

grub-install --target=x86_64-efi --efi-directory=/dev/sda1 --bootloader=arch_grub

It just outputs:

Installing for x86_64-efi platform.
grub-install: error: cannot read `/dev': Is a directory.

Even though the path I'm giving it is the efi partition (/dev/sda1). I've tried giving it /boot for the efi directory parameter, but if I try that, it just outputs:

Installing for x86_64-efi platform.
grub-install: error: /boot doesn't look like an EFI partition.

I'm fairly new to these 'do-it-yourself' type of distributions and I would appreciate all the feedback I can get, thanks!

Edit: Output of fdisk -l /dev/sda:

Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type gpt
Disk identifier: 6393AD85-37EA-4C44-888C-C5908FC9AE82

Device        Start        End   Sectors  Size Type
/dev/sda1      2048    2582527   2580480  1.2G EFI System
/dev/sda2   2582528    4630527   2048000 1000M Lenovo boot partition
/dev/sda3   4630528   25602047  20971520   10G Linux swap
/dev/sda4  25602048 2550069646 224467599  107G Linux filesystem
2
  • 1
    Have you mounted anything to /boot? You should mount your efi partition somewhere, then pass this mount point to grub-install under the --efi-directory flag
    – Matt
    Mar 19, 2018 at 7:04
  • Yeah, I had mounted my EFI drive to /boot, thanks for the help!
    – joseph
    Mar 20, 2018 at 2:05

1 Answer 1

3

I ran into this issue recently since I never had a system/laptop with an UEFI firmware before. I'm assuming you are starting from scratch and using a recent version of Arch Linux (mine is 4.15.9-1-ARCH).

Let's assume that:

  • Your HDD/SSD/NVMe drive is "named" as /dev/sda
  • You created a partition /dev/sda1
  • You formatted /dev/sda1 with mkfs.fat -F32 /dev/sda1

During install, after you mount root (/) into /mnt, you need to mkdir -p /mnt/boot/efi and continue with the installation process: arch-chroot /mnt, locales, etc.

Install efibootmgr, grub (maybe intel-ucode), and mount /dev/sda1 into /boot/efi, execute grub-install --bootloader-id=Arch_Linux --efi-directory=/boot/efi --recheck --target=x86_64-efi...and don't forget to generate/update the GRUB config (grub-mkconfig -o /boot/grub/grub.cfg). You should be all set!

Notice that you can actually use only /boot and not necessarily /boot/efi. As always, have a look at the Wiki.

5
  • When I try to execute that grub-install command, it just gives me an error that says that /boot/efi doesn't look like an EFI partition even after i mounted /dev/sda1 (my EFI drive) to /boot/efi. How can I make it work?
    – joseph
    Mar 19, 2018 at 22:05
  • Can you update the question with the output from fdisk -l /dev/sda? — assuming sda is the HDD/SSD/NVMe drive in question.
    – x80486
    Mar 19, 2018 at 22:09
  • 1
    I've updated it
    – joseph
    Mar 20, 2018 at 1:30
  • Still tells me that /boot doesn't look like an EFI partition.
    – joseph
    Mar 20, 2018 at 1:54
  • I'm so sorry, I reformatted my EFI drive and it worked. Thanks for all of your help and patience!
    – joseph
    Mar 20, 2018 at 2:03

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .