dwipe 2.0.2__tar.gz → 3.0.0__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.
- {dwipe-2.0.2 → dwipe-3.0.0}/PKG-INFO +219 -99
- {dwipe-2.0.2 → dwipe-3.0.0}/README.md +217 -97
- dwipe-3.0.0/dwipe/DeviceChangeMonitor.py +244 -0
- dwipe-3.0.0/dwipe/DeviceInfo.py +1119 -0
- dwipe-3.0.0/dwipe/DeviceWorker.py +566 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/DiskWipe.py +558 -134
- dwipe-3.0.0/dwipe/DrivePreChecker.py +203 -0
- dwipe-3.0.0/dwipe/FirmwareWipeTask.py +865 -0
- dwipe-3.0.0/dwipe/NvmeTool.py +225 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/PersistentState.py +20 -9
- dwipe-3.0.0/dwipe/SataTool.py +499 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/StructuredLogger.py +4 -3
- dwipe-3.0.0/dwipe/Tunables.py +62 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/Utils.py +192 -5
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/VerifyTask.py +4 -2
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/WipeJob.py +25 -13
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/WipeTask.py +4 -2
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/WriteTask.py +1 -1
- dwipe-3.0.0/dwipe/main.py +83 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/pyproject.toml +2 -2
- dwipe-3.0.0/runner +19 -0
- dwipe-2.0.2/dwipe/DeviceInfo.py +0 -724
- dwipe-2.0.2/dwipe/DrivePreChecker.py +0 -90
- dwipe-2.0.2/dwipe/FirmwareWipeTask.py +0 -370
- dwipe-2.0.2/dwipe/LsblkMonitor.py +0 -124
- dwipe-2.0.2/dwipe/ToolManager.py +0 -618
- dwipe-2.0.2/dwipe/main.py +0 -63
- dwipe-2.0.2/runner +0 -19
- {dwipe-2.0.2 → dwipe-3.0.0}/.gitignore +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/LICENSE +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/Prereqs.py +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/dwipe/__init__.py +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/images/dwipe-2025-12-31-09-37.gif +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/linter +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/resources/dwipe-help-screen.png +0 -0
- {dwipe-2.0.2 → dwipe-3.0.0}/resources/dwipe-main-screen.png +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dwipe
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
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.
|
|
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
|
-
|
|
|
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
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
> * **
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* **
|
|
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
|
-
* **
|
|
91
|
-
* **
|
|
92
|
-
* **
|
|
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.
|
|
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
|
-
- **
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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'**, press `DEL` to detach it and, when gone, press `r` to rescan; it 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)
|
|
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
|
|
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
|
-
|
|
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
|
-
| **
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
273
|
+
#### SATA HDDs (spinning drives)
|
|
234
274
|
|
|
235
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
268
|
-
- Ensures complete disk coverage even with
|
|
269
|
-
-
|
|
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
|
-
-
|
|
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
|
|
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,25 @@ 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
|
+
- Firmware wipes sometimes report the drive as "Frozen" if the device is present (mounted or in use) when capabilities are detected
|
|
481
|
+
- This is a drive-level security feature, not a `dwipe` limitation
|
|
482
|
+
- **Solution**: Unmount the device, wait briefly (often just a few seconds of idle time is enough), then use **r** to rescan capabilities
|
|
483
|
+
- The freeze state is usually temporary and clears after the device is no longer actively in use
|
|
484
|
+
- If the drive remains frozen, try hot-swapping (remove and reinsert) or power-cycling the device
|
|
485
|
+
|
|
486
|
+
**Device Quirks and Compatibility:**
|
|
487
|
+
- Storage devices have various firmware implementations and hardware quirks that affect secure erase operations
|
|
488
|
+
- Some drives may not fully support certain sanitize operations, have timing issues, or exhibit unexpected behavior
|
|
489
|
+
- `dwipe` cannot guarantee that all devices will be successfully wiped—some hardware simply may not cooperate with erase commands
|
|
490
|
+
- Always verify a drive after wiping (use **v** key) to confirm the erase actually completed
|
|
491
|
+
- For mission-critical data destruction on quirky hardware, consider using manufacturer-specific secure erase tools as a fallback
|
|
492
|
+
|
|
394
493
|
---
|
|
395
494
|
### Dealing with Bad or Failing Disks
|
|
396
495
|
|
|
@@ -435,7 +534,28 @@ dwipe includes built-in protections for problematic storage devices:
|
|
|
435
534
|
* Consider replacing the disk if errors persist
|
|
436
535
|
|
|
437
536
|
Note: Some disks are fundamentally broken and cannot be reliably wiped. dwipe will protect itself and your system, but cannot fix hardware failures.
|
|
537
|
+
---
|
|
538
|
+
#### Recommendations for SATA Wiping over USB
|
|
539
|
+
* Requirement 1: SAT (SCSI-ATA Translation) Support
|
|
438
540
|
|
|
541
|
+
* The USB bridge must be capable of "passing through" ATA commands.
|
|
542
|
+
* The Test: If the app can see the "Security" section in the drive details, the bridge supports SAT.
|
|
543
|
+
|
|
544
|
+
* Requirement 2: Stable Power
|
|
545
|
+
* Firmware wipes (especially on 3.5" HDDs) draw significant peak power.
|
|
546
|
+
* 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.
|
|
547
|
+
* The Recommendation: Always use an externally powered USB dock for 3.5" drives.
|
|
548
|
+
|
|
549
|
+
* Requirement 3: Command Timeout Integrity
|
|
550
|
+
* The bridge must not have an aggressive "Watchdog Timer."
|
|
551
|
+
* 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.
|
|
552
|
+
* The Recommendation: Use high-quality chipsets like ASMedia (1153E) or JMicron (JMS578).
|
|
553
|
+
|
|
554
|
+
##### Unlock Locked Device
|
|
555
|
+
```
|
|
556
|
+
sudo hdparm --user-master u --security-unlock NULL /dev/sdX
|
|
557
|
+
sudo hdparm --user-master u --security-disable NULL /dev/sdX
|
|
558
|
+
```
|
|
439
559
|
---
|
|
440
560
|
|
|
441
561
|
### Contributing
|