Richard W.M. Jones
2022-May-17 10:20 UTC
[Libguestfs] [PATCH] daemon: In list_filesystems ignore /dev/mapper/osprober-* devices
Still running virt-v2v to test this one ... Rich.
Richard W.M. Jones
2022-May-17 10:20 UTC
[Libguestfs] [PATCH] daemon: In list_filesystems ignore /dev/mapper/osprober-* devices
After virt-v2v runs grub2, which runs osprober, the osprober tool leaves around read-only linear DM maps covering existing filesystems. These should be ignored since they duplicate the existing filesystems. https://listman.redhat.com/archives/libguestfs/2022-May/028871.html https://bugzilla.redhat.com/show_bug.cgi?id=2003503#c12 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2003503 --- daemon/listfs.ml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/daemon/listfs.ml b/daemon/listfs.ml index 63ced260a1..fef8b72bb7 100644 --- a/daemon/listfs.ml +++ b/daemon/listfs.ml @@ -41,6 +41,7 @@ let rec list_filesystems () *) let devices = Lvm_dm.list_dm_devices () in let devices = List.filter is_not_partitioned_device devices in + let devices = List.filter is_not_osprober_device devices in List.iter (check_with_vfs_type ret) devices; (* Partitions. *) @@ -90,6 +91,15 @@ and is_not_partitioned_device device not has_partition +(* In some circumstances the osprober tool (run by grub2) leaves + * around orphaned device-mapper maps which cover existing filesystems. + * These should be ignored. See: + * https://listman.redhat.com/archives/libguestfs/2022-May/028871.html + * https://bugzilla.redhat.com/show_bug.cgi?id=2003503#c12 + *) +and is_not_osprober_device device + not (String.is_prefix device "/dev/mapper/osprober-") + (* We should ignore Windows Logical Disk Manager (LDM) partitions, * because these are members of a Windows dynamic disk group. Trying * to read them will cause errors (RHBZ#887520). Assuming that -- 2.35.1
Richard W.M. Jones
2022-May-17 11:19 UTC
[Libguestfs] [PATCH] daemon: In list_filesystems ignore /dev/mapper/osprober-* devices
On Tue, May 17, 2022 at 11:20:32AM +0100, Richard W.M. Jones wrote:> Still running virt-v2v to test this one ...Whether or not we still want to go with this, I have now tested this version and it works 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