Skip to content

Commit

Permalink
convert: Remove /dev/mapper/osprober-linux-* devices left around by g…
Browse files Browse the repository at this point in the history
…rub2

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 <lersek@redhat.com>
  • Loading branch information
rwmjones committed May 17, 2022
1 parent 4ad661b commit e06cf5b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion convert/linux_bootloaders.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e06cf5b

Please sign in to comment.