dwipe 2.0.0__tar.gz → 2.0.2__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 (40) hide show
  1. {dwipe-2.0.0 → dwipe-2.0.2}/.gitignore +3 -1
  2. {dwipe-2.0.0 → dwipe-2.0.2}/PKG-INFO +69 -30
  3. {dwipe-2.0.0 → dwipe-2.0.2}/README.md +67 -28
  4. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/DeviceInfo.py +291 -59
  5. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/DiskWipe.py +497 -172
  6. dwipe-2.0.2/dwipe/DrivePreChecker.py +90 -0
  7. dwipe-2.0.2/dwipe/FirmwareWipeTask.py +370 -0
  8. dwipe-2.0.2/dwipe/LsblkMonitor.py +124 -0
  9. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/PersistentState.py +28 -18
  10. dwipe-2.0.2/dwipe/Prereqs.py +84 -0
  11. dwipe-2.0.2/dwipe/StructuredLogger.py +643 -0
  12. dwipe-2.0.2/dwipe/ToolManager.py +618 -0
  13. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/Utils.py +108 -0
  14. dwipe-2.0.2/dwipe/VerifyTask.py +410 -0
  15. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/WipeJob.py +613 -165
  16. dwipe-2.0.2/dwipe/WipeTask.py +148 -0
  17. dwipe-2.0.2/dwipe/WriteTask.py +402 -0
  18. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/main.py +14 -9
  19. dwipe-2.0.2/linter +6 -0
  20. {dwipe-2.0.0 → dwipe-2.0.2}/pyproject.toml +2 -2
  21. dwipe-2.0.0/demo/DiskWiperThrottled.py +0 -398
  22. dwipe-2.0.0/demo/IMPLEMENTATION_SUMMARY.md +0 -227
  23. dwipe-2.0.0/demo/QUICKSTART_THROTTLE.md +0 -102
  24. dwipe-2.0.0/demo/THROTTLING.md +0 -172
  25. dwipe-2.0.0/demo/o_direct_example.py +0 -233
  26. dwipe-2.0.0/demo/test_buffered_sync_speed.py +0 -150
  27. dwipe-2.0.0/demo/test_direct_proper.py +0 -152
  28. dwipe-2.0.0/demo/test_direct_speed.py +0 -159
  29. dwipe-2.0.0/demo/test_osync_speed.py +0 -131
  30. dwipe-2.0.0/demo/test_smart_throttle.py +0 -105
  31. dwipe-2.0.0/demo/test_throttle.py +0 -82
  32. dwipe-2.0.0/demo/test_wipejob_debug.py +0 -79
  33. dwipe-2.0.0/demo/test_wipejob_odirect.py +0 -151
  34. dwipe-2.0.0/dwipe/WipeJobFuture.py +0 -245
  35. {dwipe-2.0.0 → dwipe-2.0.2}/LICENSE +0 -0
  36. {dwipe-2.0.0 → dwipe-2.0.2}/dwipe/__init__.py +0 -0
  37. {dwipe-2.0.0 → dwipe-2.0.2}/images/dwipe-2025-12-31-09-37.gif +0 -0
  38. {dwipe-2.0.0 → dwipe-2.0.2}/resources/dwipe-help-screen.png +0 -0
  39. {dwipe-2.0.0 → dwipe-2.0.2}/resources/dwipe-main-screen.png +0 -0
  40. {dwipe-2.0.0 → dwipe-2.0.2}/runner +0 -0
@@ -1,7 +1,9 @@
1
1
  .vscode/
2
+ .claude/
2
3
  */__pycache/
3
4
  .venv/
4
5
  venv.zd/
5
6
  *.pyc
6
7
  *egg-info*
7
- dist/
8
+ dist/
9
+ .github/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dwipe
3
- Version: 2.0.0
3
+ Version: 2.0.2
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>
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: POSIX :: Linux
12
12
  License-File: LICENSE
13
- Requires-Dist: console-window >= 1.0.0
13
+ Requires-Dist: console-window == 1.4.2
14
14
  Project-URL: Bug Tracker, https://github.com/joedefen/dwipe/issues
15
15
  Project-URL: Homepage, https://github.com/joedefen/dwipe
16
16
 
@@ -25,7 +25,7 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
25
25
  | Interactive TUI | ✓ | ✓ | ✗ | ✗ |
