From: "Brian C. Lane" <bcl(a)redhat.com>
Sometimes partitions end up being mounted, especially during live
installations, so add a check to make sure none of the selected disks
have mounted partitions.
---
pyanaconda/storage_utils.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/pyanaconda/storage_utils.py b/pyanaconda/storage_utils.py
index ef52b16..174ffae 100644
--- a/pyanaconda/storage_utils.py
+++ b/pyanaconda/storage_utils.py
@@ -323,6 +323,8 @@ def sanity_check(storage, min_ram=isys.MIN_RAM):
exns += verify_LUKS_devices_have_key(storage)
+ exns += check_mounted_partitions(storage)
+
return exns
@@ -345,6 +347,22 @@ def verify_LUKS_devices_have_key(storage):
yield LUKSDeviceWithoutKeyError(_("Encryption requested for LUKS device %s but no encryption key specified for this device.") % (dev.name,))
+def check_mounted_partitions(storage):
+ """ Check the selected disks to make sure all their partitions are unmounted.
+
+ :rtype: generator of str
+ :returns: a generator of error messages, may yield no error messages
+ """
+ for disk in storage.disks:
+ if not disk.format:
+ continue
+
+ for part in disk.format.partitions:
+ if part.busy:
+ yield SanityError(_("%s is currently mounted and cannot be used for the "
+ "installation. Please unmount it and retry.") % part.path)
+
+
def bound_size(size, device, old_size):
""" Returns a size bounded by the maximum and minimum size for
the device.
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/fe6aa5b01eeed898801f1d418703…
Sometimes partitions end up being mounted, especially during live
installations, so add a check to make sure none of the selected disks
have mounted partitions.
--
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/613
This should fix the recent failures of tests because of libbytesize's translations being finally in place.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/399
This is just one commit on top of #392 and #394.
I closed #395 because I accidentally created it against `master` instead of `2.2-devel`.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/396