linux drive selection + linux usb drive benchmark + drive space check - #211
Merged
Conversation
…to adjust to 32KB for direct io on vfat.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving Linux drive selection and USB-drive benchmarking reliability, addressing issues around drive enumeration, Direct I/O constraints on vfat/FAT32, SMART handling on USB, and pre-flight validation (space/access) before starting a benchmark.
Changes:
- Enumerate Linux drives via
/proc/mountsinstead ofFile.listRoots(), and improve drive model display for USB by combininglsblkVENDOR+MODEL. - Make Direct I/O on Linux more robust by deriving an effective alignment from filesystem block size, and falling back to buffered I/O when Direct I/O fails.
- Add pre-benchmark disk space checks with a safety margin and tighten transaction handling for benchmark persistence.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| jdm-core/src/main/java/jdiskmark/UtilOs.java | Adds Linux mount enumeration and vendor+model lookup; adjusts bus type detection logic. |
| jdm-core/src/main/java/jdiskmark/Util.java | Switches Linux drive model display to vendor+model. |
| jdm-core/src/main/java/jdiskmark/SelectDriveFrame.java | Updates static import to the new DriveChecker. |
| jdm-core/src/main/java/jdiskmark/Sample.java | Introduces Direct I/O retry/fallback behavior and centralizes effective alignment usage. |
| jdm-core/src/main/java/jdiskmark/Gui.java | Adds early USB SMART gating with user messaging. |
| jdm-core/src/main/java/jdiskmark/DrivePanel.java | Uses Linux mount enumeration for drive dropdown and improves mount selection logic. |
| jdm-core/src/main/java/jdiskmark/DriveChecker.java | New helper for target directory validation and disk space pre-checks. |
| jdm-core/src/main/java/jdiskmark/DriveAccessChecker.java | Removed in favor of DriveChecker. |
| jdm-core/src/main/java/jdiskmark/BenchmarkWorker.java | Wraps autosave persistence in a try/catch with rollback. |
| jdm-core/src/main/java/jdiskmark/BenchmarkRunner.java | Adds effective alignment resolution and uses config.testDir for environment mapping. |
| jdm-core/src/main/java/jdiskmark/Benchmark.java | Hardens deleteAll() transaction handling (rollback on active transaction, rollback on failure). |
| jdm-core/src/main/java/jdiskmark/App.java | Adds 32K sector alignment option and enforces disk space check before benchmark start. |
| jdm-core/docs/design.md | Updates documentation reference from DriveAccessChecker to DriveChecker. |
| jdm-core/docs/benchmarks.md | Adds detailed Linux/USB benchmarking notes (Direct I/O constraints, alignment behavior, SMART, model detection). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was
linked to
issues
Aug 11, 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 of changes:
here is a benchmark of a usb drive on ubuntu