26
26
  | Multiple simultaneous wipes | ✓ | ✗ | ✗ | ✗ |
27
27
  | Hot-swap detection | ✓ | ✗ | ✗ | ✗ |
28
- | Device/partition locking | ✓ | ✗ | ✗ | ✗ |
28
+ | Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
29
29
  | Persistent wipe state | ✓ | ✗ | ✗ | ✗ |
30
30
  | Resume interrupted wipes | ✓ | ✗ | ✗ | ✗ |
31
31
  | Wipe operation logging | ✓ | ✗ | ✗ | ✗ |
@@ -38,6 +38,37 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
38
38
  > * **Modern drives are reliably wiped with one pass of zeros**; just zero once in almost all cases for best, fastest results.
39
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
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
+
41
72
  ## **V2 Features**
42
73
 
43
74
  * **Statistical verification** - Automatic or on-demand verification with intelligent pattern detection:
@@ -51,10 +82,10 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
51
82
  * **Configurable confirmation modes** - Choose your safety level: single keypress (Y/y), typed confirmation (YES/yes), or device name (cycle with **c** key)
52
83
  * **Enhanced wipe history** - Detailed log viewer (**h** key) shows wipe history with UUIDs, filesystems, labels, and percentages for stopped wipes
53
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)
54
- * **Persistent user preferences** - Theme, wipe mode (Rand/Zero/Rand+V/Zero+V), confirmation mode, verification %, and locked devices persist across sessions (saved to `~/.config/dwipe/state.json`)
55
- * **Individual partition locking** - Lock individual partitions to prevent accidental wiping (previously only whole disks could be locked)
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)
56
87
  * **Full terminal color themes** - Complete themed color schemes with backgrounds, not just highlights (cycle with **t** key)
57
- * **Visual feedback improvements** - Mounted and locked devices appear dimmed; active wipes are bright and prominent
88
+ * **Visual feedback improvements** - Mounted and blocked devices appear dimmed; active wipes are bright and prominent
58
89
  * **Smart device identification** - Uses UUID/PARTUUID/serial numbers for stable device tracking across reconnections
59
90
  * **Screen-based navigation** - Modern screen stack architecture with help screen (**?**) and history screen (**h**)
60
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.
@@ -65,6 +96,9 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
65
96
  - **Python 3.8 or higher**
66
97
  - **Root/sudo privileges** (automatically requested when you run the tool)
67
98
  - **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
68
102
 
69
103
  ## Installation
70
104
 
@@ -84,28 +118,37 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
84
118
  `dwipe` provides comprehensive disk wiping capabilities with safety features:
85
119
 
86
120
  * **Smart device display** - Shows disks and partitions with labels, sizes, types, and vendor/model information to help identify devices correctly
87
- * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk locking
121
+ * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk blocking
88
122
  * **Hot-swap detection** - Updates the device list when storage changes; newly added devices are marked with **^** to make them easy to spot
89
123
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once, with individual progress tracking and completion states
90
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
91
125
  * **Persistent state tracking** - Wipe status survives reboots; partially wiped (**s**) and completed (**W**) states are stored on the device
92
126
  * **Device filtering** - Filter devices by name/pattern using regex in case of too many for one screen
93
127
  * **Stop capability** - Stop individual wipes or all wipes in progress
94
- * **Disk locking** - Manually lock disks to prevent accidental wipes (locks hide all partitions)
95
- * **Dry-run mode** - Practice using the interface without risk using `--dry-run`
128
+ * **Disk blocking** - Manually block disks to prevent accidental wipes (blocks hide all partitions)
96
129
 
97
130
 
98
131
  > **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.
99
-
132
+
100
133
  ## Usage
101
134
 
102
135
  Simply run `dwipe` from the command line without arguments: `dwipe`
103
136
 
137
+ ### Command-Line Options
138
+
139
+ - `--firmware-wipes` or `-F` - Enable experimental (alpha) firmware wipes
140
+ - Enables hardware-based secure erase operations (NVMe Sanitize/Format, SATA ATA Security Erase)
141
+ - Requires `nvme-cli` and `hdparm` tools to be installed
142
+ - Without this flag, only software wipes (Zero/Rand) are available
143
+ - **Warning**: This feature is experimental and should be used with caution
144
+ - `--dump-lsblk` - Dump parsed device information and exit (for debugging)
145
+ - `--help` - Show help message with all available options
146
+
104
147
  ### Color Legend
