Bug 1225371

Summary: [Agama][Milestone8+] Software needs to check the available space
Product: [openSUSE] openSUSE Tumbleweed Reporter: Lukas Ocilka <locilka>
Component: InstallationAssignee: YaST Team <yast-internal>
Status: CONFIRMED --- QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: aschnell, lslezak
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/0UCd9tV7
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: YaST logs

Description Lukas Ocilka 2024-05-27 14:39:28 UTC
Created attachment 875134 [details]
YaST logs

I've tuned the Storage proposal to contain two encrypted XFS file systems for /var and /usr:

    - partition:
        size: 500 MiB
        start: 405466 MiB (395.96 GiB)
        name: "/dev/nvme0n1p8"
        type: primary
        id: linux
        file_system: xfs
        mount_point: "/var"
        encryption:
          type: luks
          name: "/dev/mapper/cr_var"
          password: "***"

    - partition:
        size: 500 MiB
        start: 405966 MiB (396.45 GiB)
        name: "/dev/nvme0n1p9"
        type: primary
        id: linux
        file_system: xfs
        mount_point: "/usr"
        encryption:
          type: luks
          name: "/dev/mapper/cr_usr"
          password: "***"

These partitions really have 500 MiB, but XFS takes the first 300 MiB just for metadata/log (see bug #1220728) and before this, the encryption itself also takes something. The result is that these partitions have just a tiny free space for real data.

The information (and counting) about free space probably belongs to Storage/libstorage-ng, but Software should use it and check if the list of selected packages really fits. Or at least guess that and report back a warnig (?) if the doesn't.
Comment 1 Ladislav Slezák 2024-05-27 14:43:28 UTC
YaST/libzypp can already evaluate the used space, we just need to pass the proposed partitioning schema from libstorage-ng to libzypp and then check the libzypp result (fits/out of space).
Comment 2 Ladislav Slezák 2024-05-27 14:51:00 UTC
BTW the logic in the YaST module already tries to estimate the really available space.

It even tries to estimate the journal log size for several file systems like XFS: https://github.com/yast/yast-packager/blob/af6703078dcbe156efc11e808b68410ba98e2f29/src/modules/SpaceCalculation.rb#L250-L277

(Thought I do not know if that code is still up to date, it is 11+ years old...)
Comment 3 Stefan Hundhammer 2024-06-05 09:16:05 UTC
Moving to our Trello task queue.