Bug 2326532 - The minimum required space for the root partition of a live installation is incorrectly defined
Summary: The minimum required space for the root partition of a live installation is i...
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 42
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: anaconda-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: f42webuitestday
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-11-15 17:09 UTC by Claus Conrad
Modified: 2025-02-26 13:16 UTC (History)
8 users (show)

Fixed In Version: anaconda-42.16
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
Partitioning (1.77 MB, application/octet-stream)
2024-11-15 17:13 UTC, Claus Conrad
no flags Details
Welcome screen (4.09 MB, application/octet-stream)
2024-11-15 17:15 UTC, Claus Conrad
no flags Details
Reclaim space (3.01 MB, application/octet-stream)
2024-11-15 17:15 UTC, Claus Conrad
no flags Details
Summary (3.59 MB, application/octet-stream)
2024-11-15 17:16 UTC, Claus Conrad
no flags Details
Error (2.19 MB, application/octet-stream)
2024-11-15 17:16 UTC, Claus Conrad
no flags Details
journal.output (973.92 KB, text/plain)
2024-11-18 08:27 UTC, Katerina Koukiou
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github rhinstaller anaconda pull 6009 0 None Merged payload: utilize disk usage for assuming the minimum required disk size in live OS 2024-11-25 16:25:15 UTC

Description Claus Conrad 2024-11-15 17:09:57 UTC
After guided shrink, the installation of the boot manager fails. See "Steps to Reproduce" for more details.

Reproducible: Didn't try

Steps to Reproduce:
1. Use the Debian 12 ISO to create the following partitions on an empty disk:
  1. An EFI System (ESP) of ~1 GB (mounted at /boot/efi in Debian)
  2. An ext4 of ~6.4 GB (mounted at / in Debian)
  3. An ext4 of the remaining space (mounted at /home in Debian)
2. Complete the Debian 12 installation. Make sure it can boot.
3. Boot the Rawhide ISO. Select "Share disk with other operating system" and note that "Reclaim space" is enabled and cannot be disabled (as expected, since there is not enough space for a new partition).
4. Select to reclaim 3 GB from the ~6.4 GB ext4 partition.
Actual Results:  
At the step "Installing the bootloader", this error message appears:
> org.fedoraproject.Anaconda.Error: [Errno 2] No such file or directory: 'efibootmgr'
An empty log area is displayed.

Expected Results:  
Installation completes successfully.

Comment 1 Claus Conrad 2024-11-15 17:13:40 UTC
Created attachment 2057945 [details]
Partitioning

Comment 2 Claus Conrad 2024-11-15 17:15:12 UTC
Created attachment 2057946 [details]
Welcome screen

Comment 3 Claus Conrad 2024-11-15 17:15:50 UTC
Created attachment 2057947 [details]
Reclaim space

Comment 4 Claus Conrad 2024-11-15 17:16:29 UTC
Created attachment 2057948 [details]
Summary

Comment 5 Claus Conrad 2024-11-15 17:16:54 UTC
Created attachment 2057949 [details]
Error

Comment 6 Katerina Koukiou 2024-11-18 08:26:22 UTC
I am able to reproduce, when the allocated size reclaimed for the new installation is very close to the required limits.

Attaching some logs for debug purposes in case someone else takes a look.

Comment 7 Katerina Koukiou 2024-11-18 08:27:01 UTC
Created attachment 2058459 [details]
journal.output

Comment 8 Katerina Koukiou 2024-11-18 12:26:22 UTC
This is most likely an issue in the anaconda backend, which incorrectly calculates the requires space for the installation.
Also I believe rsync silently fails because of missing space, therefore the target root is not populated fully, leading to this red-herring error we see here.

Comment 9 Katerina Koukiou 2024-11-18 13:35:08 UTC
Indeed, the backend was silencing rsync exceptions. https://github.com/rhinstaller/anaconda/pull/6006
After fixing that, it's clear that this fails on low space.

So this bug report now aims to anaconda backend incorrectly calculating the required space for installation on Live Image.

The calculation is done like this:

    def _calculate_required_space(self):
        """Calculate size of the live image image."""
        source = os.statvfs(self._target_mount)
        required_space = source.f_frsize * (source.f_blocks - source.f_bfree)
        log.debug("Required space: %s", Size(required_space))
        return required_space

This calculation only considers used blocks in the source filesystem but does not account for additional space requirements during the installation process, aka metadata, journaling, or system overhead.

There have been similar bugs in the past, but closed as wontfix. See https://fedoraproject.org/wiki/Common_F16_bugs#Minimum_space_for_Desktop_live_install_incorrectly_calculated

Comment 10 Adam Williamson 2024-11-25 16:25:15 UTC
I believe https://github.com/rhinstaller/anaconda/pull/6009 is meant to address this?

Comment 11 Katerina Koukiou 2024-11-27 08:06:12 UTC
@Adam yes, fix is contained in anaconda-42.16

Comment 12 Aoife Moloney 2025-02-26 13:16:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


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