Bug 23394 - If EFI partition is mounted during custom partitioning draklive-install fails with "grub2-install: error: cannot find EFI directory."
Summary: If EFI partition is mounted during custom partitioning draklive-install fails...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords: 6.1, FOR_ERRATA6
Depends on:
Blocks:
 
Reported: 2018-08-06 12:21 CEST by Dick Gevers
Modified: 2018-10-02 13:03 CEST (History)
6 users (show)

See Also:
Source RPM: drakxtools?
CVE:
Status comment: Seen with Mageia-6.1-rc-LiveDVD-GNOME-x86_64-DVD.iso


Attachments
Result of journalctl -a (and xz) ... after crash of draklive-install (51.28 KB, application/x-xz)
2018-08-08 11:32 CEST, Dick Gevers
Details

Description Dick Gevers 2018-08-06 12:21:02 CEST
Description of problem:

Using Mageia-6.1-rc-LiveDVD-GNOME-x86_64-DVD.iso (via USB on real hardware) built 4 AUG 2018 I needed to mount & view my EFI partition during stage custom partitioning.

It should be possible, but in hindsight it wasn't such a good idea: draklive-install crashed with mention of "grub2-install failed ... cannot find EFI directory..."

while during a subsequent run of Live Install there was no problem when I did not view/mount the EFI partition.

[ Bug filed as suggested by martinw in riseup pad ]
Comment 1 Dick Gevers 2018-08-06 12:25:17 CEST
( 6.1 not found in Bugzilla )

CC: (none) => mageia

Comment 2 Marja Van Waes 2018-08-07 07:56:56 CEST
@ stormi or LpSolit

Can one of you please add the "6.1RC" keyword for the isotesters and isobuilders?

@ Dick

Assuming the crash didn't cause a hard freeze: Can you please reproduce the issue and fetch the logs?

As root:

  journalctl -a > log.txt

compress if needed:

 xz log.txt

and attach log.txt.xz (or log.txt) to this report

Source RPM: LiveDVD Gnome 64 bits => draklive-install? drakxtools? grub2?
CC: (none) => isobuild, LpSolit, mageiatools, marja11, stormi-mageia
Component: Installer => RPM Packages
Whiteboard: (none) => 6.1RC
Status comment: (none) => Seen with Mageia-6.1-rc-LiveDVD-GNOME-x86_64-DVD.iso

Comment 3 Dick Gevers 2018-08-07 09:17:37 CEST
(In reply to Marja Van Waes from comment #2)

> Assuming the crash didn't cause a hard freeze: Can you please reproduce the
> issue and fetch the logs?

Sure, but not before 1600 h today ;)
Comment 4 Samuel Verschelde 2018-08-07 09:20:03 CEST
I've created the 6.1 keyword (we used a similar 5.1 keyword in the past, without the need for 5.1RC), that can be used for any bug specific to the 6.1 ISOs.

Keywords: (none) => 6.1
Whiteboard: 6.1RC => (none)

Frédéric "LpSolit" Buclin 2018-08-07 14:06:52 CEST

CC: LpSolit => (none)

