Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2 and EFI issues [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 252

PostPosted: Mon Apr 16, 2018 3:23 pm    Post subject: Grub2 and EFI issues [SOLVED] Reply with quote

So I'm at the part of the install where I need to set up grub2, and I've run into an issue.

I went with the suggested partition scheme from the handbook, since bootloaders have changed since I last paid attention to them, and ran into this issue:

Code:
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.


Here's what I've tried:

Code:
(chroot) livecd /etc/init.d # fdisk /dev/sda

Welcome to fdisk (util-linux 2.30.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 75D783FC-B7ED-44D1-BFAF-19044087BAF9

Device        Start        End    Sectors   Size Type
/dev/sda1      2048       6143       4096     2M BIOS boot
/dev/sda2      6144     268287     262144   128M EFI System
/dev/sda3    268288   33822719   33554432    16G Linux filesystem
/dev/sda4  33822720 1953523119 1919700400 915.4G Linux filesystem

Command (m for help): q

(chroot) livecd /etc/init.d # grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
(chroot) livecd /etc/init.d # mount -o remount,rw /sys/firmware/efi/efivars
(chroot) livecd /etc/init.d # grub-install --target=x86_64-efi --efi-directory=/boot
Installing for x86_64-efi platform.
grub-install: error: /boot doesn't look like an EFI partition.
(chroot) livecd /etc/init.d # grub-install --target=x86_64-efi --efi-directory=/boot --removable
Installing for x86_64-efi platform.
grub-install: error: /boot doesn't look like an EFI partition.
(chroot) livecd /etc/init.d # grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.
(chroot) livecd /etc/init.d #


Any ideas?


Last edited by Illiander on Mon Apr 16, 2018 6:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Mon Apr 16, 2018 6:20 pm    Post subject: Reply with quote

Can you also post the output of "parted -a optimal /dev/sda". Then use p for print and q for quit. It shows what flags are used better than fdisk. Also I can't recognize what's the filesystem on your /dev/sda2.

This is what I get with parted:
Code:

luthien ~ # parted -a optimal /dev/sda
GNU Parted 3.2
/dev/sda wird verwendet
Willkommen zu GNU Parted! Rufen Sie »help« auf, um eine Liste der verfügbaren Befehle zu erhalten.
(parted) p                                                               
Modell: ATA Crucial_CT275MX3 (scsi)
Festplatte  /dev/sda:  275GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt
Disk-Flags:

Nummer  Anfang  Ende    Größe   Dateisystem  Name              Flags
 1      1049kB  3146kB  2097kB               grub              bios_grub
 2      3146kB  2003MB  2000MB  fat32        efi-boot          boot, esp
 3      2003MB  275GB   273GB                Crypted Gentoo /  msftdata


You need the flags boot and esp for the EFI-Partition and it has to be fat32 (vfat).
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 252

PostPosted: Mon Apr 16, 2018 6:28 pm    Post subject: Reply with quote

Code:
(chroot) livecd /etc/init.d # parted -a optimal /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                               
Model: ATA ST1000LM048-2E71 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name    Flags
 1      1049kB  3146kB  2097kB  ext2            grub    bios_grub
 2      3146kB  137MB   134MB   ext2            boot    boot, esp
 3      137MB   17.3GB  17.2GB  linux-swap(v1)  swap
 4      17.3GB  1000GB  983GB   ext4            rootfs

(parted) q                                                               
(chroot) livecd /etc/init.d #


Looks like I'll need to look up how to change that partition format. Wish that was mentioned in the partitioning section of the handbook.
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Mon Apr 16, 2018 6:36 pm    Post subject: Reply with quote

Yes you need to change the filesystem of /dev/sda2 in fat32.
The reason is that UEFI-BIOS don't understand something different. Also when you want to integrate Windows later, that also wouldn't work with ext2.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 252

PostPosted: Mon Apr 16, 2018 6:39 pm    Post subject: Reply with quote

Tyrus wrote:
Also when you want to integrate Windows later, that also wouldn't work with ext2.


Why would I want to do that?
Back to top
View user's profile Send private message
Tyrus
Guru
Guru


Joined: 03 Feb 2018
Posts: 300

PostPosted: Mon Apr 16, 2018 6:48 pm    Post subject: Reply with quote

That's a design pattern. fat32 is the lowest common denominator possible for different systems to make multiboot possible. Your personal use of it doesn't matter.
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 252

PostPosted: Mon Apr 16, 2018 6:53 pm    Post subject: Reply with quote

I was just ribbing you for your use of "when" rather than "if".

And switching to vfat worked. Apparently that partition is small enough it decided to use fat16!
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 976
Location: The Village, Portmeirion

PostPosted: Mon Apr 16, 2018 7:17 pm    Post subject: Reply with quote

Illiander wrote:
Tyrus wrote:
Also when you want to integrate Windows later, that also wouldn't work with ext2.


Why would I want to do that?

Resistance is futile!
Back to top
View user's profile Send private message
Illiander
Apprentice
Apprentice


Joined: 22 Feb 2011
Posts: 252

PostPosted: Tue Apr 17, 2018 10:27 am    Post subject: Reply with quote

skellr wrote:
Illiander wrote:
Tyrus wrote:
Also when you want to integrate Windows later, that also wouldn't work with ext2.


Why would I want to do that?

Resistance is futile!


"Work as if you were in the early days of a better nation."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum