Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/boot doesn't look like an EFI partition.
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
dendro
n00b
n00b


Joined: 21 Jul 2018
Posts: 42

PostPosted: Mon Aug 27, 2018 6:42 am    Post subject: /boot doesn't look like an EFI partition. Reply with quote

Can someone please tell me what's wrong in my fstab ofr how I can fix this:

Here's what I did:

Code:

root #gdisk /dev/sda

Create GPT partition table:
Command: o ↵
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y ↵

Create Partition 1 (/boot):
Command: n ↵
Partition Number: 1 ↵
First sector: ↵
Last sector: +128M ↵
Hex Code: ↵

Create Partition 2 (UEFI ESP):
Command: n ↵
Partition Number: 2 ↵
First sector: ↵
Last sector: +32M ↵
Hex Code: EF00 ↵

Create Partition 3 (swap):
Command: n ↵
Partition Number: 3 ↵
First sector: ↵
Last sector: +1024MB ↵
Hex Code: 8200 ↵

Create Partition 4 (/):
Command: n ↵
Partition Number: 4 ↵
First sector: ↵
Last sector: ↵ (for rest of disk)
Hex Code: ↵

Write Partition Table To Disk:
Command: w ↵
Do you want to proceed? (Y/N): Y ↵


Code:

root #mkdir -p /mnt/gentoo
root #mount /dev/sda4 /mnt/gentoo
root #mkdir /mnt/gentoo/boot
root #mount /dev/sda1 /mnt/gentoo/boot
root #mkdir /mnt/gentoo/boot/efi
root #mount /dev/sda2 /mnt/gentoo/boot/efi


Code:

/dev/sda2               /boot/efi               vfat           noauto,noatime  1 2
/dev/sda3               none                   swap         sw                      0 0
/dev/sda4               /                          ext4          noatime              0 1
#/dev/cdrom           /mnt/cdrom      auto            noauto,ro            0 0


Edit: Sorry about the messy fstab.
Back to top
View user's profile Send private message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2288
Location: near Augsburg, Germany

PostPosted: Mon Aug 27, 2018 7:12 am    Post subject: Reply with quote

You should create
1. /boot/efi (vfat)
2. /boot
3. /(root)
4. /home
5. maybe /var and /tmp

on separate partitions.
Back to top
View user's profile Send private message
Marcih
Apprentice
Apprentice


Joined: 19 Feb 2018
Posts: 152

PostPosted: Mon Aug 27, 2018 10:32 am    Post subject: Reply with quote

Keruskerfuerst wrote:
You should create
1. /boot/efi (vfat)
2. /boot
3. /(root)
4. /home
5. maybe /var and /tmp

on separate partitions.

Be careful with recommending more complex setups, they may work for you (and, in fact, I have almost the exact same partiton layout as you listed) but the handbook goes with the layout it does for a reason; beginners can then change their partition layouts when they're comfortable with their system.


dendro, you haven't specified what exactly you're trying to fix; is your machine not booting? Is the fstab you posted the full file? If so, you're missing an entry for /dev/sda1, your /boot directory, where (presumably) your kernel image, grub files and your /boot/EFI directory/mount-point for /dev/sda2 reside. Can you confirm those assumptions?
Also, I know others have a different opinion about this but I see little point in having /boot and /boot/EFI different partition (other more knowledgeable members, feel free to defend your position and prove me wrong); I would either have /boot be a regular folder on rootfs (/dev/sda4), have all the files like kernel image or grub dir in there and have /boot/EFI be (a mount-point to) a FAT32-formatted ESP OR just have the entirety of /boot be the ESP with all the shebang: kernel, grub and EFI (the setup I currently have and what the handbook does).
_________________
Bones McCracker wrote:
It wouldn't be so bad, if it didn't suck.

===
I refuse to move on from GTK+2.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Mon Aug 27, 2018 2:02 pm    Post subject: Reply with quote

Marcih wrote:
I would either have /boot be a regular folder on rootfs (/dev/sda4), have all the files like kernel image or grub dir in there and have /boot/EFI be (a mount-point to) a FAT32-formatted ESP OR just have the entirety of /boot be the ESP with all the shebang: kernel, grub and EFI (the setup I currently have and what the handbook does).

