dwipe 2.0.2__tar.gz → 3.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {dwipe-2.0.2 → dwipe-3.0.1}/PKG-INFO +218 -99
  2. {dwipe-2.0.2 → dwipe-3.0.1}/README.md +216 -97
  3. dwipe-3.0.1/dwipe/DeviceChangeMonitor.py +244 -0
  4. dwipe-3.0.1/dwipe/DeviceInfo.py +1123 -0
  5. dwipe-3.0.1/dwipe/DeviceWorker.py +572 -0
  6. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/DiskWipe.py +569 -136
  7. dwipe-3.0.1/dwipe/DrivePreChecker.py +203 -0
  8. dwipe-3.0.1/dwipe/FirmwareWipeTask.py +865 -0
  9. dwipe-3.0.1/dwipe/NvmeTool.py +225 -0
  10. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/PersistentState.py +20 -9
  11. dwipe-3.0.1/dwipe/SataTool.py +499 -0
  12. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/StructuredLogger.py +4 -3
  13. dwipe-3.0.1/dwipe/Tunables.py +62 -0
  14. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/Utils.py +192 -5
  15. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/VerifyTask.py +4 -2
  16. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/WipeJob.py +25 -13
  17. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/WipeTask.py +4 -2
  18. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/WriteTask.py +1 -1
  19. dwipe-3.0.1/dwipe/main.py +83 -0
  20. {dwipe-2.0.2 → dwipe-3.0.1}/pyproject.toml +2 -2
  21. dwipe-3.0.1/runner +19 -0
  22. dwipe-2.0.2/dwipe/DeviceInfo.py +0 -724
  23. dwipe-2.0.2/dwipe/DrivePreChecker.py +0 -90
  24. dwipe-2.0.2/dwipe/FirmwareWipeTask.py +0 -370
  25. dwipe-2.0.2/dwipe/LsblkMonitor.py +0 -124
  26. dwipe-2.0.2/dwipe/ToolManager.py +0 -618
  27. dwipe-2.0.2/dwipe/main.py +0 -63
  28. dwipe-2.0.2/runner +0 -19
  29. {dwipe-2.0.2 → dwipe-3.0.1}/.gitignore +0 -0
  30. {dwipe-2.0.2 → dwipe-3.0.1}/LICENSE +0 -0
  31. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/Prereqs.py +0 -0
  32. {dwipe-2.0.2 → dwipe-3.0.1}/dwipe/__init__.py +0 -0
  33. {dwipe-2.0.2 → dwipe-3.0.1}/images/dwipe-2025-12-31-09-37.gif +0 -0
  34. {dwipe-2.0.2 → dwipe-3.0.1}/linter +0 -0
  35. {dwipe-2.0.2 → dwipe-3.0.1}/resources/dwipe-help-screen.png +0 -0
  36. {dwipe-2.0.2 → dwipe-3.0.1}/resources/dwipe-main-screen.png +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dwipe
3
- Version: 2.0.2
3
+ Version: 3.0.1
4
4
  Summary: A tool to wipe disks and partitions for Linux
5
5
  Keywords: disk,partition,wipe,clean,scrub
6
6
  Author-email: Joe Defen <joedef@google.com>
7
- Requires-Python: >=3.8
7
+ Requires-Python: >=3.10
8
8
  Description-Content-Type: text/markdown
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
@@ -22,83 +22,48 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
22
22
 
23
23
  | Feature | dwipe | nwipe | shred | dd |
24
24
  |---------|-------|-------|-------|-----|
25
+ | Firmware wipes (SATA/NVMe secure erase) | ✓ | ✗ | ✗ | ✗ |
26
+ | Software wipes (Zero, Pseudo Random) | ✓ | ✓ | ✓ | ✗ |
25
27
  | Interactive TUI | ✓ | ✓ | ✗ | ✗ |
26
28
  | Multiple simultaneous wipes | ✓ | ✗ | ✗ | ✗ |
27
- | Hot-swap detection | ✓ | ✗ | ✗ | ✗ |
28
- | Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
29
29
  | Persistent wipe state | ✓ | ✗ | ✗ | ✗ |
30
- | Resume interrupted wipes | ✓ | ✗ | ✗ | ✗ |
30
+ | Hot-swap detection / release | ✓ | ✗ | ✗ | ✗ |
31
+ | Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
32
+ | Resume interrupted software wipes | ✓ | ✗ | ✗ | ✗ |
31
33
  | Wipe operation logging | ✓ | ✗ | ✗ | ✗ |