105
148
 
106
149
  `dwipe` uses color coding to provide instant visual feedback about device and operation status:
107
150
 
108
- - **Dimmed (gray)** - Mounted or locked devices (cannot be wiped)
151
+ - **Dimmed (gray)** - Mounted or blocked devices (cannot be wiped)
109
152
  - **Default (white)** - Ready to wipe, idle state, or previously wiped (before this session)
110
153
  - **Bright cyan/blue + bold** - Active wipe or verification in progress (0-100% write, v0-v100% verify)
111
154
  - **Bold yellow** - Stopped or partially completed wipe
@@ -153,8 +196,8 @@ The **STATE** column shows the current status of each device:
153
196
  | **STOP** | Wipe or verification is being stopped |
154
197
  | **s** | Wipe was stopped - device is partially wiped (can restart or verify) |
155
198
  | **W** | Wipe was completed successfully (can wipe again or verify) |
156
- | **Lock** | Disk is manually locked - partitions are hidden and cannot be wiped |
157
- | **Unlk** | Disk was just unlocked (transitory state) |
199
+ | **Blk** | Disk is manually blocked - partitions are hidden and cannot be wiped |
200
+ | **Unbl** | Disk was just unblocked (transitory state) |
158
201
 
159
202
  ### Available Actions
160
203
 
