UEFI on Legacy - grub-install fails due to no space left on ESP

Bug #1901137 reported by KLA Khan
172
This bug affects 23 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Triaged
High
Unassigned

Bug Description

The system has PCLinuxOS on sda1 and sda2 Linux Mint 20 on sda9 and sda10 Windows 7 on sdb1 Windows 10 on sdb2

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: ubiquity 20.10.13
ProcVersionSignature: Ubuntu 5.8.0-25.26-generic 5.8.14
Uname: Linux 5.8.0-25-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
CasperMD5CheckResult: pass
CasperVersion: 1.455
Date: Fri Oct 23 12:26:45 2020
InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz file=/cdrom/preseed/ubuntu-mate.seed maybe-ubiquity quiet splash ---
LiveMediaBuild: Ubuntu-MATE 20.10 "Groovy Gorilla" - Release amd64 (20201022)
RebootRequiredPkgs:
 linux-image-5.8.0-25-generic
 linux-base
 linux-base
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
KLA Khan (klakhan) wrote :
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report. It's because the EFI partition is full

Oct 23 06:55:22 ubuntu-mate grub-installer: grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/ubuntu/grubx64.efi': No space left on device.
Oct 23 06:55:22 ubuntu-mate grub-installer: error: Running 'grub-install --force --target x86_64-efi "/dev/sdb7"' failed.

summary: - I tried to install a fresh install of Ubuntu-Mate 20.10 on a machine
- which has other OSS also in a Multiboot System. After completing the
- installation it is unable to Install Grub and failed. I tried to install
- on ?dev/sda , /dev/sdb and also /dev/sdb7 the partition where I have
- tried to install the Ubuntu Mate-20.10 . The grub failed to install in
- all the three attempts. The installer fails at the stage when it tries
- "grub-install".
+ grub-install fails due to no space left on ESP
Changed in ubiquity (Ubuntu):
status: New → Triaged
tags: added: rls-hh-incoming
Changed in ubiquity (Ubuntu):
importance: Undecided → Critical
Changed in ubiquity (Ubuntu):
status: Triaged → Fix Committed
Changed in ubiquity (Ubuntu):
status: Fix Committed → Triaged
summary: - grub-install fails due to no space left on ESP
+ UEFI on Legacy - grub-install fails due to no space left on ESP
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Ubiquity tries to re-use ESP if possible.

Given that we booted in Bios mode, I wonder, if ubiquity missdetects the ESP on the usb/cdrom that installer was booted from, as the one that can be reused.... when it really can't.

Whilst looking through the logs, it is not obvious to me, if a sane ESP is present on the target disks, and is usable. Or not.

Not sure which install method is being used, and if everyone is trying to resize / use_free or wiping full disks.

Revision history for this message
KLA Khan (klakhan) wrote : Re: [Bug 1901137] Re: UEFI on Legacy - grub-install fails due to no space left on ESP

I have only the existing partitions ; since I wanted a fresh install and
therefore both the / and /home partitions were formatted.
I am not able to follow the "No space in ESP" since I never needed to know
about it.

I decided to test with another distro and I could succeed with no issues
(Fedora Live Station 30) and I am running all without any issue coming up
so far (touch wood !!)

{{ Five OSs MultiBoot with two sata disks (500GB +1000GB) in a Intel P4
Machine with Gigabyte GA31 MB }}

Really it is an antique one which I got assembled in 2004. Later main
upgrades were adding DVD and DVD Writer and Sata HDs from original 40GB
Disk over all these years.

Just for informazion.

K L A Khan
Email : <email address hidden>

On Tue 27 Oct, 2020, 3:25 PM Dimitri John Ledkov, <
<email address hidden>> wrote:

> Ubiquity tries to re-use ESP if possible.
>
> Given that we booted in Bios mode, I wonder, if ubiquity missdetects the
> ESP on the usb/cdrom that installer was booted from, as the one that can
> be reused.... when it really can't.
>
> Whilst looking through the logs, it is not obvious to me, if a sane ESP
> is present on the target disks, and is usable. Or not.
>
> Not sure which install method is being used, and if everyone is trying
> to resize / use_free or wiping full disks.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1901137
>
> Title:
> UEFI on Legacy - grub-install fails due to no space left on ESP
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1901137/+subscriptions
>

Revision history for this message
florin (florin-arjocu) wrote :

I have 3 OS's (Windows and last 2 Ubuntu's) on my first laptop hard drive (SDD). Every 6 months (for the last few years) I had these actions: keep Windows 10 that came with the laptop, keep the previous Ubuntu and install the latest formatting the partition with the ones 2 launches away. This time it did not work, for the first time, so it is something only related to 20.04 version.
(my BIOS is in legacy mode)

It says that fix is commited, does it mean it will go into the Ubuntu .iso so we can install it?
Thank you for trying to fix for the noobies!

Changed in ubiquity (Ubuntu):
importance: Critical → High
tags: added: fr-873
removed: rls-hh-incoming
Revision history for this message
Matt (mghemke) wrote :