32
34
  | Mount detection/prevention | ✓ | ✓ | ✗ | ✗ |
33
35
  | Fast Statistical sampling verification | ✓ | ✗ | ✗ | ✗ |
34
- | Multi-pass wipe standards | ✗ | ✓ | | ✗ |
35
- | Full sequential verification | ✗ | ✓ | ✓ | ✓ |
36
- | Certificate generation | | | | |
37
-
38
- > * **Modern drives are reliably wiped with one pass of zeros**; just zero once in almost all cases for best, fastest results.
39
- > * `dwipe` offers Multi-pass and Rand modes as "checkbox" features, but those provide no additional security on drives manufactured after 2001 (NIST SP 800-88).
40
-
41
- ## **V3 Features** (Partly in V2.x)
42
-
43
- > Features added since initial V2 deployment (may not be in a demo until V3).
44
-
45
- * **Port and Serial number**. Press `p` to control port and serial number; it adds another line per disk and you may want to use it selectively. You may choose "Off" (not shown), "On" (always shown), or the default "Auto" show if the disk is in a state allowed for wiping (e.g., no mounted partitions).
46
- * **Fast SATA Release**. If you press `DEL` on a SATA drive in a hot-swap bay (and not mounted or otherwise busy):
47
- * it will be removed from the OS managed devices,
48
- * when gone from the `dwipe` screen, you can then pull out the device, and insert another one.
49
- * So, replacing the drive can take just seconds, not minutes awaiting SATA timeouts.
50
- * **Background device monitoring** - Faster and more efficient hot-swap detection with dedicated monitoring thread:
51
- - Monitors `/sys/class/block` and `/proc/partitions` for device changes
52
- - Runs `lsblk` only when changes detected (previously ran every refresh)
53
- - Reduces CPU usage and improves responsiveness
54
- - Faster detection of newly inserted or removed devices
55
- * **Lock renamed Block** - To reduce confusion, the "lock" feature is renamed.
56
- - "Blocking" a partition or disk is only effective within the running app.
57
- - It prevents wiping w/o first unblocking even if unmounted or otherwise it a wipeable state.
58
- - It does not system level lock of any type.
59
- * **Hardware-based firmware wipes (EXPERIMENTAL/ALPHA)** - Full support for firmware-level secure erase operations:
60
- - **⚠️ Requires `--firmware-wipes` flag to enable (disabled by default)**
61
- - **NVMe Sanitize**: Crypto Erase, Block Erase, and Overwrite operations via `nvme-cli`
62
- - **NVMe Format**: Secure format with optional crypto erase
63
- - **SATA ATA Security Erase**: Normal and Enhanced erase modes via `hdparm`
64
- - Automatic capability detection shows only supported methods for each drive
65
- - Firmware wipes are much faster than software wipes (seconds to minutes vs hours)
66
- - Same user interface - firmware options appear alongside Zero/Rand in wipe confirmation
67
- - Progress tracking with "FW" indicator to show hardware operation in progress
68
- - Persistent markers track firmware wipe completion and method used
69
- - See [FIRMWARE_WIPES.md](FIRMWARE_WIPES.md) for technical details
70
- - **Note**: This feature is experimental; software wipes are recommended for most users
71
-
72
- ## **V2 Features**
73
-
74
- * **Statistical verification** - Automatic or on-demand verification with intelligent pattern detection:
75
- - Fast-fail for zeros (fails on first non-zero byte)
76
- - Statistical analysis for random data to check for evidence of randomness
77
- - Smart sampling: divides disk into 100 sections, randomly samples each section to sample entire disk
78
- - Unmarked disk detection: can verify disks without filesystems and auto-detect if zeros/random
79
- * **Configurable verification percentage** - Choose thoroughness: 0% (skip), 2%, 5%, 10%, 25%, 50%, or 100% (cycle with **V** key, persistent preference)
80
- * **Multi-pass wipe support** - Choose 1, 2, or 4 wipe passes with alternating patterns for improved data destruction (cycle with **P** key, persistent preference)
81
- * **Inline wipe confirmation** - Confirmation prompts appear below the selected device (no popup), keeping full context visible
82
- * **Configurable confirmation modes** - Choose your safety level: single keypress (Y/y), typed confirmation (YES/yes), or device name (cycle with **c** key)
83
- * **Enhanced wipe history** - Detailed log viewer (**h** key) shows wipe history with UUIDs, filesystems, labels, and percentages for stopped wipes
84
- * **Active wipe highlighting** - In-progress wipes displayed in bright cyan/blue with elapsed time, remaining time, and transfer speed (0-100% write, 101-200% verify)
85
- * **Persistent user preferences** - Theme, wipe mode (Rand/Zero/Rand+V/Zero+V), confirmation mode, verification %, and blocked devices persist across sessions (saved to `~/.config/dwipe/state.json`)
86
- * **Individual partition blocking** - Block individual partitions to prevent accidental wiping (previously only whole disks could be blocked)
87
- * **Full terminal color themes** - Complete themed color schemes with backgrounds, not just highlights (cycle with **t** key)
88
- * **Visual feedback improvements** - Mounted and blocked devices appear dimmed; active wipes are bright and prominent
36
+ | Certified destruction (DoD/Gutmann standards, full verification, certificates) | ✗ | ✓ | | ✗ |
37
+
38
+ > * **Firmware wipes (SATA/NVMe) are the most complete and fastest**: Hardware-accelerated erase operates at controller level (seconds to minutes), clears all drive mappings, but requires whole-device erase with no progress reporting or visible verification.
39
+ > * **Software wipes with one-pass zeros are sufficient**: Modern drives (post-2001) are reliably wiped with a single pass of zeros (NIST SP 800-88). Multi-pass modes are available for additional confidence but provide no additional security guarantee.
40
+ > * **Verification uses intelligent statistical sampling**: Even 1% verification samples across the entire disk via 100 sections, providing comprehensive coverage without full sequential read.
41
+
42
+ ## Marquee Features
43
+
44
+ * **Interactive TUI with hot-swap detection** - Real-time device list updates as storage changes, newly added devices marked with **^**
45
+ * **Hardware-accelerated firmware wipes** - Full support for firmware-level secure erase operations (NVMe Sanitize/Format, SATA ATA Security Erase) that complete in seconds to minutes instead of hours
46
+ * **Multiple simultaneous wipes** - Start wipes on multiple devices at once with individual progress tracking and completion states
47
+ * **Persistent state tracking** - Wipe status survives reboots; partially wiped and completed states persist on the device (can resume wipes across power cycles)
89
48
  * **Smart device identification** - Uses UUID/PARTUUID/serial numbers for stable device tracking across reconnections
