Bug 2068290 - Required space calculation includes room for swap partition even if one won't be created
Summary: Required space calculation includes room for swap partition even if one won't...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-24 20:10 UTC by Adam Williamson
Modified: 2022-12-13 17:20 UTC (History)
8 users (show)

Fixed In Version: anaconda-37.12-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-13 17:20:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2022-03-24 20:10:57 UTC
When you go through INSTALLATION DESTINATION and pick automatic partitioning, anaconda runs a calculation of whether there's enough free space and requires you to clear some if there isn't enough.

This calculation seems to *always* include space for a swap partition, even though on Fedora we do not create one by default any more since https://fedoraproject.org/wiki/Changes/SwapOnZRAM . The calculation is done here:

https://github.com/rhinstaller/anaconda/blob/c714884495691310b44305e09c24c1522c50d70a/pyanaconda/ui/gui/spokes/storage.py#L622

It *always* includes space for a swap partition - `auto_swap = suggest_swap_size()` , then includes `auto_swap` in subsequent calculations and calls - without regard to whether the automatic partitioning will actually create one.

I believe this code was written before the swaponzram change and just nobody realized it would need updating with that change; before that change, we could assume that automatic partitioning would always include a swap partition of the size suggested by `suggest_swap_size()`, but these days that is no longer a safe assumption.

Note I think there *are* still some cases in which a swap partition is included, so we need to do some kind of check as to whether one is going to be included, we can't just switch to *always* not including it in the calculation.

Comment 1 Adam Williamson 2022-03-24 20:11:51 UTC
Sorry, forgot to credit Richard Shaw for this discovery - I'm just passing the report along:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/OAQTWLBNZQ54OZE7FHJQYZDVY4FQO5NG/

Comment 2 Vendula Poncova 2022-07-26 14:25:09 UTC
Fixed in https://github.com/rhinstaller/anaconda/pull/4238.

Comment 3 Adam Williamson 2022-07-26 21:30:25 UTC
Woohoo! Thanks.

Comment 4 Ben Cotton 2022-08-09 13:41:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.


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