Comment 5 Dick Gevers 2018-08-08 11:21:32 CEST
Reproduced today (yesterday testroom was too hot ;((   )

"drakbug: showed follg on screen:
quote
The "draklive-install" program has crashed with the following error:

  grub2-install failed: Installing for x86_64-efi platform.
  grub2-install: error: cannot find EFI directory.
  	...propagated at /usr/lib/libDrakX/any.pm line 269.
  Perl's trace:
  drakbug::bug_handler() called from /usr/lib/libDrakX/any.pm:269
  any::installBootloader() called from /usr/lib/libDrakX/any.pm:239
  any::setupBootloaderUntilInstalled() called from /usr/sbin/draklive-install:347
  main::setup_bootloader() called from /usr/sbin/draklive-install:72
  main::install_live() called from /usr/sbin/draklive-install:44

Used theme: Adwaita
unquote

Will attach log as per Marja's instructions
Comment 6 Dick Gevers 2018-08-08 11:32:00 CEST
Created attachment 10305 [details]
Result of journalctl -a (and xz) ... after crash of draklive-install
Comment 7 Marja Van Waes 2018-08-09 22:16:49 CEST
When you mounted it, there was this message:

Aug 08 08:54:58 dvglt2.fritz.box kernel: FAT-fs (sda9): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

But, if some data had gotten corrupted, shouldn't the next draklive-install run, without manually mounting the ESP, then have failed, too?

Anyway, does fsck find anything to repair if you run it on /dev/sda9 ?

Summary: If EFI partition is mounted during custom partitioning draklive-install fails with "cannot find EFI directory" => If EFI partition is mounted during custom partitioning draklive-install fails with "grub2-install: error: cannot find EFI directory."
Source RPM: draklive-install? drakxtools? grub2? => drakxtools?
Assignee: bugsquad => mageiatools

Comment 8 Dick Gevers 2018-08-10 01:53:07 CEST
(In reply to Marja Van Waes from comment #7)
> When you mounted it, there was this message:
> 
> Aug 08 08:54:58 dvglt2.fritz.box kernel: FAT-fs (sda9): Volume was not
> properly unmounted. Some data may be corrupt. Please run fsck.
> 
> But, if some data had gotten corrupted, shouldn't the next draklive-install
> run, without manually mounting the ESP, then have failed, too?

Indeed 2 subsequent draklive-installs succeeded (without manual run of fsck).
 
> Anyway, does fsck find anything to repair if you run it on /dev/sda9 ?

Yes, at this time running fsck.vfat it shows
...0x41 Dirty bit set. Fs was not properly unmounted and some data may be corrupt...
Comment 9 Martin Whitaker 2018-08-10 10:00:39 CEST
(In reply to Dick Gevers from comment #8)
> Yes, at this time running fsck.vfat it shows
> ...0x41 Dirty bit set. Fs was not properly unmounted and some data may be
> corrupt...

I see the same on my main system, also with my FAT partition. The few times I ever boot Windows, it complains and fixes it, but it always comes back. I've just tried repairing the fault with fsck.vfat, but it's back after a reboot.

I've never worried about this because I don't keep anything valuable on my FAT partition, and anyway the FAT filesystem generally survives unless you are actually writing files at the time.

We should have a separate bug report for this if you think it's worth pursuing.
Comment 10 Dick Gevers 2018-08-10 11:14:39 CEST
(In reply to Martin Whitaker from comment #9)

> We should have a separate bug report for this if you think it's worth
> pursuing.

Sorry, but given that i stopped having any windows system 15 years ago i don't think i could be much help. The only windowsy thing on 5 machines is this EFI (vfat) partition I needed on this laptop because the Mageia installer wouldn't proceed without one when I bought the machine last fall....
Comment 11 Dick Gevers 2018-08-10 12:28:52 CEST
I did write/remove some data from the EFI partition and each time unmounted/mounted it with diskdrake to see if this would corrupt the filesystem by any chance, but running "fsck.vfat -b -n -v -V..." afterwards does not show corruption now, so the diskdrake function in the installer is presumably okay 

(this being diskdrake from drakxtools...17.98-2.mga7)
Comment 12 Dick Gevers 2018-08-10 14:00:44 CEST
If I keep the EFI partition not mounted (unmounted through diskdrake) and run grub-customizer from Cauldron installed on the testmachine I get a very similar error when I try to save the bootloader to MBR:

quote
Error while installing the bootloader

Installing for x86_64-efi platform.
grub2-install: error: cannot find EFI directory.
[ OK ]
unquote

so maybe the error is caused by either grub2-efi or by the way that draklive-install passes commands to grub2(-efi).
Marja Van Waes 2018-08-10 18:06:53 CEST

CC: (none) => zen25000

Dick Gevers 2018-08-16 12:52:24 CEST

Keywords: (none) => FOR_ERRATA6

Comment 13 Martin Whitaker 2018-09-28 22:17:37 CEST
The fix for bug 23603 fixes this bug too.
Comment 14 Martin Whitaker 2018-10-01 23:23:53 CEST
This should be fixed on the ISOs dated 1st October.
Comment 15 Dick Gevers 2018-10-02 13:03:55 CEST
Yes looks fine to me

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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