90
- * **Screen-based navigation** - Modern screen stack architecture with help screen (**?**) and history screen (**h**)
91
- * **Direct I/O to Disk** - Wiping is done with direct I/O which is fast and avoid polluting your page cache. Writer threads are given lower than normal I/O priority to play nice with other apps. This makes stopping jobs fast and certain.
92
- * **Improved Handling of Bad Disks.** Now detects (sometimes corrects) write failures, slowdowns, excessive no progress, and reports/aborts hopeless or hopelessly slow wipes.
49
+ * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports device blocking, inline confirmation prompts
50
+ * **Intelligent verification with statistical sampling** - Fast verification that covers entire disk even at low percentages (1% verification samples from all 100 disk sections)
51
+ * **Direct I/O to disk** - Fast and efficient wiping that avoids page cache pollution with automatic slowdown/stall detection and graceful abort
52
+ * **Multiple color themes** - Terminal color themes designed for readability with context-sensitive visual feedback (mounted devices dimmed, active wipes bright)
53
+ * **Wipe history with logging** - Detailed wipe history viewer shows timestamps, filesystems, labels, and completion percentages with persistent records
93
54
 
94
55
  ## Requirements
95
56
  - **Linux operating system** (uses `/dev/`, `/sys/`, `/proc/` interfaces)
96
- - **Python 3.8 or higher**
57
+ - **Python 3.10 or higher**
97
58
  - **Root/sudo privileges** (automatically requested when you run the tool)
98
59
  - **lsblk utility** (usually pre-installed on most Linux distributions)
99
- - **Optional (for firmware wipes only):**
100
- - `nvme-cli` - For NVMe Sanitize and Format operations
101
- - `hdparm` - For SATA ATA Security Erase operations
60
+ - **nvme-cli** - For NVMe operations (Sanitize/Format detection)
61
+ - **hdparm** - For SATA operations (ATA Security Erase detection)
62
+
63
+ **Optional (for clipboard copy in history screen):**
64
+ - **xclip** or **xsel** - For X11 clipboard (`apt install xclip` or `xsel`)
65
+ - **wl-clipboard** - For Wayland clipboard (`apt install wl-clipboard`)
66
+ - SSH sessions use OSC 52 terminal escape (no extra packages needed)
102
67
 
