From 964955758c772135a6fa8e207c8861466000402f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 2 Nov 2016 06:34:10 +0100 Subject: [PATCH] qubes/app: create 'default' storage pool as LVM when present When system is installed with LVM thin pool, it should be used by default. But lets keep file-based on for /var/lib/qubes for some corner cases, migration etc. QubesOS/qubes-issues#2412 --- qubes/app.py | 11 +++++++---- qubes/config.py | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/qubes/app.py b/qubes/app.py index 442a241f..10cd5fd7 100644 --- a/qubes/app.py +++ b/qubes/app.py @@ -856,13 +856,16 @@ class Qubes(qubes.PropertyHolder): 8: qubes.Label(8, '0x000000', 'black'), } - for name, config in qubes.config.defaults['pool_configs'].items(): - self.pools[name] = self._get_pool(**config) - # check if the default LVM Thin pool qubes_dom0/pool00 exists if os.path.exists('/dev/mapper/qubes_dom0-pool00-tpool'): self.add_pool(volume_group='qubes_dom0', thin_pool='pool00', - name='lvm', driver='lvm_thin') + name='default', driver='lvm_thin') + else: + self.pools['default'] = self._get_pool( + dir_path=qubes.config.qubes_base_dir, + name='default', driver='file') + for name, config in qubes.config.defaults['pool_configs'].items(): + self.pools[name] = self._get_pool(**config) self.domains.add( qubes.vm.adminvm.AdminVM(self, None, qid=0, name='dom0')) diff --git a/qubes/config.py b/qubes/config.py index f8e15d2f..46e13773 100644 --- a/qubes/config.py +++ b/qubes/config.py @@ -86,9 +86,10 @@ defaults = { 'root_img_size': 10*1024*1024*1024, 'pool_configs': { - 'default': {'dir_path': qubes_base_dir, + # create file pool even when the default one is LVM + 'varlibqubes': {'dir_path': qubes_base_dir, 'driver': 'file', - 'name': 'default'}, + 'name': 'varlibqubes'}, 'linux-kernel': { 'dir_path': os.path.join(qubes_base_dir, system_path['qubes_kernels_base_dir']),