[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: installer: Remove logical devices.

From: guix-commits
Subject: branch master updated: installer: Remove logical devices.
Date: Thu, 06 Aug 2020 05:31:46 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 5697a52  installer: Remove logical devices.
5697a52 is described below

commit 5697a524a75efae6144fcfaad730115910a34171
Author: Mathieu Othacehe <>
AuthorDate: Thu Aug 6 11:24:58 2020 +0200

    installer: Remove logical devices.
    If a device contains an active logical volume, BLKRRPART will report that 
    device is busy. This will cause this device to be filtered by
    "non-install-devices" procedure, which is not desired.
    Make sure to deactivate all logical volumes before device probing.
    Fixes <>.
    * gnu/installer.scm (installer-program): Add lvm2-static to the inputs.
    * gnu/installer/parted.scm (remove-logical-devices): New procedure,
    (init-parted): call it.
 gnu/installer.scm        | 1 +
 gnu/installer/parted.scm | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index cb2f5ad..5c3192d 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -318,6 +318,7 @@ selected keymap."
                        dosfstools ;mkfs.fat
                        e2fsprogs ;mkfs.ext4
+                       lvm2-static ;dmsetup
                        jfsutils ;jfs_mkfs
                        ntfs-3g ;mkfs.ntfs
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index 47e0a9e..ff5f6af 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -330,6 +330,11 @@ fail. See rereadpt function in wipefs.c of util-linux for 
an explanation."
   (device-sync device)
   (device-close device))
+(define (remove-logical-devices)
+  "Remove all active logical devices."
+  (with-null-output-ports
+   (invoke "dmsetup" "remove_all")))
 (define (non-install-devices)
   "Return all the available devices, except the busy one, allegedly the
 install device. DEVICE-IS-BUSY? is a parted call, checking if the device is
@@ -1340,6 +1345,9 @@ USER-PARTITIONS, or return nothing."
 (define (init-parted)
   "Initialize libparted support."
+  ;; Remove all logical devices, otherwise "device-is-busy?" will report true
+  ;; on all devices containaing active logical volumes.
+  (remove-logical-devices)
   (exception-set-handler (lambda (exception)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]