From e06cf5b5dcbfd3f0a798eaf75c8778502c9e3bc6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 17 May 2022 11:57:09 +0100 Subject: [PATCH] convert: Remove /dev/mapper/osprober-linux-* devices left around by grub2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These devices can be left around by grub2 when it runs the osprober tool after we run “/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg”. They are read-only mirrors of existing filesystems. The problem is a very old (and fixed) known bug in the tool: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853163 These confuse later steps in conversion, specifically fstrim. Reported-by: Ming Xie Thanks: Laszlo Ersek Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2003503 Reviewed-by: Laszlo Ersek --- convert/linux_bootloaders.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/convert/linux_bootloaders.ml b/convert/linux_bootloaders.ml index a70b65a41..6b028892f 100644 --- a/convert/linux_bootloaders.ml +++ b/convert/linux_bootloaders.ml @@ -345,7 +345,14 @@ object (self) method remove_console = self#grub2_update_console ~remove:true method update () = - ignore (g#command [| grub2_mkconfig_cmd; "-o"; grub_config |]) + ignore (g#command [| grub2_mkconfig_cmd; "-o"; grub_config |]); + + (* Grub2 runs osprober which sometimes leaves around read-only + * device-mapper maps covering existing filesystems. These + * confuse later steps (especially fstrim). So just delete + * any if found. (RHBZ#2003503). + *) + ignore (g#command [| "sh"; "-c"; "rm -f /dev/mapper/osprober-linux-*" |]) method get_config_file () = grub_config