Skip to content

blockdev: exclude RAID member devices from filesystem label search#1745

Merged
prestist merged 2 commits into
coreos:mainfrom
prestist:issue-1731-fix-raid1-unique-boot-check
May 18, 2026
Merged

blockdev: exclude RAID member devices from filesystem label search#1745
prestist merged 2 commits into
coreos:mainfrom
prestist:issue-1731-fix-raid1-unique-boot-check

Conversation

@prestist
Copy link
Copy Markdown
Contributor

@prestist prestist commented May 15, 2026

While investigating the issue, I found that get_filesystems_with_label() in blockdev.rs doesn't really account for RAID devices. When a RAID1 mirror boot is configured, blkid -p returns both (/dev/md127) and (/dev/sdb1) — both carrying the "boot" label but with different UUIDs. I dont think that the UUID deduplication will be suitable here... Soooo.. I filtered out RAID and I noticed we did not account for failed raid situations.. or bad state.. So I added a check in verify_unique_fs() that detects this case and reports which RAID devices are in a odd state.

fixes:#1731

Supported by claude

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves diagnostics when a labeled filesystem is missing by distinguishing between assembled filesystems and RAID member devices. It updates get_filesystems_with_label to exclude RAID members and introduces get_raid_members_with_label to detect them, accompanied by new unit tests for blkid parsing. Feedback from the review suggests optimizing performance by avoiding redundant partition table rereads and refactoring the label-searching logic into a single pass to minimize expensive block device scans.

Comment thread src/bin/rdcore/unique_fs.rs Outdated
Comment thread src/blockdev.rs
@prestist prestist force-pushed the issue-1731-fix-raid1-unique-boot-check branch from 0b1b003 to 6216b8e Compare May 18, 2026 14:13
@prestist prestist force-pushed the issue-1731-fix-raid1-unique-boot-check branch from c9a4e23 to 8af5251 Compare May 18, 2026 17:37
Copy link
Copy Markdown
Contributor

@yasminvalim yasminvalim left a comment

Choose a reason for hiding this comment

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

/LGTM

@prestist prestist merged commit 95d56cd into coreos:main May 18, 2026
15 checks passed
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