For me, it seems that the installer is ignoring my setting on where to install MBR (on the Something else... partition screen of the installer). I confirmed that the selected device both has an EFI partition, and that the EFI Partition has space (more than 200 MB). I am booting off external SD card reader, where I installed the Live Installer. Note the live installer EFI partition is only 5MB. I deselected the EFI partition from the liveinstall card ("Do not use this partition") and tried setting the "Install MBR to device" setting to both the internal SD disk device, and the specific partition. (If this isn't the same problem as here, recommend reopening 1902438)

I am able to mount and view the desired EFI Partition from the livesession.

Revision history for this message
Matt (mghemke) wrote :

As additional confirmation that the installer was trying to write the MBR to the install media, I was successful in installing 20.10 from the same install media on the same hardware by booting the install media to ram, as described here: https://askubuntu.com/questions/829917/can-i-boot-a-live-usb-fully-to-ram-allowing-me-to-remove-the-disk.

I then removed the install media once live, and ran the install, and all installation went without a hitch, and I am now commenting from a fresh, new 20.10 install.

In my case, install media is a removable SD card, if that's pertinent.

Revision history for this message
florin (florin-arjocu) wrote :

I just tried the workaround tested by @Matt, to add the toram option on booting the USB drive, but in my case, it did not work. Maybe "toram" did not work, don't know how to test thst, but in my installation of 20.10 Ubuntu, I got the same grub intall failure. If it matters, I did not remove the usb thumb drive. I will attach the messages during the failure, in my case it seems to try installing EUFI, but my Bios is in legacy mode.

Revision history for this message
florin (florin-arjocu) wrote :

I know there is not much happening here, but anyone managed to install? Should I select the /dev/sda6 partition for installing the grub (or whatever it installs) - it is the partition I keep another Ubuntu version (besides Windows) or it will mess up booting the laptop? Until now, on both Ubuntu versions I keep I selected /dev/sda for installing and worked every time, until 20.10. Thanks!

Revision history for this message
Jeremie Tamburini (jeremie2) wrote :

My bug report #1902269 has been marked as duplicated of this one even if the description it's not exactly the same.

In any case it looks the problem is related to the EFI (ESP) partition, that should never be used on old BIOS or UEFI in Legacy Mode, but for some reasons the installer want it... even if we are NOT in "UEFI mode".

This might be related to recent changes of the installer https://discourse.ubuntu.com/t/groovy-to-use-grub2-for-booting-installer-media-in-any-modes-on-all-architectures/16871
You have probably noticed that now there's no difference between uefi or bios mode. When you boot the live USB, you see the same grub menu.

After many tests, these are the case where the installation has been successful:

- updating the system directly from Focal (from 20.04 to 20.10)

- creating an EFI partition during manual partitioning.
In this case the partition must be a primary partition.
(One user was able to set the EFI partition on a USB drive... it was not my case).

- Installing Ubuntu using the "Erase the disk and install Ubuntu.." will also succeed. EFI partition will be automatically created.
(Also the option "Install Ubuntu next Windows" should work, but there must be enough space for a primary partition for the EFI).

As reported on bug #1893964 (comment #8), the user was able to install the system skipping the "grub-install" launching Ubiquity with the command:
ubiquity -b
Then he manually recovered GRUB. I've tried the same, but with no success... still had problems with efi. The log reported several errors and one of them was:
## pc systemd[1]: Dependency failed for /boot/efi.
## Subject: L'unità boot-efi.mount è fallita
## Defined-By: systemd
## Support: http://www.ubuntu.com/support

I hope there will be a solution as soon as possible, this is one of the worst bug ever :(
The only lucky thing is that Ubuntu 20.10 is NOT a LTS... other wise many more users could have been in trouble.

Revision history for this message
florin (florin-arjocu) wrote :

I managed to run 20.10 after connecting to that installation from my other running Ubuntu with chroot, installing net-tools (seemed to be missing for some reason so I had no ifconfig) and then update + upgrade. There was a kernel update and grub found what it needed to be able to boot also 20.10.

Revision history for this message
Plurtu (plurtu) wrote :

Even the most straight-forward option "Erase disk and install Ubuntu" failed for me on non-UEFI system when installing from USB. I noticed that 20.04 created a single bootable partition while 20.10 creates additional BIOS Boot and EFI System partitions.

The Bug #1893964 Comment #8 workaround (doing grub-install manually) worked for me but after updating I still had to correct /etc/fstab for the /boot/efi device partition.

Revision history for this message
KLA Khan (klakhan) wrote :

Thank you for your email. I went back to reinstall 20.04.LTS without any
problem.

On Fri 11 Dec, 2020, 3:20 PM Plurtu, <email address hidden> wrote:

> Even the most straight-forward option "Erase disk and install Ubuntu"
> failed for me on non-UEFI system when installing from USB. I noticed
> that 20.04 created a single bootable partition while 20.10 creates
> additional BIOS Boot and EFI System partitions.
>
> The Bug #1893964 Comment #8 workaround (doing grub-install manually)
> worked for me but after updating I still had to correct /etc/fstab for
> the /boot/efi device partition.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1901137
>
> Title:
> UEFI on Legacy - grub-install fails due to no space left on ESP
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1901137/+subscriptions
>

Norbert (nrbrtx)
tags: removed: groovy
Norbert (nrbrtx)
tags: removed: ubuntu-mate
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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