@@ -166,42 +209,39 @@ The top line shows available actions. Some are context-sensitive (only available
166
209
  | **v** | verify | Verify a wiped device or detect pattern on unmarked disk (context-sensitive) |
167
210
  | **s** | stop | Stop the selected wipe in progress (context-sensitive) |
168
211
  | **S** | Stop All | Stop all wipes in progress |
169
- | **l** | lock/unlock | Lock or unlock a disk to prevent accidental wiping |
212
+ | **b** | block/unblock | Block or unblock a disk to prevent accidental wiping |
170
213
  | **q** or **x** | quit | Quit the application (stops all wipes first) |
171
214
  | **?** | help | Show help screen with all actions and navigation keys |
172
215
  | **h** | history | Show wipe history log |
173
216
  | **/** | filter | Filter devices by regex pattern (shows matching devices + all active wipes) |
174
217
  | **ESC** | clear filter | Clear the filter and jump to top of list |
175
- | **m** | mode | Cycle wipe mode: Rand, Zero, Rand+V, Zero+V (saved as preference) |
218
+ | **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] |
176
220
  | **P** | passes | Cycle wipe passes: 1, 2, or 4 (saved as preference) |
177
221
  | **V** | verify % | Cycle verification percentage: 0%, 2%, 5%, 10%, 25%, 50%, 100% (saved as preference) |
178
- | **c** | confirmation | Cycle confirmation mode: Y, y, YES, yes, device name (saved as preference) |
179
- | **d** | dirty limit | Cycle dirty page limit: 0, 500, 1000, 2000, 4000 MB (saved as preference) |
180
222
  | **D** | dense | Toggle dense/spaced view (saved as preference) |
181
223
  | **t** | themes | Open theme preview screen to view and change color themes |
182
224
 
183
- ### Wipe Modes
225
+ ### Wipe Types
184
226
 
185
- `dwipe` supports four wipe modes (cycle with **m** key):
227
+ `dwipe` supports several wipe modes.
186
228
 
187
229
  - **Zero** - Fills the device with zeros (multi-pass alternates random/zero patterns, ending on zeros)
188
- - **Zero+V** - Same as Zero, but automatically verifies after wipe completes (if verify % > 0)
189
230
  - **Rand** - Fills the device with random data (multi-pass alternates zero/random patterns, ending on random)
190
- - **Rand+V** - Same as Rand, but automatically verifies after wipe completes (if verify % > 0)
231
+ - **Firmware wipes** - TBD
191
232
 
192
233
  The `+V` suffix indicates automatic verification after wipe completion. Without `+V`, you can still manually verify by pressing **v** on a wiped device.
193
234
 
194
- > **Note:** Multi-pass 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.
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.
195
236
 
196
237
  ### Resuming Stopped Wipes
197
238
 
198
- Stopped wipes (state **s**) can be resumed by pressing **w** on the device:
239
+ 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.
199
240
 
200
241
  **How Resume Works:**
201
242
  - Preserves the original wipe mode (Rand or Zero) from when the wipe was started
202
243
  - Uses the **current** passes setting to determine how much more to write
203
- - Continues from the exact byte offset where it stopped (rounded to buffer boundary)
204
- - Smart validation ensures interrupted wipes resume with correct pattern integrity
244
+ - Continues from the exact byte offset where it marked that stopped (rounded to buffer boundary). "Marks" are written about every 30s so for non-gracefully ended wipes, the position may be as much as 30s (or somewhat more) from the last wiped disk blocks.
205
245
 
206
246
  **Resume Examples:**
207
247
 
@@ -256,7 +296,7 @@ Stopped wipes (state **s**) can be resumed by pressing **w** on the device:
256
296
 
257
297
  ### Progress Information
258
298
 
259
- When wiping a device, `dwipe` displays:
299
+ When software wiping a device, `dwipe` displays:
260
300
  - **Elapsed time** - Time since wipe started (e.g., 1m18s)
261
301
  - **Remaining time** - Estimated time to completion (e.g., -3m6s)
262
302
  - **Write rate** - Current throughput (e.g., "45.2MB/s")
@@ -314,7 +354,7 @@ Press **ESC** from the main screen to clear the filter and return to showing all
314
354
 
315
355
  ## Security Considerations
316
356
 
317
- **Important limitations:**
357
+ **Important limitations of software wipes:**
318
358
 
319
359
  - `dwipe` supports multi-pass wiping with alternating patterns, but does not implement specific DoD 5220.22-M or Gutmann certified pattern sequences
320
360
  - More than adequate for **personal and business data** that doesn't require (antiquated) certified destruction
@@ -327,8 +367,7 @@ Press **ESC** from the main screen to clear the filter and return to showing all
327
367
 
328
368
  **Best practices:**
329
369
  - Verify device labels and sizes carefully before wiping
330
- - Use the **Lock** feature to protect critical disks
331
- - Test with `--dry-run` first if unsure
370
+ - Use the **Block** feature to protect critical disks
332
371
  - Consider encryption for sensitive data as the primary security measure
333
372
 
334
373
  ---
@@ -347,7 +386,7 @@ Press **ESC** from the main screen to clear the filter and return to showing all
347
386
  ### Wipe issues
348
387
  - **Can't wipe a device** - Check the STATE column:
349
388
  - **Mnt** - Unmount the partition first: `sudo umount /dev/sdXN`
350
- - **Lock** - Press **l** to unlock
389
+ - **Blk** - Press **b** to unblock
351
390
  - **Busy** - Another partition on the disk is being wiped
352
391
  - **Wipe is very slow** - Normal for large drives; check write rate to verify progress
353
392
  - **Wipe seems stuck** - Most likely due to bad disks; Direct I/O makes progress almost constant on good disks.
@@ -9,7 +9,7 @@
9
9
  | Interactive TUI | ✓ | ✓ | ✗ | ✗ |
10
10
  | Multiple simultaneous wipes | ✓ | ✗ | ✗ | ✗ |
11
11
  | Hot-swap detection | ✓ | ✗ | ✗ | ✗ |
12
- | Device/partition locking | ✓ | ✗ | ✗ | ✗ |
12
+ | Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
13
13
  | Persistent wipe state | ✓ | ✗ | ✗ | ✗ |
14
14
  | Resume interrupted wipes | ✓ | ✗ | ✗ | ✗ |
15
15
  | Wipe operation logging | ✓ | ✗ | ✗ | ✗ |
@@ -22,6 +22,37 @@
22
22
  > * **Modern drives are reliably wiped with one pass of zeros**; just zero once in almost all cases for best, fastest results.
23
23
  > * `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).
24
24
 
25
+ ## **V3 Features** (Partly in V2.x)
26
+
27
+ > Features added since initial V2 deployment (may not be in a demo until V3).
28
+
29
+ * **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).
30
+ * **Fast SATA Release**. If you press `DEL` on a SATA drive in a hot-swap bay (and not mounted or otherwise busy):
31
+ * it will be removed from the OS managed devices,
32
+ * when gone from the `dwipe` screen, you can then pull out the device, and insert another one.
33
+ * So, replacing the drive can take just seconds, not minutes awaiting SATA timeouts.
34
+ * **Background device monitoring** - Faster and more efficient hot-swap detection with dedicated monitoring thread:
35
+ - Monitors `/sys/class/block` and `/proc/partitions` for device changes
36
+ - Runs `lsblk` only when changes detected (previously ran every refresh)
37
+ - Reduces CPU usage and improves responsiveness
38
+ - Faster detection of newly inserted or removed devices
39
+ * **Lock renamed Block** - To reduce confusion, the "lock" feature is renamed.
40
+ - "Blocking" a partition or disk is only effective within the running app.
41
+ - It prevents wiping w/o first unblocking even if unmounted or otherwise it a wipeable state.
42
+ - It does not system level lock of any type.
43
+ * **Hardware-based firmware wipes (EXPERIMENTAL/ALPHA)** - Full support for firmware-level secure erase operations:
44
+ - **⚠️ Requires `--firmware-wipes` flag to enable (disabled by default)**
45
+ - **NVMe Sanitize**: Crypto Erase, Block Erase, and Overwrite operations via `nvme-cli`
46
+ - **NVMe Format**: Secure format with optional crypto erase
47
+ - **SATA ATA Security Erase**: Normal and Enhanced erase modes via `hdparm`
48
+ - Automatic capability detection shows only supported methods for each drive
49
+ - Firmware wipes are much faster than software wipes (seconds to minutes vs hours)
50
+ - Same user interface - firmware options appear alongside Zero/Rand in wipe confirmation
51
+ - Progress tracking with "FW" indicator to show hardware operation in progress
52
+ - Persistent markers track firmware wipe completion and method used
53
+ - See [FIRMWARE_WIPES.md](FIRMWARE_WIPES.md) for technical details
54
+ - **Note**: This feature is experimental; software wipes are recommended for most users
55
+
25
56
  ## **V2 Features**
26
57
 
27
58
  * **Statistical verification** - Automatic or on-demand verification with intelligent pattern detection:
@@ -35,10 +66,10 @@
35
66
  * **Configurable confirmation modes** - Choose your safety level: single keypress (Y/y), typed confirmation (YES/yes), or device name (cycle with **c** key)
36
67
  * **Enhanced wipe history** - Detailed log viewer (**h** key) shows wipe history with UUIDs, filesystems, labels, and percentages for stopped wipes
37
68
  * **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)
38
- * **Persistent user preferences** - Theme, wipe mode (Rand/Zero/Rand+V/Zero+V), confirmation mode, verification %, and locked devices persist across sessions (saved to `~/.config/dwipe/state.json`)
39
- * **Individual partition locking** - Lock individual partitions to prevent accidental wiping (previously only whole disks could be locked)
69
+ * **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`)
70
+ * **Individual partition blocking** - Block individual partitions to prevent accidental wiping (previously only whole disks could be blocked)
40
71
  * **Full terminal color themes** - Complete themed color schemes with backgrounds, not just highlights (cycle with **t** key)
41
- * **Visual feedback improvements** - Mounted and locked devices appear dimmed; active wipes are bright and prominent
72
+ * **Visual feedback improvements** - Mounted and blocked devices appear dimmed; active wipes are bright and prominent
42
73
  * **Smart device identification** - Uses UUID/PARTUUID/serial numbers for stable device tracking across reconnections
43
74
  * **Screen-based navigation** - Modern screen stack architecture with help screen (**?**) and history screen (**h**)
44
75
  * **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.
@@ -49,6 +80,9 @@
49
80
  - **Python 3.8 or higher**
50
81
  - **Root/sudo privileges** (automatically requested when you run the tool)
51
82
  - **lsblk utility** (usually pre-installed on most Linux distributions)
83
+ - **Optional (for firmware wipes only):**
84
+ - `nvme-cli` - For NVMe Sanitize and Format operations
85
+ - `hdparm` - For SATA ATA Security Erase operations
52
86
 
53
87
  ## Installation
54
88
 
@@ -68,28 +102,37 @@
68
102
  `dwipe` provides comprehensive disk wiping capabilities with safety features:
69
103
 
70
104
  * **Smart device display** - Shows disks and partitions with labels, sizes, types, and vendor/model information to help identify devices correctly
71
- * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk locking
105
+ * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk blocking
72
106
  * **Hot-swap detection** - Updates the device list when storage changes; newly added devices are marked with **^** to make them easy to spot
73
107
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once, with individual progress tracking and completion states
74
108
  * **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
75
109
  * **Persistent state tracking** - Wipe status survives reboots; partially wiped (**s**) and completed (**W**) states are stored on the device
76
110
  * **Device filtering** - Filter devices by name/pattern using regex in case of too many for one screen
77
111
  * **Stop capability** - Stop individual wipes or all wipes in progress
78
- * **Disk locking** - Manually lock disks to prevent accidental wipes (locks hide all partitions)
79
- * **Dry-run mode** - Practice using the interface without risk using `--dry-run`
112
+ * **Disk blocking** - Manually block disks to prevent accidental wipes (blocks hide all partitions)
80
113
 
81
114
 
82
115
  > **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.
83
-
116
+
84
117
  ## Usage
85
118
 
86
119
  Simply run `dwipe` from the command line without arguments: `dwipe`
87
120
 
121
+ ### Command-Line Options
122
+
123
+ - `--firmware-wipes` or `-F` - Enable experimental (alpha) firmware wipes
124
+ - Enables hardware-based secure erase operations (NVMe Sanitize/Format, SATA ATA Security Erase)
125
+ - Requires `nvme-cli` and `hdparm` tools to be installed
126
+ - Without this flag, only software wipes (Zero/Rand) are available
127
+ - **Warning**: This feature is experimental and should be used with caution
128
+ - `--dump-lsblk` - Dump parsed device information and exit (for debugging)
129
+ - `--help` - Show help message with all available options
130
+
88
131
  ### Color Legend
89
132
 
90
133
  `dwipe` uses color coding to provide instant visual feedback about device and operation status:
91
134
 
92
- - **Dimmed (gray)** - Mounted or locked devices (cannot be wiped)
135
+ - **Dimmed (gray)** - Mounted or blocked devices (cannot be wiped)
93
136
  - **Default (white)** - Ready to wipe, idle state, or previously wiped (before this session)
94
137
  - **Bright cyan/blue + bold** - Active wipe or verification in progress (0-100% write, v0-v100% verify)
95
138
  - **Bold yellow** - Stopped or partially completed wipe
@@ -137,8 +180,8 @@ The **STATE** column shows the current status of each device:
137
180
  | **STOP** | Wipe or verification is being stopped |
138
181
  | **s** | Wipe was stopped - device is partially wiped (can restart or verify) |
139
182
  | **W** | Wipe was completed successfully (can wipe again or verify) |
140
- | **Lock** | Disk is manually locked - partitions are hidden and cannot be wiped |
141
- | **Unlk** | Disk was just unlocked (transitory state) |
183
+ | **Blk** | Disk is manually blocked - partitions are hidden and cannot be wiped |
184
+ | **Unbl** | Disk was just unblocked (transitory state) |
142
185
 
143
186
  ### Available Actions
144
187
 
@@ -150,42 +193,39 @@ The top line shows available actions. Some are context-sensitive (only available
150
193
  | **v** | verify | Verify a wiped device or detect pattern on unmarked disk (context-sensitive) |
151
194
  | **s** | stop | Stop the selected wipe in progress (context-sensitive) |
152
195
  | **S** | Stop All | Stop all wipes in progress |
153
- | **l** | lock/unlock | Lock or unlock a disk to prevent accidental wiping |
196
+ | **b** | block/unblock | Block or unblock a disk to prevent accidental wiping |
154
197
  | **q** or **x** | quit | Quit the application (stops all wipes first) |
155
198
  | **?** | help | Show help screen with all actions and navigation keys |
156
199
  | **h** | history | Show wipe history log |
157
200
  | **/** | filter | Filter devices by regex pattern (shows matching devices + all active wipes) |
158
201
  | **ESC** | clear filter | Clear the filter and jump to top of list |
159
- | **m** | mode | Cycle wipe mode: Rand, Zero, Rand+V, Zero+V (saved as preference) |
202
+ | **ESC** | back | Return to previous screen if on nested screen |
203
+ | **m** | mode | Cycle auto verify mode: +V (verify), -V (don't) [saved as preference] |
160
204
  | **P** | passes | Cycle wipe passes: 1, 2, or 4 (saved as preference) |
161
205
  | **V** | verify % | Cycle verification percentage: 0%, 2%, 5%, 10%, 25%, 50%, 100% (saved as preference) |
162
- | **c** | confirmation | Cycle confirmation mode: Y, y, YES, yes, device name (saved as preference) |
163
- | **d** | dirty limit | Cycle dirty page limit: 0, 500, 1000, 2000, 4000 MB (saved as preference) |
164
206
  | **D** | dense | Toggle dense/spaced view (saved as preference) |
165
207
  | **t** | themes | Open theme preview screen to view and change color themes |
166
208
 
167
- ### Wipe Modes
209
+ ### Wipe Types
168
210
 
169
- `dwipe` supports four wipe modes (cycle with **m** key):
211
+ `dwipe` supports several wipe modes.
170
212
 
171
213
  - **Zero** - Fills the device with zeros (multi-pass alternates random/zero patterns, ending on zeros)
172
- - **Zero+V** - Same as Zero, but automatically verifies after wipe completes (if verify % > 0)
173
214
  - **Rand** - Fills the device with random data (multi-pass alternates zero/random patterns, ending on random)
174
- - **Rand+V** - Same as Rand, but automatically verifies after wipe completes (if verify % > 0)
215
+ - **Firmware wipes** - TBD
175
216
 
176
217
  The `+V` suffix indicates automatic verification after wipe completion. Without `+V`, you can still manually verify by pressing **v** on a wiped device.
177
218
 
178
- > **Note:** Multi-pass 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.
219
+ > **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.
179
220
 
180
221
  ### Resuming Stopped Wipes
181
222
 
182
- Stopped wipes (state **s**) can be resumed by pressing **w** on the device:
223
+ 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.
183
224
 
184
225
  **How Resume Works:**
185
226
  - Preserves the original wipe mode (Rand or Zero) from when the wipe was started
186
227
  - Uses the **current** passes setting to determine how much more to write
187
- - Continues from the exact byte offset where it stopped (rounded to buffer boundary)
188
- - Smart validation ensures interrupted wipes resume with correct pattern integrity
228
+ - Continues from the exact byte offset where it marked that stopped (rounded to buffer boundary). "Marks" are written about every 30s so for non-gracefully ended wipes, the position may be as much as 30s (or somewhat more) from the last wiped disk blocks.
189
229
 
190
230
  **Resume Examples:**
191
231
 
@@ -240,7 +280,7 @@ Stopped wipes (state **s**) can be resumed by pressing **w** on the device:
240
280
 
241
281
  ### Progress Information
242
282
 
243
- When wiping a device, `dwipe` displays:
283
+ When software wiping a device, `dwipe` displays:
244
284
  - **Elapsed time** - Time since wipe started (e.g., 1m18s)
245
285
  - **Remaining time** - Estimated time to completion (e.g., -3m6s)
246
286
  - **Write rate** - Current throughput (e.g., "45.2MB/s")
@@ -298,7 +338,7 @@ Press **ESC** from the main screen to clear the filter and return to showing all
298
338
 
299
339
  ## Security Considerations
300
340
 
301
- **Important limitations:**
341
+ **Important limitations of software wipes:**
302
342
 
303
343
  - `dwipe` supports multi-pass wiping with alternating patterns, but does not implement specific DoD 5220.22-M or Gutmann certified pattern sequences
304
344
  - More than adequate for **personal and business data** that doesn't require (antiquated) certified destruction
@@ -311,8 +351,7 @@ Press **ESC** from the main screen to clear the filter and return to showing all
311
351
 
312
352
  **Best practices:**
313
353
  - Verify device labels and sizes carefully before wiping
314
- - Use the **Lock** feature to protect critical disks
315
- - Test with `--dry-run` first if unsure
354
+ - Use the **Block** feature to protect critical disks
316
355
  - Consider encryption for sensitive data as the primary security measure
317
356
 
318
357
  ---
@@ -331,7 +370,7 @@ Press **ESC** from the main screen to clear the filter and return to showing all
331
370
  ### Wipe issues
332
371
  - **Can't wipe a device** - Check the STATE column:
333
372
  - **Mnt** - Unmount the partition first: `sudo umount /dev/sdXN`
334
- - **Lock** - Press **l** to unlock
373
+ - **Blk** - Press **b** to unblock
335
374
  - **Busy** - Another partition on the disk is being wiped
336
375
  - **Wipe is very slow** - Normal for large drives; check write rate to verify progress
337
376
  - **Wipe seems stuck** - Most likely due to bad disks; Direct I/O makes progress almost constant on good disks.