Windows storage classification / stop rawdogging NVMes on Microsoft pp #7
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
vxfemboy/wipedicks#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
why Windows users keep killing their SSDs
On Linux and macOS,
wipedicksactually knows what it's plowing into. Linux reads/sys/class/block/<dev>/queue/rotational; macOS shells out todiskutil info -plistand parses theSolidStatekey. Both refuse to multi-pass overwrite SSDs/NVMes — because flash storage doesn't enjoy repeat performances. The Flash Translation Layer remaps your writes to fresh NAND, your "secure overwrite" leaves the original data sitting smug in over-provisioned cells, and every pass burns program/erase cycles off the drive's lifespan.On Windows it's the bad old days.
drive::classifyreturnsDriveKind::Unknownfor everything,drive::resolve_block_devicereturnsNone, and the tool happily blasts an NVMe like a $5 hooker. No refusal. No warning. No mercy. Some poor Windows user is out there grinding their Samsung 990 Pro into dust thinking they're being safe.What Needs Penetrating
Two functions in
src/drive.rsneed real Windows implementations. They currently live in the#[cfg(not(any(target_os = "linux", target_os = "macos")))]fallback bunkers:resolve_block_device(path)— map a file path to its underlying physical disk so the SSD check has something to slap.classify(dev_path)— returnDriveKind::Nvme/Sata/Rotational/Unknownfor that disk.Two Positions to Try (Pick One)
Position A: Shell Out to PowerShell (basic missionary, no new deps)
Returns
MediaType(SSD/HDD/Unspecified) andBusType(NVMe/SATA/SAS/ ...). Resolve a path's drive letter viaGet-Partition/Get-Disk. Parse the JSON, classify, done. Matches whatdrive.rsalready does for macOS — shells out todiskutil. Consistent, lazy in the best way.Position B: Native
DeviceIoControl(the hard way, no protection)DeviceIoControl(IOCTL_STORAGE_QUERY_PROPERTY, ...)with:StorageDeviceSeekPenaltyProperty→ theIncursSeekPenaltybit tells you HDD vs SSDStorageAdapterProperty→BusTypedistinguishes NVMe from SATAPulls in the
windows-syscrate but means no PowerShell process at runtime. Faster, more "real Rust", more code.Either's fine. The project already shells out to
diskutil/nvme/hdparmon other platforms, so Option A is the consistent first pass and probably what should land.Acceptance Criteria (How You Know You Finished)
\\.\PhysicalDrive0and friends) refuses with the same tone as Linux/NVMe — explain FTL + PE wear, point user at the right native tool. Windows doesn't have a single canonical cryptographic-erase command; mentioning vendor tools (Samsung Magician, Intel SSD Toolbox, etc.) and ATA Secure Erase is the right move.cipher /w:C:\is NOT the answer (it's another overwrite, equally useless on flash).warn_file_on_flashindrive.rs).MediaType: HDD,BusType: SATA,IncursSeekPenalty: true) proceeds without ceremony..github/workflows/ci.ymlstays green — fmt + clippy + build + test.#[cfg_attr(not(any(target_os = "linux", target_os = "macos")), allow(dead_code))]line onDriveKindindrive.rsgets removed, because every variant is now actually constructed on Windows.Out of Scope (Save It for a Separate Fuck)
--secure-erasedelegation on Windows. Windows doesn't have a single canonical tool — the right answer depends on the drive vendor (Samsung Magician, Intel SSD Toolbox, Kingston SSD Manager, ...). Separate issue.sedutil-clion Windows. Same reason.C:\Windows\System32yet because the path-safety prefix list is Unix-style). Also a separate issue if anyone's brave enough.Reference Material
src/drive.rs:127-181src/drive.rs:54-181src/drive.rs:19,src/drive.rs:152,src/drive.rs:225src/drive.rs:21Want to take a swing? Grab the issue, plow ahead, send the PR. I'll review it like a horny code-review bottom.
8====D~~~