os-prober creates a dm device by dmsetup but can not remove it.
wswsmao opened this issue · comments
There are two os located in "/" and "/target" respectively. After we type grub2-mkconfig, several unpredictable dm devices are created (The prefix of these dm devices is same: osprober-linux).
Finally, we find grub2-mkconfig call os-prober and then the latter will call a function (do_dmsetup, it create dm devices by dmsetup create) to create dm devices. The dm devices will be removed by another function (do_unmount, it remove dm devices by dmsetup remove)after many test normally, however it may spend many time to create a dm device and when do_unmount is called, the new dm device still can not be find until do_unmount function ends. Therefore
this dm device will be kept.
If we add "sleep 2" after do_dmsetup, the issue will be resolved, however it is an unreliable idea obviously.
Is there any more reliable idea?