From 91728177c2244e1848e17dd306806284a9efe5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 25 Oct 2019 05:09:00 +0200 Subject: [PATCH] anaconda: fix required disk space reporting in reclaim space dialog Blivet (storage library) reserve 20% of volume group space if there is thin pool created. Include it in required space reporting. QubesOS/qubes-issues#5345 --- ...ace-needed-for-LVM-thin-provisioning.patch | 79 +++++++++++++++++++ anaconda/anaconda.spec | 1 + 2 files changed, 80 insertions(+) create mode 100644 anaconda/0058-Report-20-space-needed-for-LVM-thin-provisioning.patch diff --git a/anaconda/0058-Report-20-space-needed-for-LVM-thin-provisioning.patch b/anaconda/0058-Report-20-space-needed-for-LVM-thin-provisioning.patch new file mode 100644 index 0000000..12c1941 --- /dev/null +++ b/anaconda/0058-Report-20-space-needed-for-LVM-thin-provisioning.patch @@ -0,0 +1,79 @@ +From 0f181e582ff47bb216f0f334a77518197d05f0fb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= + +Date: Thu, 24 Oct 2019 18:11:46 +0200 +Subject: [PATCH] Report 20% space needed for LVM thin provisioning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Organization: Invisible Things Lab +Cc: Marek Marczykowski-Górecki + +blivet reserver 20% free space if thin pool is created. Anaconda/blivet +interface for reporting metadata/reserved space is lacking. As a +workaround add 20% at GUI layer. + +Signed-off-by: Marek Marczykowski-Górecki +--- + pyanaconda/ui/gui/spokes/lib/resize.py | 7 +++++++ + pyanaconda/ui/gui/spokes/storage.py | 5 +++++ + 2 files changed, 12 insertions(+) + +diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py +index 73be5e23e..2626bec0d 100644 +--- a/pyanaconda/ui/gui/spokes/lib/resize.py ++++ b/pyanaconda/ui/gui/spokes/lib/resize.py +@@ -31,6 +31,7 @@ from pyanaconda.ui.gui import GUIObject + from pyanaconda.ui.gui.utils import blockedHandler, escape_markup, timed_action + from blivet.size import Size + from blivet.formats.fs import FS ++from pykickstart.constants import AUTOPART_TYPE_LVM_THINP + + __all__ = ["ResizeDialog"] + +@@ -84,6 +85,9 @@ class ResizeDialog(GUIObject): + self._required_label = self.builder.get_object("requiredSpaceLabel") + markup = _("Installation requires a total of %s for system data.") + required_dev_size = self.payload.requiredDeviceSize(FS.biggest_overhead_FS()) ++ if self.storage.autopart_type == AUTOPART_TYPE_LVM_THINP: ++ # blivet reserve 20% free space in volume group if thin pool is created ++ required_dev_size /= 0.8 + self._required_label.set_markup(markup % escape_markup(str(required_dev_size))) + + self._reclaimDescLabel = self.builder.get_object("reclaimDescLabel") +@@ -315,6 +319,9 @@ class ResizeDialog(GUIObject): + + def _update_reclaim_button(self, got): + required_dev_size = self.payload.requiredDeviceSize(FS.biggest_overhead_FS()) ++ if self.storage.autopart_type == AUTOPART_TYPE_LVM_THINP: ++ # blivet reserve 20% free space in volume group if thin pool is created ++ required_dev_size /= 0.8 + self._resizeButton.set_sensitive(got+self._initialFreeSpace >= required_dev_size) + + # pylint: disable=arguments-differ +diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py +index a75f1dfc9..0c6000f2e 100644 +--- a/pyanaconda/ui/gui/spokes/storage.py ++++ b/pyanaconda/ui/gui/spokes/storage.py +@@ -874,6 +874,9 @@ class StorageSpoke(NormalSpoke, StorageChecker): + + disks_size = sum((d.size for d in disks), Size(0)) + required_space = self.payload.spaceRequired ++ if self.storage.autopart_type == AUTOPART_TYPE_LVM_THINP: ++ # blivet reserve 20% free space in volume group if thin pool is created ++ required_space /= 0.8 + auto_swap = sum((r.size for r in self.storage.autopart_requests + if r.fstype == "swap"), Size(0)) + if self.autopart and auto_swap == Size(0): +@@ -1021,6 +1024,8 @@ class StorageSpoke(NormalSpoke, StorageChecker): + dialog = ResizeDialog(self.data, self.storage, self.payload) + dialog.refresh(disks) + else: ++ # respect disk selection and other choices in the ReclaimDialog ++ self.apply() + dialog = self._check_space_and_get_dialog(disks) + + if dialog: +-- +2.20.1 + diff --git a/anaconda/anaconda.spec b/anaconda/anaconda.spec index 95427e6..d78cc1e 100644 --- a/anaconda/anaconda.spec +++ b/anaconda/anaconda.spec @@ -75,6 +75,7 @@ Patch54: 0054-anaconda-abort-installation-on-X-startup-fail.patch Patch55: 0055-anaconda-fix-encryption-passphrase-check.patch Patch56: 0056-anaconda-disable-os-prober.patch Patch57: 0057-Add-plymouth.ignore-serial-consoles-boot-option-by-d.patch +Patch58: 0058-Report-20-space-needed-for-LVM-thin-provisioning.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things).