trusty upgrade: grub-install fails with odd file error

Bug #1282375 reported by David Britton
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
High
Unassigned
shim-signed (Ubuntu)
New
Undecided
Unassigned

Bug Description

Grub-efi-amd64 package upgrade to trusty (from saucy) fails. I get an odd error when running

dpb@starbuck:grub-efi-amd64$ sudo apt-get -f install grub-efi-amd64
Reading package lists... Done
Building dependency tree
Reading state information... Done
grub-efi-amd64 is already the newest version.
The following packages were automatically installed and are no longer required:
  blt gnome-control-center-unity libalgorithm-c3-perl libamd2.2.0 libavformat53:i386 libboost-date-time1.53.0 libboost-iostreams1.53.0 libboost-python1.53.0 libboost-signals1.53.0 libboost-system1.53.0 libboost-thread1.53.0
  libcdt4 libcgraph5 libclass-c3-perl libclass-c3-xs-perl libcmis-0.3-3 libcolamd2.7.1 libcurl3-gnutls:i386 libdb5.1:i386 libebackend-1.2-6 libedata-book-1.2-17 libedata-cal-1.2-20 libexplain30 libfftw3-3 libfm-gtk-bin libgraph4
  libgvpr1 libgweather-3-3 libhud-client2 libllvm3.3 libllvm3.3:i386 libmng1:i386 libmro-compat-perl libpoppler43 libprocps0 libqpdf10 librhythmbox-core7 libseccomp1 libsecret-1-0:i386 libswscale2:i386 libtidy-0.99-0
  libumfpack5.4.0 libwebp4:i386 libwebp4 libxcb-sync0 linux-headers-3.10.0-0 linux-headers-3.10.0-0-generic linux-headers-3.10.0-1 linux-headers-3.10.0-1-generic linux-headers-3.10.0-2 linux-headers-3.10.0-2-generic
  linux-headers-3.10.0-3 linux-headers-3.10.0-3-generic linux-headers-3.11.0-11 linux-headers-3.11.0-11-generic linux-headers-3.11.0-12 linux-headers-3.11.0-12-generic linux-headers-3.11.0-4 linux-headers-3.11.0-4-generic
  linux-headers-3.11.0-9 linux-headers-3.11.0-9-generic linux-headers-3.9.0-7 linux-headers-3.9.0-7-generic linux-image-3.10.0-0-generic linux-image-3.10.0-1-generic linux-image-3.10.0-2-generic linux-image-3.10.0-3-generic
  linux-image-3.11.0-11-generic linux-image-3.11.0-12-generic linux-image-3.11.0-4-generic linux-image-3.11.0-9-generic linux-image-3.9.0-7-generic linux-image-extra-3.11.0-12-generic openbox-themes openjdk-7-jre-lib python-apsw
  python-beautifulsoup python-imaging-compat python-utidylib vgabios
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up grub-efi-amd64 (2.02~beta2-6) ...
Installing for x86_64-efi platform.
grub-install: error: Can't create file: No such file or directory.
dpkg: error processing package grub-efi-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 grub-efi-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then, I follow-on with:

# grub-install
grub-install: error: Can't create file: No such file or directory.

I will attach the -v output to the bug, I'm afraid it doesn't shed any more light on the problem for me.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: grub-efi-amd64 2.02~beta2-6
ProcVersionSignature: Ubuntu 3.11.0-15.25-generic 3.11.10
Uname: Linux 3.11.0-15-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.13.2-0ubuntu5
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Feb 19 20:46:54 2014
InstallationDate: Installed on 2012-03-27 (694 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64+mac (20120327.1)
SourcePackage: grub2
UpgradeStatus: Upgraded to trusty on 2014-02-18 (1 days ago)

Revision history for this message
David Britton (dpb) wrote :
Revision history for this message
David Britton (dpb) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
medb (medb) wrote :

I had the same problem because the /boot/efi partition was formatted in HFS+ file system. But grub-install doesn't allow this, even if it mounted as read-write.

Previously the /usr/sbin/grub-install file was a script and I have commented this check. Now it's binary file so I can't do this.
Example of disabling efi partition check if /usr/sbin/grub-install file is script:

    if test -n "$efidir"; then
        efi_fs=`"$grub_probe" --target=fs "--device-map=${device_map}" "${e$
# if test "x$efi_fs" = xfat; then :; else
# gettext_printf "%s doesn't look like an EFI partition.\n" "${ef$
# efidir=
# fi
    fi

So I have come up with the next hack:
1. Backup all files from /boot/efi partition
2. Format /boot/efi partition to FAT file system and mount it to the /boot/efi path
3. Copy all files backed up from the original /boot/efi partition to the new one
4. Run `sudo grub-install` and `sudo dpkg --configure grub-efi-amd64`. Should complete successfully.
5. Backup all files from the /boot/efi partition after successful grub upgrade/install
6. Format /boot/efi partition to HFS+ file system and mount it to the /boot/efi path
7. Copy all files backed up from the /boot/efi partition after grub upgrade/install to the new one
8. Update /etc/fstab to mount the /boot/efi partition during boot

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

It prevents the package (or a dependent one) from functioning correctly at all.

Changed in grub2 (Ubuntu):
importance: Undecided → High
Revision history for this message
jandro (thejandroman) wrote :

Running into a similar issue with shim-signed:

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1565578

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.