103
68
  ## Installation
104
69
 
@@ -106,12 +71,20 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
106
71
  * **Verify installation:** `dwipe --help`
107
72
  * **Uninstall:** `pipx uninstall dwipe`
108
73
 
109
- ## Quick Start
74
+ ## Quick Start (please READ THIS, at least)
110
75
  1. Install `dwipe`
111
- 2. Run `dwipe` from a terminal (`sudo` will be requested automatically)
112
- 3. Observe the context-sensitive help on the first line
113
- 4. Navigate with arrow keys or vi-like keys (j/k)
114
- 5. Press **?** for full help screen
76
+ 1. Run `dwipe` from a terminal (`sudo` will be requested automatically)
77
+ 1. Observe the context-sensitive help on the first line
78
+ 1. Navigate with arrow keys or vi-like keys (j/k)
79
+ 1. Press **?** for full help screen
80
+ 1. **When you press `w` to wipe a drive,** you must type the abbreviation (e.g., `Rand`, `Zero`, `Crypto`); wipes are presented from least to most recommended, and the last one is marked with `*`. Normally, pick the last choice, but ...
81
+ 1. **Drives and the OS often lie about drive type.** Outwit them both:
82
+ * For spinning HDDs, **always** use `Rand` or `Zero` (interruptible, shows progress).
83
+ * For SSDs, **always** use firmware wipes if available (faster, reaches hidden blocks).
84
+ 1. **If a drive is 'Frozen'**, suspend your system briefly and resume; `dwipe` auto-detects the resume and rescans. Or press `r` to rescan manually. The drive should come back unfrozen.
85
+ 1. **If a drive is 'Locked'**, you must unlock it manually (see "Unlock Locked Device" section below). If `dwipe` locked it, the password is `NULL`; otherwise use the password that locked it.
86
+ 1. **Hot-swap workflow for SATA drives**: `DEL` to detach, physically swap drives, then `r` to rescan (if needed).
87
+
115
88
 
116
89
  ## Features
117
90
 
@@ -121,11 +94,10 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
121
94
  * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk blocking
122
95
  * **Hot-swap detection** - Updates the device list when storage changes; newly added devices are marked with **^** to make them easy to spot
123
96
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once, with individual progress tracking and completion states
124
- * **Flexible wipe modes** - Choose between Rand, Zero, Rand+V (with auto-verify), or Zero+V (with auto-verify). Multi-pass modes alternate patterns for improved data destruction
125
- * **Persistent state tracking** - Wipe status survives reboots; partially wiped (**s**) and completed (**W**) states are stored on the device
97
+ * **Flexible wipe modes** - Choose between Rand, Zero, Rand+V (with auto-verify), or Zero+V (with auto-verify)
126
98
  * **Device filtering** - Filter devices by name/pattern using regex in case of too many for one screen
127
99
  * **Stop capability** - Stop individual wipes or all wipes in progress
128
- * **Disk blocking** - Manually block disks to prevent accidental wipes (blocks hide all partitions)
100
+ * **Disk blocking** - Manually block disks to prevent accidental wiping (blocks hide all partitions)
129
101
 
130
102
 
131
103
  > **Note:** `dwipe` shows file system labels, and if not available, the partition label. It is best practice to label partitions and file systems well to make selection easier.
@@ -136,11 +108,39 @@ Simply run `dwipe` from the command line without arguments: `dwipe`
136
108
 
137
109
  ### Command-Line Options
138
110
 
