Skip to content

Log each device when scanned, ignore /dev/nbd*, run blkid with timeout#265

Merged
tserong merged 3 commits intoharvester:masterfrom
tserong:wip-fix-9721
Feb 13, 2026
Merged

Log each device when scanned, ignore /dev/nbd*, run blkid with timeout#265
tserong merged 3 commits intoharvester:masterfrom
tserong:wip-fix-9721

Conversation

@tserong
Copy link
Member

@tserong tserong commented Feb 13, 2026

Problem:
NDM scans every every possible block device under /sys/block, except for /dev/loop. This can cause trouble if there's some weird device that can't be read, e.g. /dev/nbd0 which could be connected when using ceph for external storage.

Solution:

  • Ignore /dev/nbd* devices (we know we never want to manage those)
  • Run blkid with a timeout, so we don't get stuck if we hit some other weird device that's wedged somehow
  • Log each device when scanned so that if we somehow do get stuck even with the above fixes, at least we know what device we got stuck on!

Note: in the original issue I wrote that we should "Limit the disks we scan to only block devices that NDM can reasonably work with", but all I've done here is remove nbd devices. Another approach would be to explicitly only allow sd*, nvme*, dm-*, and ... what else? I don't actually know what a complete list of allowed devices should look like, so I thought it was safer to just eliminate the one that we know we've had trouble with in the past, and not skip anything else. We can always re-visit this later and add more exclusions (or flip it to the style of an "allow list").

Related Issue:
harvester/harvester#9721

Test plan:
TBD

Related-to: harvester/harvester#9721
Signed-off-by: Tim Serong <tserong@suse.com>
Related-to: harvester/harvester#9721
Signed-off-by: Tim Serong <tserong@suse.com>
Related-to: harvester/harvester#9721
Signed-off-by: Tim Serong <tserong@suse.com>
Copy link
Collaborator

@Vicente-Cheng Vicente-Cheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the enhancement!

@tserong tserong merged commit ddecdbb into harvester:master Feb 13, 2026
10 of 11 checks passed
@tserong tserong deleted the wip-fix-9721 branch February 13, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants