Skip to content

fix(agent): show correct NVMe capacity for Apple SSDs - #1873

Merged
henrygd merged 2 commits into
henrygd:mainfrom
svenvg93:1725-fix-apple-smart-ssd-size
Apr 2, 2026
Merged

henrygd merged 2 commits into
henrygd:mainfrom
svenvg93:1725-fix-apple-smart-ssd-size

Conversation

@svenvg93

@svenvg93 svenvg93 commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

📃 Description

Apple NVMe SSDs don't expose user_capacity in smartctl output, causing the SMART panel to show "0B / Unknown Capacity". Modern Macs also use IOService:/... device paths, making diskutil unusable as a fallback.

Fix uses system_profiler SPNVMeDataType -json as a Darwin-only fallback, matching by serial number. Results are cached so it's only called once per agent lifecycle.

Fixes #1725

🪵 Changelog

➕ Added

  • Darwin-only NVMe capacity fallback via system_profiler SPNVMeDataType -json when smartctl doesn't report user_capacity
  • Result cache on SmartManager (called once per lifecycle)
  • Apple NVMe test fixture and unit tests

🔧 Fixed

  • Apple NVMe drives showing 0B / Unknown Capacity in the SMART panel on macOS
Scherm­afbeelding 2026-04-01 om 20 21 25

@svenvg93
svenvg93 requested a review from henrygd as a code owner April 1, 2026 18:24
@henrygd

henrygd commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Thank you! I refactored with sync.Once to avoid using the same lock. Let me know if it still works on your end and I'll merge for the next release 👍

@henrygd henrygd moved this to In Progress in Beszel Roadmap Apr 1, 2026
@svenvg93

svenvg93 commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator Author

Everything is still working perfectly. Thanks for the refactoring!

@henrygd
henrygd merged commit 7f565a3 into henrygd:main Apr 2, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Beszel Roadmap Apr 2, 2026
@henrygd

henrygd commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Perfect, thanks so much

@svenvg93
svenvg93 deleted the 1725-fix-apple-smart-ssd-size branch April 2, 2026 19:54
rizkyilhampra pushed a commit to rizkyilhampra/beszel that referenced this pull request Apr 14, 2026
xiaoran7 pushed a commit to xiaoran7/beszel that referenced this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Apple Macbook NVME showing as 0/Unknown Capacity

2 participants