I prefer the first of your alternatives simply because I regard ext4 a much safer file system than vfat. Your first alternative limits the files on vfat to the bare bones putting the kernel(s) and grub on the more robust ext4.
Back to top
View user's profile Send private message
skellr
l33t
l33t


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

PostPosted: Mon Aug 27, 2018 6:36 pm    Post subject: Re: /boot doesn't look like an EFI partition. Reply with quote

dendro wrote:
Can someone please tell me what's wrong in my fstab ofr how I can fix this:

Here's what I did:

....
Code:

root #mkdir -p /mnt/gentoo
root #mount /dev/sda4 /mnt/gentoo
root #mkdir /mnt/gentoo/boot
root #mount /dev/sda1 /mnt/gentoo/boot
root #mkdir /mnt/gentoo/boot/efi
root #mount /dev/sda2 /mnt/gentoo/boot/efi


Code:

/dev/sda2               /boot/efi               vfat           noauto,noatime  1 2
/dev/sda3               none                   swap         sw                      0 0
/dev/sda4               /                          ext4          noatime              0 1
#/dev/cdrom           /mnt/cdrom      auto            noauto,ro            0 0


Edit: Sorry about the messy fstab.

You created a partition for /boot and another for /boot/efi (UEFI). But your fstab is telling it to mount /boot/efi before you have mounted /boot.
You need to nest the mount points. Mount /boot before /boot/efi.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Mon Aug 27, 2018 7:17 pm    Post subject: Reply with quote

You could have run "mkdir -p /mnt/gentoo/boot/efi " on the first line and skipped the other two mkdirs. From "man mkdir"
Code:
 -p, --parents
              no error if existing, make parent directories as needed

That's not your problem though, just a tip.

Skelir pointed out what your problem is.

You need a line just above for /boot
Code:
/dev/sda1   /boot       ext2      relatime   1 2
Add options or change to ext4 as appropriate. As I said above, with efi I prefer not to have a separate boot. Example:
Code:
/dev/sda1   /boot/efi   vfat      auto,noatime   1 2
/dev/sda2   /      ext4      defaults,noatime  0 1
Back to top
View user's profile Send private message
dendro
n00b
n00b


Joined: 21 Jul 2018
Posts: 42

PostPosted: Mon Aug 27, 2018 8:57 pm    Post subject: Reply with quote

Hmmm still not getting this right...

Code:

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


Code:

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


Here's my last edit of my fstab:

Code:

/dev/sda1               /boot           ext2            relatime        1 2
/dev/sda1               /boot/efi   vfat            noauto,noatime  1 2
/dev/sda3               none            swap            sw              0 0
/dev/sda4               /               ext4            defaults,noatime                0 1
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5838

PostPosted: Tue Aug 28, 2018 1:27 am    Post subject: Reply with quote

According to your first post, /dev/sda1 is /boot and /dev/sda2 is /boot/efi (make sure your fstab is correct)

Did you create the filesystem on it yet? Try...

