Richard W.M. Jones
2022-May-17 10:59 UTC
[Libguestfs] [PATCH v2v 2/2] convert: Remove /dev/mapper/osprober-* devices left around by grub2
Still testing this one as well ... Rich.
Richard W.M. Jones
2022-May-17 10:59 UTC
[Libguestfs] [PATCH v2v 1/2] convert: Don't duplicate grub2-mkconfig invocations
We were invoking grub2-mkconfig in the same way in two different places. This just refactors one of the calls so it uses the #update method. It should make no difference. --- convert/linux_bootloaders.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert/linux_bootloaders.ml b/convert/linux_bootloaders.ml index 0bde2c0d73..a70b65a41c 100644 --- a/convert/linux_bootloaders.ml +++ b/convert/linux_bootloaders.ml @@ -333,7 +333,7 @@ object (self) g#aug_save (); try - ignore (g#command [| grub2_mkconfig_cmd; "-o"; grub_config |]) + self#update () with G.Error msg -> warning (f_"could not rebuild grub2 configuration file (%s). This may mean that grub output will not be sent to the serial port, but otherwise should be harmless. Original error message: %s") -- 2.35.1
Richard W.M. Jones
2022-May-17 10:59 UTC
[Libguestfs] [PATCH v2v 2/2] convert: Remove /dev/mapper/osprober-* devices left around by grub2
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. These confuse later steps in conversion, specifically fstrim. Reported-by: Ming Xie Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2003503 --- 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 a70b65a41c..7c5fb0be3f 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 [| "bash"; "-c"; "rm -f /dev/mapper/osprober-*" |]) method get_config_file () grub_config -- 2.35.1
Richard W.M. Jones
2022-May-17 12:07 UTC
[Libguestfs] [PATCH v2v 2/2] convert: Remove /dev/mapper/osprober-* devices left around by grub2
On Tue, May 17, 2022 at 11:59:26AM +0100, Richard W.M. Jones wrote:> Still testing this one as well ...The version (with rm) fixes the bug for me. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top