fix(ns-storage): make no assumptions on partition naming scheme - #1873
Open
gsanchietti wants to merge 2 commits into
Open
fix(ns-storage): make no assumptions on partition naming scheme#1873gsanchietti wants to merge 2 commits into
gsanchietti wants to merge 2 commits into
Conversation
Instead of guessing the separator, read back the kname of the newly-created partition via lsblk and verify its number matches what was just created.
The previous attempt at dropping the naming-scheme assumption picked the last line of `lsblk -o KNAME` and read its last character as the partition number. NethSecurity images carry a bios_grub partition 128, which sorts last, so setup-partition computed number 8 and aborted with "Wrong partition number 8"; add-storage in partition mode always failed with setup_partition_failed. Diff the partition numbers reported by parted before and after mkpart to learn the number actually assigned, then resolve it to a kernel name via /sys/class/block/<part>/partition. This handles both sdX3 and nvme0n1p3 without guessing the separator and without assuming the data partition is number 3. Assisted-by: Claude Code:claude-opus-5[1m]
gsanchietti
marked this pull request as draft
August 7, 2026 09:50
gsanchietti
marked this pull request as ready for review
August 7, 2026 10:38
Tbaile
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of guessing the separator, read back the kname of the newly-created partition via lsblk and verify its number matches what was just created.
Refs: #1863