139
- - `--firmware-wipes` or `-F` - Enable experimental (alpha) firmware wipes
111
+ **Note:** All preference options use your **last saved values** as defaults. These defaults are shown in `--help` and can be changed interactively with keyboard shortcuts. Command-line arguments override saved preferences.
112
+
113
+ #### Wipe Configuration
114
+ - `--mode {-V,+V}` - Verification mode (default: your last preference)
115
+ - `-V` - Wipe without automatic verification
116
+ - `+V` - Verify device after wipe completes
117
+ - `--passes {1,2,4}` - Number of passes for software wipes (default: your last preference)
118
+ - Single pass (1) is standard for most use cases
119
+ - Multi-pass (2 or 4) alternates between zero and random patterns
120
+ - `--verify-pct {1,3,10,30,100}` - Verification percentage (default: your last preference)
121
+ - Percentage of disk to verify after wipe (1% = quick spot-check, 100% = full verify)
122
+
123
+ #### Display and Performance
124
+ - `--dense {True,False}` - Compact view mode (default: your last preference)
125
+ - `True` - Compact spacing (fewer blank lines between disks)
126
+ - `False` - Spaced view (blank lines between disks for readability)
127
+ - `--port-serial {Auto,On,Off}` - Disk port/serial display (default: your last preference)
128
+ - `Auto` - Show port/serial only for whole disks (recommended)
129
+ - `On` - Always show port and serial number
130
+ - `Off` - Never show port and serial number
131
+
132
+ #### Drive Handling Tuning
133
+ - `--slowdown-stop {0,4,16,64,256}` - Stop if disk slows down (default: your last preference, milliseconds)
134
+ - `0` = Disabled
135
+ - Other values = Check interval in milliseconds for performance degradation
136
+ - `--stall-timeout {0,60,120,300,600}` - Stall timeout in seconds (default: your last preference)
137
+ - `0` = Disabled (never timeout)
138
+ - Other values = Stop wipe if no data transfer progress for this many seconds
139
+
140
+ #### Advanced Options
141
+ - `--firmware-wipes` or `-F` - Enable firmware wipes
140
142
  - Enables hardware-based secure erase operations (NVMe Sanitize/Format, SATA ATA Security Erase)
141
- - Requires `nvme-cli` and `hdparm` tools to be installed
142
143
  - Without this flag, only software wipes (Zero/Rand) are available
143
- - **Warning**: This feature is experimental and should be used with caution
144
144
  - `--dump-lsblk` - Dump parsed device information and exit (for debugging)
145
145
  - `--help` - Show help message with all available options
146
146
 
