Repository navigation
fix(block/darwin): detect NVMe controller on Apple Silicon - #474
Merged
Merged
Conversation
storageControllerFromPlist only recognized IONVMeController in the device tree path, which never matches on Apple Silicon: the internal SSD is attached via the SoC's own storage fabric and shows up as AppleANS2Controller/AppleANS3NVMeController depending on chip generation, misclassifying it as SCSI. Match on BusProtocol == "Apple Fabric" instead, which macOS reports consistently regardless of the exact controller node name. Signed-off-by: Marat Dulin <github-commit@maratd.com>
mdevils
force-pushed
the
fix/darwin-block-tools-and-nvme
branch
from
September 19, 2026 08:33
fec9696 to
43a4cbd
Compare
This was referenced Sep 23, 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.
Summary
storageControllerFromPlistonly matchedIONVMeControllerin the device tree path to detect NVMe. On Apple Silicon Macs the internal SSD is attached through the SoC's own storage fabric instead, and the device tree node name varies by chip generation (AppleANS2Controlleron T2 Macs,AppleANS3NVMeControlleron M-series Macs, etc.), so it never matched and every internal disk was misclassified asStorageControllerSCSI.Fix: also match
BusProtocol == "Apple Fabric", which macOS reports consistently for this bus regardless of the exact controller node name.Verified against a real M-series Mac:
Disk.StorageControllernow correctly reportsNVMefor the internal SSD instead ofSCSI.Test plan
pkg/block/block_darwin_test.gocovering: standardIONVMeControllerpath, Apple SiliconAppleANS3NVMeController+Apple Fabric, T2AppleANS2Controller(no "NVMe" substring in path) +Apple Fabric, and a non-Apple-Fabric SATA/USB disk stayingSCSI.go build ./...andgo vet ./pkg/block/...ghw.Block()against real hardware (M-series MacBook Pro internal SSD)