Bugzilla – Bug 1225371
[Agama][Milestone8+] Software needs to check the available space
Last modified: 2024-06-05 09:16:05 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.
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).
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...)
Moving to our Trello task queue.