pop-os / distinst

Installer Backend
GNU Lesser General Public License v3.0
222 stars 42 forks source link

Reduce or remove minimum EFI ESP partition size requirement #239

Closed vjr closed 5 months ago

vjr commented 3 years ago

Distribution (run cat /etc/os-release):

elementary OS 6 (Odin) early access.

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

The new Odin installer which uses distinst.

Issue/Bug Description:

When installing elementary OS alongside Windows 10 the user is forced to create another ESP (EFI system partition) even though Win10 already has created a 100 MiB ESP because distinst enforces a minimum ESP size of 256 MiB here: https://github.com/pop-os/distinst/blob/30ac4051febf1847f732de7e25261c869a852741/crates/disks/src/config/disks.rs#L981

Steps to reproduce (if you know):

  1. Start installer of elementary OS 6.
  2. Select the existing Win10-created ESP as /boot/efi mount point.
  3. Observe error message indicating to the effect "EFI too small".

Expected behavior:

The installer (hence distinst) should allow using the existing Win10 created 100 MiB ESP as the /boot/efi mount point.

The suggestion here is to set the minimum to a little under 100 MiB and set a default to the recommended 256 MiB, if this is workable?

Other Notes:

See https://github.com/elementary/installer/pull/449 and also the following comments in https://github.com/elementary/installer/issues/446

"Rationale for this issue report is that on my computers I first install Windows 10 which creates an ESP of 100 MB and then I proceed to install about 4 more instances of linux in a multi boot and the ESP size of 100 MB is more than enough."

"This will unblock installations in users' scenarios such as mine where I have pre-created multiple partitions for OS installations (with Windows 10 being the first) and do not wish to create multiple EFI partitions on disk."

vjr commented 3 years ago

Apologies for the reminder - I just wanted to add/summarise that my issue report was to request removing the hardcoded EFI ESP partition size limit from the distinst library and let the client app (like the elementary installer) enforce the limit.

I believe since Pop OS uses systemd-boot it would need a larger EFI ESP partition since the kernels are stored there whereas elementary OS using GRUB does not require as much space since the kernels are stored under /boot and not /boot/efi

There is already code in the elementary installer to check/enforce size limit:

https://github.com/elementary/installer/blob/master/src/Views/PartitioningView.vala#L47

and

https://github.com/elementary/installer/blob/master/src/Views/PartitioningView.vala#L277

and the README.md file in the distinst repo also has the Vala example showing client app enforcing the size requirement:

https://github.com/pop-os/distinst/blob/master/README.md#vala-example

I'm hoping to get a PR merged into the the elementary installer to enable the user scenario mentioned in the initial comment of this issue report: https://github.com/pop-os/distinst/issues/239#issue-792413897

cmpute commented 3 years ago

I also hope this can be fixed since this is the only thing preventing me from installing elementary os right now

alaa-yahia commented 3 years ago

I hope they fix this. I have moved back to elementary 5.1 due to this issue.

deepu2 commented 3 years ago

I wanted to install eOS 6 and facing the same issue. Is there a workaround for this? I might end up installing manjaro if not.

vjr commented 3 years ago

I wanted to install eOS 6 and facing the same issue. Is there a workaround for this? I might end up installing manjaro if not.

You can do custom partitioning and just create a second efi partition which is supported by uefi bios and proceed with your installation?

deepu2 commented 3 years ago

I wanted to install eOS 6 and facing the same issue. Is there a workaround for this? I might end up installing manjaro if not.

You can do custom partitioning and just create a second efi partition which is supported by uefi bios and proceed with your installation?

That is what I ultimately did, thanks!

arncor commented 2 years ago

I have about 160MB space left on my 200MB EFI partitiion. This is the only thing currently preventing me from installing Elementary OS 6. I have already MacOS + Manjaro + Elementary OS 5.1

how much space is really needed for the installation ?

vjr commented 2 years ago

you can try custom install and create (or resize another partition to create) a second EFI partition - I made a second one of about 600 MiB, someone earlier in this issue mentioned 256 MiB is enough.

jlozano-rh commented 2 years ago

@vjr yes... Ubuntu in the other hand recognize and works well with a 100MiB partition. So, is really necessary this constraint?

wiredmatt commented 2 years ago

So? No plans on removing that constant? For anyone looking for a quick solution, you can make another boot partition just for Pop OS.

Or you can try what I'm trying now (which I'm 100% certain will fail), resize the partitions in GParted and cross your fingers

Also don't remember to reboot at least twice into windows right after resizing.

As mentioned in previous recipes, if you resize or move a partition containing an NTFS file system, then you should reboot into Windows twice to permit Windows to perform file system consistency checks.

dag7dev commented 1 year ago

Up! Damn, it is so frustrating!

udance4ever commented 5 months ago

just a heads up the minimum EFI partition size is now greater than 256MB (while it could be smaller, 512MB is acceptable in the Elementary 7.1 (based on Ubuntu 22.04 LTS) installer)

GParted threw all kinds of errors attempting to move and resize partitions (thank god I’m working on a backup clone so let’s see what happens!) so I will be very happy when this limit is removed as it is artificial and if anything, introduces what I feel is unnecessary risk requiring a good chuck of people to fiddle with updating their partition tables!

mmstick commented 5 months ago

I'd be more likely to raise it further than reduce it at this point. People are struggling daily with the EFI running out of disk space with 512 MB. 1 GB is the bare minimum for a reason.

udance4ever commented 5 months ago

I'd be more likely to raise it further than reduce it at this point. People are struggling daily with the EFI running out of disk space with 512 MB. 1 GB is the bare minimum for a reason.

what are people putting in their EFI folder?

My EFI folder never grows beyond 200MB (what macOS created it as)

I think the /boot directory (which understandably has a minimum of 1GB) is being confused with /boot/efi

mmstick commented 5 months ago

This is what I have on mine.

root@pop-os:/boot/efi# du -h
132M    ./EFI/Recovery-9B99-7FB6
131M    ./EFI/Pop_OS-a1a189be-35ba-4fe6-b850-951cf6860cd7
104K    ./EFI/systemd
104K    ./EFI/BOOT
4.0K    ./EFI/Linux
262M    ./EFI
12K ./loader/entries
24K ./loader
4.0K    ./14d03d966d95610d468a589365e799d3
262M    .

This is one kernel plus a recovery partition kernel. Most people have two kernels (current and oldkern) + a recovery partition, so add another 131M. It's a tight squeeze when updating the EFI partition with 512M. Add 100M to that figure if it's a system that's dual bootng with Windows. Altogether that's about 500M and suddenly you can't update the kernel anymore.

udance4ever commented 5 months ago

ah thanks for explaining that - I didn’t realize when I found this thread that this was a popOS repo as all kinds of distros were being mentioned.

my install boots macOS, ElementaryOS, Ubuntu, and Batocera Linux and hasn’t really used much space in EFI even after installing the OpenCore Bootloader.

again, I’m not using PopOS, so clearly kernel updates happen differently than in Ubuntu-based distros.

mmstick commented 5 months ago

We use systemd-boot as our bootloader, which chainloads the EFISTUB functionality in the kernel. So the kernel has to be on the EFI partition for Linux to be able to boot itself. Without a middleman to boot the system, it's fast to boot and significantly reduces surface area for vulnerabilities.

Kernels and firmware packaging is getting bigger and bigger as time goes by though. In the recent past, we had to force-enable XZ compressionof the initramfs to allow older installs with a 500M partition to continue to update. Lately it's looking like we're at the 500M threshold again with Linux 6.8.0