Code:
mkfs.vfat /dev/sda2
mount /dev/sda2 /mnt/gentoo/boot/efi (or just /boot/efi if you're not working out of a chroot anymore)

_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Tue Aug 28, 2018 12:54 pm    Post subject: Reply with quote

Keruskerfuerst wrote:
You should create
1. /boot/efi (vfat)
2. /boot
3. /(root)
4. /home
5. maybe /var and /tmp

on separate partitions.


Absolute minimum with UEFI is:
/boot/efi
/ (root)

Though separate /home might be wise.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Tue Aug 28, 2018 3:29 pm    Post subject: Reply with quote

My complete working UEFI booting /etc/fstab
Code:

/dev/sda1   /boot/efi   vfat      auto,noatime   1 2
/dev/sda2   /      ext4      defaults,noatime  0 1
/dev/sdc2   /video      ext4      nofail,auto,relatime  0 1
/dev/sdb3   swap      swap      defaults   0 0
/dev/cdrom   /mnt/cdrom   auto      noauto,user,ro   0 0
tmpfs      /var/tmp/portage    tmpfs       nofail,noatime,nr_inodes=1M,size=18G    0 0

The first two lines are the important ones. Drive sda is a SATA SSD, drive sdb is an older BIOS formatted HDD, drive sdc is a 5TB GPT partitioned HDD used for storage only
You can ignore the third line. It is not needed for boot.
Re fourth line: I use the old HDD for swap to avoid thrashing the SSD. I have 8G memory so it only uses swap while compiling big packages anyway.
Set up your swap however you want.
Fifth line - self-explanatory, maybe you have a DVD drive, maybe not. Not needed anyway.
Sixth line - puts portage's work area on memory/swap, optional

You could have a seperate /boot or /home if you want. separate /boot is a legacy of older PC BIOS boot limitations. Not needed on newer hardware. Definitely not needed for UEFI.

I also boot with refind. You don't really need grub anymore, but you can use it if you want. I like refind because I don't have to edit the menu, refind finds the kernels by itself.
The above layout should work with grub as well.
Gentoo wiki Refind
Back to top
View user's profile Send private message
dendro
n00b
n00b


Joined: 21 Jul 2018
Posts: 42

PostPosted: Tue Aug 28, 2018 5:03 pm    Post subject: Reply with quote

Okay I thought I almost had it..

Code:

mkfs.vfat /dev/sda2


retuned
Code:
bash: mkfs.vfat: command not found
so I read to
Code:
emerge -av dosfstools
When I tried again I got
Code:
/dev/sda2 contains a mounted filesystem.
so exited chroot and did
Code:
umount /dev/sda2
then ran
Code:
mkfs.vfat /dev/sda2
succefully and proceeded to run
Code:
mount /dev/sda2 /mnt/gentoo/boot/efi


Followed by
Code:

mount -t proc none proc
mount --rbind /sys sys
mount --make-rslave sys
mount --rbind /dev dev
mount --make-rslave dev
chroot . /bin/bash
source /etc/profile


Code:

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


Code:

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


Here's my latest fstab:

Code:

/dev/sda1               /boot        ext2            auto,noatime         1 2
/dev/sda2               /boot/efi   vfat             auto,noatime          1 2
/dev/sda3               none        swap          sw                       0 0
/dev/sda4               /               ext4            defaults,noatime     0 1


I followed this guide exactly as it describes: https://wiki.gentoo.org/wiki/Quick_Installation_Checklist
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Tue Aug 28, 2018 5:23 pm    Post subject: Reply with quote

A quick thought, have you booted your install medium in UEFI mode? I believe this is required.
Back to top
View user's profile Send private message
dendro
n00b
n00b


Joined: 21 Jul 2018
Posts: 42

PostPosted: Tue Aug 28, 2018 11:12 pm    Post subject: Reply with quote

Tony0945 wrote:
A quick thought, have you booted your install medium in UEFI mode? I believe this is required.


I did make sure to do that before booting although I may have done something wrong.

However
Code:
dmesg | grep "EFI v"
returns
Code:
[    0.000000] efi: EFI v2.00 by Lenovo
which acording to this thread I found off google means I did infact boot in uefi https://askubuntu.com/questions/162564/how-can-i-tell-if-my-system-was-booted-as-efi-uefi-or-bios
Back to top
View user's profile Send private message
jburns
Veteran
Veteran


Joined: 18 Jan 2007
Posts: 1048
Location: Massachusetts USA

PostPosted: Wed Aug 29, 2018 12:02 am    Post subject: Reply with quote

Try
Code:
grub-install --efi-directory=/boot/efi
Back to top
View user's profile Send private message
dendro
n00b
n00b


Joined: 21 Jul 2018
Posts: 42

PostPosted: Wed Aug 29, 2018 1:35 am    Post subject: Reply with quote

jburns wrote:
Try
Code:
grub-install --efi-directory=/boot/efi


That works however I got

Code:
 
Installing for x86_64-efi platform.
Could not prepare Boot variable: Read-only file system
Installation finished. No error reported.


So I read to try
Code:
mount -o remount,rw /sys/firmware/efi/efivars
Which let me install grub succesfully

Thanks everyone for all the help. I'm now able to boot and am at the login shell. Hopefully this helps other's who run into the same problems

Solved :)
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