[Libguestfs] [PATCH v2v] convert: Ignore /dev/mapper/osprober-* devices when trimming

Richard W.M. Jones rjones at redhat.com
Mon May 16 15:46:07 UTC 2022


These devices can be left around by either grub2 or the osprober tool.
They are read-only mirrors of existing filesystems and it appears we
can safely ignore them.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2003503
---
 convert/convert.ml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/convert/convert.ml b/convert/convert.ml
index 87fca7252b..997f6b08bd 100644
--- a/convert/convert.ml
+++ b/convert/convert.ml
@@ -194,10 +194,16 @@ and do_fstrim g inspect =
   (* Get all filesystems. *)
   let fses = g#list_filesystems () in
 
+  (* Ignore unknown/swap devices. *)
   let fses = List.filter_map (
     function (_, ("unknown"|"swap")) -> None | (dev, _) -> Some dev
   ) fses in
 
+  (* Ignore filesystems left around by osprober (RHBZ#2003503). *)
+  let fses =
+    List.filter (fun dev -> not (String.is_prefix dev "/dev/mapper/osprober-"))
+                fses in
+
   (* Trim the filesystems. *)
   List.iter (
     fun dev ->
-- 
2.35.1



More information about the Libguestfs mailing list