Bug 17243 - Grub2 looks for /boot/EFI in wrong case.
Summary: Grub2 looks for /boot/EFI in wrong case.
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL: https://forums.mageia.org/en/viewtopi...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-28 08:13 CET by Doug Laidlaw
Modified: 2015-11-29 04:58 CET (History)
3 users (show)

See Also:
Source RPM: grub2-efi-2.02-0.git9752.18.2.mga5
CVE:
Status comment:


Attachments
accessing EFI as efi (8.97 KB, image/png)
2015-11-28 13:43 CET, Barry Jackson
Details

Description Doug Laidlaw 2015-11-28 08:13:30 CET
Description of problem:
Windows creates EFI directory as "EFI."  Grub2 is looking for "efi" and can't find it.


Version-Release number of selected component (if applicable):
??

How reproducible:
Just try to run "grub2-install."  It fails.

 grub2-install /dev/sda --efi-directory=/boot/EFI

works. 


Steps to Reproduce:
1. See above.
2.
3.

I am running x86-64, but the error sounds independent of architecture.

Reproducible: 

Steps to Reproduce:
Comment 1 Barry Jackson 2015-11-28 13:19:10 CET
I don't see that.

[root@localhost baz]# rpm -qa|grep grub2
grub2-mageia-theme-2.02-0.git9752.18.2.mga5
grub2-efi-2.02-0.git9752.18.2.mga5
[root@localhost baz]# ll /boot/EFI
total 4
drwxrwxrwx 3 root root 4096 Sep 22 23:31 EFI/                                                                                               
[root@localhost baz]# grub2-install                                                                                                         
Installing for x86_64-efi platform.                                                                                                         
Installation finished. No error reported.                                                                                                   
[root@localhost baz]#

CC: (none) => zen25000

Comment 2 Barry Jackson 2015-11-28 13:43:06 CET
Created attachment 7250 [details]
accessing EFI as efi

/EFI is on a FAT partition so case should be irrelevant.

It sounds to me like maybe you are using the mount point for the ESP not the ESP partition, in which case it won't be on FAT.

Using the UEFI shell in VBox I accessed an ESP which lists as /EFI using /efi and it made no difference. See attached.
Comment 3 Doug Laidlaw 2015-11-28 13:59:05 CET
I am not using VBox.

Initially, I had a EFI partition created by Windows, and I created an efi/ partition.

At present, the Windows partition is mounted.  Output of 'df':

/dev/sda2       256M  108M  149M  42% /boot/EFI

THere is now no /boot/efi.  To get around this problem, I symlinked /boot/EFI to /boot/efi, but that wasn't a permanent fix.

> /EFI is on a FAT partition so case should be irrelevant.

That seems to be true.  "locate efi" gives 

/boot/efi
/boot/refind_linux.conf
/boot/EFI/EFI/refind
/boot/EFI/EFI/Boot/bootx64.efi
/boot/EFI/EFI/Boot/fallback.efi
/boot/EFI/EFI/HP/bootmgr.efi
/boot/EFI/EFI/HP/BIOSUpdate/CryptRSA.efi

... and a whole lot more, although each has the string "efi".  refind failed to configure.  It seems to have encountered a path error.

Should perhaps /boot/EFI/EFI/ be simply /boot/EFI ?

Doug.
Comment 4 Doug Laidlaw 2015-11-28 14:05:17 CET
mcc gives the following details of /dev/sda2:

Mount point: /boot/EFI
Device: sda2
UUID: 9EA5-529D
Type: EFI System Partition (0xef)
Start: sector 1333248
Size: 260MB (0%), 532480 sectors
Cylinder 82 to 116
Mounted


Somewhere I read that the type should be 0xef, but in practice, vfat seems sufficient.
Comment 5 Barry Jackson 2015-11-28 14:28:06 CET
That looks correct.
gdisk /dev/sda
i
2
will give the partition type as well and also change it (if you remember to use the w option to write the change at the end).

It must return:

Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)

or grub2-install (and drakboot) will fail.

What is the exact error that grub2-install gives?
Comment 6 Bit Twister 2015-11-28 14:48:39 CET
(In reply to Doug Laidlaw from comment #4)
 
> Somewhere I read that the type should be 0xef, but in practice, vfat seems
> sufficient.

If someone could post the output of  gdisk /dev/sda   p command  of a uefi install you could check it against yours.

CC: (none) => bittwister2

Comment 7 Doug Laidlaw 2015-11-28 14:56:29 CET
Thanks BitTwister.  I imagine that Barry's Comment 5 is what you mean?

This is interesting:

" sudo gdisk /dev/sda2

GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Exact type match not found for type code 6E00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 7400; assigning type code for
'Linux filesystem'
Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.

Warning! Secondary partition table overlaps the last partition by
3649731061 blocks!
You will need to delete this partition or resize it in another utility.

Command (? for help): ^C
"

Maybe the recent reinstall of Windows gummed things up?  But Windows would need the EFI structure.
Comment 8 Doug Laidlaw 2015-11-28 15:03:08 CET
This is no longer a bug but a misconfiguration.  I should move it to alt.os.linux.mageia.

BTW, BitTwister's post collided with one from me saying that grub2-install ran this time with no problems.
Comment 9 Doug Laidlaw 2015-11-28 15:40:55 CET
Further discussion moved to newsgroup.Closing this bug as invalid.

Status: NEW => UNCONFIRMED
Ever confirmed: 1 => 0

Comment 10 Florian Hubold 2015-11-28 18:26:42 CET
(In reply to Doug Laidlaw from comment #9)
> Further discussion moved to newsgroup.Closing this bug as invalid.

Actually closing it :)

Status: UNCONFIRMED => RESOLVED
CC: (none) => doktor5000
Resolution: (none) => INVALID

Comment 11 Barry Jackson 2015-11-29 01:30:43 CET
Doug,
gdisk /dev/sda
Is what you should have entered, followed by "i" and "2" as I said in #5 :)

It takes a device not a partition as parameter.
Comment 12 Doug Laidlaw 2015-11-29 04:58:14 CET
Yes, I knew that.  I wasn't thinking straight.  That will explain the confusing line about two partition tables, which was my remaining concern.

On the newsgroup, I copied and pasted a command given by BitTwister.  I wondered why the output was so different.  Thanks.

Note You need to log in before you can comment on or make changes to this bug.