@@ -209,32 +209,93 @@ The top line shows available actions. Some are context-sensitive (only available
209
209
  | **v** | verify | Verify a wiped device or detect pattern on unmarked disk (context-sensitive) |
210
210
  | **s** | stop | Stop the selected wipe in progress (context-sensitive) |
211
211
  | **S** | Stop All | Stop all wipes in progress |
212
+ | **DEL** | delete | Remove disk from system (whole disks only, context-sensitive) |
212
213
  | **b** | block/unblock | Block or unblock a disk to prevent accidental wiping |
214
+ | **/** | filter | Filter devices by regex pattern (shows matching devices + all active wipes) |
215
+ | **r** | rescan | Rescan all devices and reset hardware capabilities detection |
216
+ | **h** | history | Show wipe history log |
217
+ | **t** | themes | Open theme preview screen to view and change color themes |
213
218
  | **q** or **x** | quit | Quit the application (stops all wipes first) |
214
219
  | **?** | help | Show help screen with all actions and navigation keys |
215
- | **h** | history | Show wipe history log |
216
- | **/** | filter | Filter devices by regex pattern (shows matching devices + all active wipes) |
217
220
  | **ESC** | clear filter | Clear the filter and jump to top of list |
218
221
  | **ESC** | back | Return to previous screen if on nested screen |
219
- | **m** | mode | Cycle auto verify mode: +V (verify), -V (don't) [saved as preference] |
220
- | **P** | passes | Cycle wipe passes: 1, 2, or 4 (saved as preference) |
221
- | **V** | verify % | Cycle verification percentage: 0%, 2%, 5%, 10%, 25%, 50%, 100% (saved as preference) |
222
- | **D** | dense | Toggle dense/spaced view (saved as preference) |
223
- | **t** | themes | Open theme preview screen to view and change color themes |
222
+ | **a** | time format | Cycle wipe history time display format (ago+time, ago, time) |
223
+
224
+ ### History Screen
225
+
226
+ Press **h** to view the wipe history log. The history screen shows all wipe and verify operations with timestamps, device info, and results.
227
+
228
+ **History screen actions:**
229
+ - **e** - Expand/collapse entry to show full JSON details
230
+ - **c** - Copy current entry to clipboard (see below)
231
+ - **/** - Search/filter entries (prefix with `/` for deep JSON search)
232
+ - **a** - Cycle time format (ago+time, ago, time)
233
+ - **ESC** - Return to main screen
234
+
235
+ **Clipboard copy methods** (detected automatically):
236
+ | Environment | Method | Notes |
237
+ |-------------|--------|-------|
238
+ | SSH session | OSC 52 | Terminal escape sequence; requires terminal support (iTerm2, kitty, alacritty, Windows Terminal, tmux with `set-clipboard on`) |
239
+ | Wayland | wl-copy | Requires `wl-clipboard` package |
240
+ | X11 | xclip/xsel | Requires `xclip` or `xsel` package |
241
+ | Fallback | Terminal | Exits to shell, prints entry for manual copy |
242
+
243
+ > **Note:** If OSC 52 doesn't work with your terminal, the text still appears on screen for manual selection. For tmux, enable clipboard with `set -g set-clipboard on` in your `.tmux.conf`.
224
244
 
225
245
  ### Wipe Types
226
246
 
227
- `dwipe` supports several wipe modes.
247
+ `dwipe` supports firmware wipes (hardware-accelerated) and software wipes. Firmware wipes require the `--firmware-wipes` or `-F` flag. Tables below list wipe methods from most desirable (Rank 1) to least.
248
+
249
+ #### NVMe Drives
250
+
251
+ | Rank | Abbrev | Official Name | Remarks |
252
+ |------|--------|---------------|---------|
253
+ | 1 | Crypto | Sanitize Cryptographic Erase | Fastest; erases encryption keys; instant data invalidation |
254
+ | 2 | Block | Sanitize Block Erase | Fast; resets all blocks to deallocated state |
255
+ | 3 | FCrypto | Format with Crypto Erase | Fast; reformats namespace with key erasure |
256
+ | 4 | FErase | Format with User Data Erase | Fast; reformats with simple data erase; less thorough than crypto |
257
+ | 5 | Ovwr | Sanitize Overwrite | Minutes; writes pattern to all blocks; most thorough but rarely needed |
258
+ | 6 | Rand | Software Random Write | Fallback; writes random data via software; hours for large drives |
259
+ | 7 | Zero | Software Zero Write | Fallback; writes zeros via software; verifiable but slower |
260
+
261
+ #### SATA SSDs (with crypto/sanitize features)
228
262
 
229
- - **Zero** - Fills the device with zeros (multi-pass alternates random/zero patterns, ending on zeros)
230
- - **Rand** - Fills the device with random data (multi-pass alternates zero/random patterns, ending on random)
231
- - **Firmware wipes** - TBD
263
+ | Rank | Abbrev | Official Name | Remarks |
264
+ |------|--------|---------------|---------|
265
+ | 1 | SCrypto | Sanitize Cryptographic Erase | Fastest; erases encryption keys; requires SANITIZE feature |
266
+ | 2 | Enhanced | ATA Security Erase Enhanced | Fast; vendor-specific deep erase with crypto key destruction |
267
+ | 3 | SBlock | Sanitize Block Erase | Fast; resets blocks to factory state; requires SANITIZE feature |
268
+ | 4 | Erase | ATA Security Erase Normal | Minutes; writes zeros to all sectors; widely supported |
269
+ | 5 | SOverwrite | Sanitize Overwrite | Minutes; overwrites with pattern; requires SANITIZE feature |
270
+ | 6 | Rand | Software Random Write | Fallback; can't reach wear-leveled or remapped blocks |
271
+ | 7 | Zero | Software Zero Write | Fallback; can't reach wear-leveled or remapped blocks |
232
272
 
233
- The `+V` suffix indicates automatic verification after wipe completion. Without `+V`, you can still manually verify by pressing **v** on a wiped device.
273
+ #### SATA HDDs (spinning drives)
234
274
 
235
- > **Note:** Multi-pass sofware (Zero and Rand) wipes (2 or 4 passes) alternate between zero and random patterns to ensure different bit patterns physically overwrite the disk, ending on your selected mode.
275
+ | Rank | Abbrev | Official Name | Remarks |
276
+ |------|--------|---------------|---------|
277
+ | 1 | Rand | Software Random Write | Preferred; interruptible, resumable, shows progress |
278
+ | 2 | Zero | Software Zero Write | Preferred; interruptible, resumable, fast verification |
279
+ | 3 | Enhanced | ATA Security Erase Enhanced | Slow (hours); not interruptible; no progress; same result as software |
280
+ | 4 | Erase | ATA Security Erase Normal | Slow (hours); not interruptible; no progress; same result as software |
236
281
 
237
- ### Resuming Stopped Wipes
282
+ > **Note:** HDDs don't have wear leveling or hidden blocks, so software wipes are equally thorough as firmware wipes but offer better control (progress, pause/resume, interruptibility).
283
+
284
+ #### Partitions and USB/Thumb Drives
285
+
286
+ | Rank | Abbrev | Official Name | Remarks |
287
+ |------|--------|---------------|---------|
288
+ | 1 | Rand | Software Random Write | Preferred; unpredictable pattern; statistical verification |
289
+ | 2 | Zero | Software Zero Write | Simpler; fast verification (fails on first non-zero byte) |
290
+
291
+ > **Notes:**
292
+ > - Firmware wipes show only methods supported by each drive (see FwCAPS column).
293
+ > - Firmware wipes include automatic spotcheck verification.
294
+ > - The `+V` suffix enables automatic verification after software wipes. Without `+V`, press **v** to verify manually.
295
+ > - Multi-pass software wipes (2 or 4) alternate zero/random patterns, ending on your selected mode.
296
+ > - USB drives and partitions lack firmware erase—only software wipes available.
297
+
298
+ ### Resuming Stopped SOFTWARE Wipes
238
299
 
239
300
  Stopped wipes (state **s**) can be resumed by pressing **w** on the device. Choose the same type of wipe or it will start over at 0% complete.
240
301
 
@@ -258,15 +319,15 @@ Stopped wipes (state **s**) can be resumed by pressing **w** on the device. Choo
258
319
  - Progress marker updated every 30 seconds, so resume works even after crashes or power loss
259
320
  - Automatic validation prevents corrupted final patterns
260
321
 
261
- ### Verification Strategy
322
+ ### Software Wipe Verification Strategy
262
323
 
263
- `dwipe` uses intelligent verification with statistical analysis and fast-fail optimizations:
324
+ Software wipes use intelligent verification with statistical analysis and fast-fail optimizations. Verification is **configurable and optional**.
264
325
 
265
326
  **Smart Sampling:**
266
327
  - Divides disk into 100 equal sections
267
- - Randomly samples configurable percentage (0%, 2%, 5%, 10%, 25%, 50%, 100%) from EACH section
268
- - Ensures complete disk coverage even with 2% verification
269
- - Change verification percentage with **V** key (saved as preference)
328
+ - Randomly samples configurable percentage (1%, 3%, 10%, 30%, 100%) from EACH section
329
+ - Ensures complete disk coverage even with 1% verification
330
+ - Set verification percentage with `--verify-pct` command-line option (saved as preference)
270
331
 
271
332
  **Pattern Detection:**
272
333
  - **Zero verification**: Fails immediately on first non-zero byte (fast!)
@@ -289,11 +350,30 @@ Stopped wipes (state **s**) can be resumed by pressing **w** on the device. Choo
289
350
  - During verify: **vN%** shows progress (v0% to v100%)
290
351
 
291
352
  **Why statistical sampling is better than sequential:**
292
- - 2% verification with 100 sections provides better coverage than 2% sequential read
353
+ - Statistical sampling with 100 sections provides better coverage than sequential read at same percentage
293
354
  - Detects problems faster (could hit bad sector in early sections)
294
355
  - Statistical analysis actually validates randomness (sequential can't do this)
295
356
  - Much faster than 100% sequential verification
296
357
 
358
+ ### Firmware Wipe Verification Strategy
359
+
360
+ Firmware wipes (SATA/NVMe secure erase) use an **unconditional spotcheck verification** that is **performed automatically for all firmware wipes**. This verifies that the hardware erase command actually executed.
361
+
362
+ **Spotcheck Approach:**
363
+ - Before the wipe: Write test data blocks at three strategic locations (front, middle, tail of drive)
364
+ - Execute the firmware erase command at the controller level
365
+ - After the wipe: Read those three test locations and verify they no longer contain the original data
366
+ - If any test block still contains similar data, the erase has failed and is reported
367
+
368
+ **Why Spotchecks Are Effective:**
369
+ - Proves the drive's internal erase actually processed (not just a command acknowledgment)
370
+ - Three-location strategy (0%, 50%, 100% of drive) ensures coverage across the entire device
371
+ - Catches firmware bugs or hardware failures that might claim success but do nothing
372
+ - Much faster than sequential verification (only 3 blocks read instead of percentage of whole drive)
373
+ - **Mandatory and unconditional**: No user configuration or additional verification step needed
374
+
375
+ **Important Note:** Firmware wipes do not show percentage-based verification like software wipes. The spotcheck happens silently as part of the wipe operation, and success/failure is recorded in the persistent wipe state marker.
376
+
297
377
  ### Progress Information
298
378
 
299
379
  When software wiping a device, `dwipe` displays:
@@ -315,7 +395,7 @@ When a device with persistent state is displayed, additional information shows:
315
395
 
316
396
 
317
397
  ### The Help Screen
318
- When **?** is typed, you can see the available keys and some obscure settings no seen elsewhere.
398
+ When **?** is typed, you can see the available keys and command-line options with their current settings.
319
399
 
320
400
  ### Navigation
321
401
 
@@ -391,6 +471,24 @@ Press **ESC** from the main screen to clear the filter and return to showing all
391
471
  - **Wipe is very slow** - Normal for large drives; check write rate to verify progress
392
472
  - **Wipe seems stuck** - Most likely due to bad disks; Direct I/O makes progress almost constant on good disks.
393
473
 
474
+ ---
475
+ ### Firmware Wipe Considerations
476
+
477
+ Firmware wipes (SATA/NVMe secure erase operations) have different characteristics than software wipes:
478
+
479
+ **Frozen Drives:**
480
+ - SATA drives are typically frozen by the BIOS/UEFI during POST as a security measure
481
+ - This is a drive-level security feature, not a `dwipe` limitation
482
+ - **Solution**: Suspend your system briefly and resume; `dwipe` auto-detects the resume and rescans (or press **r** manually). The suspend/resume power-cycles the SATA link which clears the freeze.
483
+ - If the drive remains frozen after suspend/resume, try a full power-off (10+ minutes to drain drive capacitors) followed by boot and rescan
484
+
485
+ **Device Quirks and Compatibility:**
486
+ - Storage devices have various firmware implementations and hardware quirks that affect secure erase operations
487
+ - Some drives may not fully support certain sanitize operations, have timing issues, or exhibit unexpected behavior
488
+ - `dwipe` cannot guarantee that all devices will be successfully wiped—some hardware simply may not cooperate with erase commands
489
+ - Always verify a drive after wiping (use **v** key) to confirm the erase actually completed
490
+ - For mission-critical data destruction on quirky hardware, consider using manufacturer-specific secure erase tools as a fallback
491
+
394
492
  ---
395
493
  ### Dealing with Bad or Failing Disks
396
494
 
@@ -435,7 +533,28 @@ dwipe includes built-in protections for problematic storage devices:
435
533
  * Consider replacing the disk if errors persist
436
534
 
437
535
  Note: Some disks are fundamentally broken and cannot be reliably wiped. dwipe will protect itself and your system, but cannot fix hardware failures.
536
+ ---
537
+ #### Recommendations for SATA Wiping over USB
538
+ * Requirement 1: SAT (SCSI-ATA Translation) Support
438
539
 
540
+ * The USB bridge must be capable of "passing through" ATA commands.
541
+ * The Test: If the app can see the "Security" section in the drive details, the bridge supports SAT.
542
+
543
+ * Requirement 2: Stable Power
544
+ * Firmware wipes (especially on 3.5" HDDs) draw significant peak power.
545
+ * The Risk: If a USB-powered "bus-only" cable is used, the voltage might sag during the wipe, causing the bridge to reset and "brick" the drive in a locked state.
546
+ * The Recommendation: Always use an externally powered USB dock for 3.5" drives.
547
+
548
+ * Requirement 3: Command Timeout Integrity
549
+ * The bridge must not have an aggressive "Watchdog Timer."
550
+ * The Risk: Some bridges disconnect if they don't see "data" for 60 seconds. During a firmware wipe, the drive is busy internally and doesn't send data.
551
+ * The Recommendation: Use high-quality chipsets like ASMedia (1153E) or JMicron (JMS578).
552
+
553
+ ##### Unlock Locked Device
554
+ ```
555
+ sudo hdparm --user-master u --security-unlock NULL /dev/sdX
556
+ sudo hdparm --user-master u --security-disable NULL /dev/sdX
557
+ ```
439
558
  ---
440
559
 
441
560
  ### Contributing