#1008204 os-prober: No need in probing ploop devices

Package:
os-prober
Source:
os-prober
Description:
utility to detect other OSes on a set of drives
Submitter:
Denis Silakov
Date:
2022-03-24 10:21:06 UTC
Severity:
normal
#1008204#5
Date:
2022-03-24 10:19:57 UTC
From:
To:
Dear Maintainer,

Ploop is a block device used by OpenVZ / Virtuozzo containers:

https://wiki.openvz.org/Ploop
https://manpages.ubuntu.com/manpages/xenial/man8/ploop.8.html

Currently on a system with running containers, os-prober
checks their ploop devices and thus analyzes OSes inside them. e.g:

  ...
  Found CentOS Linux release 7.7.1908 (Core) on /dev/ploop12024p1
  ...

However, this has nothing to do with the main system and such entries
should not go tothe host grub menu.

Moreover, such a scan slows down os-prober work if we have many containers on the system.

This can be easily fixed by a patch like the following:2

diff --git a/os-prober b/os-prober
index ccfdf13..8e69c56 100755
--- a/os-prober
+++ b/os-prober
@@ -37,6 +37,10 @@ partitions () {
                # Exclude partitions on physical disks that are part of a
                # Serial ATA RAID disk.
                for part in /sys/block/*/*[0-9]; do
+                       if [ "${part:0:16}" = "/sys/block/ploop" ]; then
+                               # Skipping ploop devices
+                               continue
+                       fi
                        if [ -f "$part/start" ] && \
                           [ ! -f "$part/whole_disk" ] && ! on_sataraid $part; then
                                name="$(echo "${part##*/}" | sed 's,[!.],/,g')"