
Tool to securely and efficiently wipe devices and partiitions for Linux
dwipe is a tool to wipe disks and partitions for Linux to help secure your data. dwipe aims to reduce mistakes by providing ample information about your devices during selection.

| Feature | dwipe | nwipe | shred | dd |
|---|---|---|---|---|
| Firmware wipes (SATA/NVMe secure erase) | ✓ | ✗ | ✗ | ✗ |
| Software wipes (Zero, Pseudo Random) | ✓ | ✓ | ✓ | ✗ |
| Interactive TUI | ✓ | ✓ | ✗ | ✗ |
| Multiple simultaneous wipes | ✓ | ✗ | ✗ | ✗ |
| Persistent wipe state | ✓ | ✗ | ✗ | ✗ |
| Hot-swap detection / release | ✓ | ✗ | ✗ | ✗ |
| Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
| Resume interrupted software wipes | ✓ | ✗ | ✗ | ✗ |
| Wipe operation logging | ✓ | ✗ | ✗ | ✗ |
| Mount detection/prevention | ✓ | ✓ | ✗ | ✗ |
| Fast Statistical sampling verification | ✓ | ✗ | ✗ | ✗ |
| Certified destruction (DoD/Gutmann standards, full verification, certificates) | ✗ | ✓ | ✗ | ✗ |
- 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.
- 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.
- Verification uses intelligent statistical sampling: Even 1% verification samples across the entire disk via 100 sections, providing comprehensive coverage without full sequential read.
/dev/, /sys/, /proc/ interfaces)Optional (for clipboard copy in history screen):
apt install xclip or xsel)apt install wl-clipboard)pipx install dwipedwipe --helppipx uninstall dwipedwipedwipe from a terminal (sudo will be requested automatically)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 ...Rand or Zero (interruptible, shows progress).dwipe auto-detects the resume and rescans. Or press to rescan manually. The drive should come back unfrozen.dwipe provides comprehensive disk wiping capabilities with safety features:
Note:
dwipeshows 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.
Simply run dwipe from the command line without arguments: dwipe
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.
--mode {-V,+V} - Verification mode (default: your last preference)
-V - Wipe without automatic verification+V - Verify device after wipe completes--passes {1,2,4} - Number of passes for software wipes (default: your last preference)
--verify-pct {1,3,10,30,100} - Verification percentage (default: your last preference)
--dense {True,False} - Compact view mode (default: your last preference)
True - Compact spacing (fewer blank lines between disks)False - Spaced view (blank lines between disks for readability)--port-serial {Auto,On,Off} - Disk port/serial display (default: your last preference)
Auto - Show port/serial only for whole disks (recommended)On - Always show port and serial numberOff - Never show port and serial number--slowdown-stop {0,4,16,64,256} - Stop if disk slows down (default: your last preference, milliseconds)
0 = Disabled--stall-timeout {0,60,120,300,600} - Stall timeout in seconds (default: your last preference)
0 = Disabled (never timeout)--firmware-wipes or -F - Enable firmware wipes
--dump-lsblk - Dump parsed device information and exit (for debugging)--help - Show help message with all available optionsdwipe uses color coding to provide instant visual feedback about device and operation status:
dwipe supports multiple color themes for improved visibility and aesthetics.
Available themes:
default - Terminal Default (basic ANSI colors)dark-mono - Dark Mono (almost-white on almost-black with bright colors)light-mono - Light Mono (almost-black on almost-white with bright colors)solarized-dark - Solarized Dark palettesolarized-light - Solarized Light palette (for light terminal backgrounds)gruvbox - Gruvbox Dark palettenord - Nord paletteChanging themes:
Theme features:
The STATE column shows the current status of each device:
The top line shows available actions. Some are context-sensitive (only available for certain devices):
Press h to view the wipe history log. The history screen shows all wipe and verify operations with timestamps, device info, and results.
History screen actions:
/ for deep JSON search)Clipboard copy methods (detected automatically):
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 onin your.tmux.conf.
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.
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).
| Rank | Abbrev | Official Name | Remarks |
|---|---|---|---|
| 1 | Rand | Software Random Write | Preferred; unpredictable pattern; statistical verification |
| 2 | Zero | Software Zero Write | Simpler; fast verification (fails on first non-zero byte) |
Notes:
- Firmware wipes show only methods supported by each drive (see FwCAPS column).
- Firmware wipes include automatic spotcheck verification.
- The
+Vsuffix enables automatic verification after software wipes. Without+V, press v to verify manually.- Multi-pass software wipes (2 or 4) alternate zero/random patterns, ending on your selected mode.
- USB drives and partitions lack firmware erase—only software wipes available.
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.
How Resume Works:
Resume Examples:
Benefits:
Software wipes use intelligent verification with statistical analysis and fast-fail optimizations. Verification is configurable and optional.
Smart Sampling:
--verify-pct command-line option (saved as preference)Pattern Detection:
Verification Modes:
+V suffix (Rand+V or Zero+V) and set verify % > 0Verification States:
Why statistical sampling is better than sequential:
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.
Spotcheck Approach:
Why Spotchecks Are Effective:
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.
When software wiping a device, dwipe displays:
The W (wiped) and s (partially wiped) states are persistent across reboots. This is achieved by writing metadata to the first 16KB of the device:
When a device with persistent state is displayed, additional information shows:
When ? is typed, you can see the available keys and command-line options with their current settings.
You can navigate the device list using:
The / key activates incremental search filtering with vim-style behavior:
How it works:
Filter Examples:
The filter supports regex patterns. Here are some useful examples:
/sda # Show only sda and its partitions
/sd[ab] # Show sda, sdb and their partitions
/nvme # Show all NVMe devices
/nvme0n1p[12] # Show only partitions 1 and 2 of nvme0n1
/usb # Show devices with "usb" in their labels
Press ESC from the main screen to clear the filter and return to showing all devices.
Note: Invalid regex patterns are ignored - the filter stays at the last valid pattern while you type.
Important limitations of software wipes:
dwipe supports multi-pass wiping with alternating patterns, but does not implement specific DoD 5220.22-M or Gutmann certified pattern sequencesBest practices:
util-linux packagedwipe automatically requests sudo; ensure you can use sudoreset or stty sane commandsudo umount /dev/sdXNFirmware wipes (SATA/NVMe secure erase operations) have different characteristics than software wipes:
Frozen Drives:
dwipe limitationdwipe auto-detects the resume and rescans (or press r manually). The suspend/resume power-cycles the SATA link which clears the freeze.Device Quirks and Compatibility:
dwipe cannot guarantee that all devices will be successfully wiped—some hardware simply may not cooperate with erase commandsdwipe includes built-in protections for problematic storage devices:
Automatic Error Handling. When encountering disk errors during wiping:
Stall and Slowdown Detection. dwipe monitors write performance and can abort problematic operations:
If a Wipe Gets Stuck... If a wipe appears frozen or unresponsive:
dwipesudo pkill -f "python.*dwipe" (targets only dwipe processes)Preventing Issues with Problematic Media. For known bad disks or questionable hardware:
Common Disk Error Patterns
Recovery After Abort. If a wipe aborts due to disk errors:
Requirement 1: SAT (SCSI-ATA Translation) Support
Requirement 2: Stable Power
Requirement 3: Command Timeout Integrity
sudo hdparm --user-master u --security-unlock NULL /dev/sdX
sudo hdparm --user-master u --security-disable NULL /dev/sdX
Issues and pull requests welcome at github.com/joedefen/dwipe
MIT License - see LICENSE file for details.
rdwipe locked it, the password is NULL; otherwise use the password that locked it.DEL to detach, physically swap drives, then r to rescan (if needed).| State | Meaning |
|---|
| - | Device is ready for wiping |
| ^ | Device is ready for wiping AND was added after dwipe started (hot-swapped) |
| Mnt | Partition is mounted or disk has mounted partitions - cannot be wiped |
| N% | Wipe is in progress (shows percentage complete, 0-100%) |
| vN% | Verification is in progress (shows percentage complete, v0-v100%) |
| STOP | Wipe or verification is being stopped |
| s | Wipe was stopped - device is partially wiped (can restart or verify) |
| W | Wipe was completed successfully (can wipe again or verify) |
| Blk | Disk is manually blocked - partitions are hidden and cannot be wiped |
| Unbl | Disk was just unblocked (transitory state) |
| Key | Action | Description |
|---|
| w | wipe | Wipe the selected device (requires confirmation) |
| v | verify | Verify a wiped device or detect pattern on unmarked disk (context-sensitive) |
| s | stop | Stop the selected wipe in progress (context-sensitive) |
| S | Stop All | Stop all wipes in progress |
| DEL | delete | Remove disk from system (whole disks only, context-sensitive) |
| b | block/unblock | Block or unblock a disk to prevent accidental wiping |
| / | filter | Filter devices by regex pattern (shows matching devices + all active wipes) |
| r | rescan | Rescan all devices and reset hardware capabilities detection |
| h | history | Show wipe history log |
| t | themes | Open theme preview screen to view and change color themes |
| q or x | quit | Quit the application (stops all wipes first) |
| ? | help | Show help screen with all actions and navigation keys |
| ESC | clear filter | Clear the filter and jump to top of list |
| ESC | back | Return to previous screen if on nested screen |
| a | time format | Cycle wipe history time display format (ago+time, ago, time) |
| Environment | Method | Notes |
|---|
| SSH session | OSC 52 | Terminal escape sequence; requires terminal support (iTerm2, kitty, alacritty, Windows Terminal, tmux with set-clipboard on) |
| Wayland | wl-copy | Requires wl-clipboard package |
| X11 | xclip/xsel | Requires xclip or xsel package |
| Fallback | Terminal | Exits to shell, prints entry for manual copy |
| Rank | Abbrev | Official Name | Remarks |
|---|
| 1 | Crypto | Sanitize Cryptographic Erase | Fastest; erases encryption keys; instant data invalidation |
| 2 | Block | Sanitize Block Erase | Fast; resets all blocks to deallocated state |
| 3 | FCrypto | Format with Crypto Erase | Fast; reformats namespace with key erasure |
| 4 | FErase | Format with User Data Erase | Fast; reformats with simple data erase; less thorough than crypto |
| 5 | Ovwr | Sanitize Overwrite | Minutes; writes pattern to all blocks; most thorough but rarely needed |
| 6 | Rand | Software Random Write | Fallback; writes random data via software; hours for large drives |
| 7 | Zero | Software Zero Write | Fallback; writes zeros via software; verifiable but slower |
| Rank | Abbrev | Official Name | Remarks |
|---|
| 1 | SCrypto | Sanitize Cryptographic Erase | Fastest; erases encryption keys; requires SANITIZE feature |
| 2 | Enhanced | ATA Security Erase Enhanced | Fast; vendor-specific deep erase with crypto key destruction |
| 3 | SBlock | Sanitize Block Erase | Fast; resets blocks to factory state; requires SANITIZE feature |
| 4 | Erase | ATA Security Erase Normal | Minutes; writes zeros to all sectors; widely supported |
| 5 | SOverwrite | Sanitize Overwrite | Minutes; overwrites with pattern; requires SANITIZE feature |
| 6 | Rand | Software Random Write | Fallback; can't reach wear-leveled or remapped blocks |
| 7 | Zero | Software Zero Write | Fallback; can't reach wear-leveled or remapped blocks |
| Rank | Abbrev | Official Name | Remarks |
|---|
| 1 | Rand | Software Random Write | Preferred; interruptible, resumable, shows progress |
| 2 | Zero | Software Zero Write | Preferred; interruptible, resumable, fast verification |
| 3 | Enhanced | ATA Security Erase Enhanced | Slow (hours); not interruptible; no progress; same result as software |
| 4 | Erase | ATA Security Erase Normal | Slow (hours); not interruptible; no progress; same result as software |
| Stopped At | Current Passes | What Happens |
|---|
| 50% | 1 pass | Resumes: writes remaining 50% |
| 150% (1.5 of 4 passes) | 1 pass | Already complete (150% > 100%) |
| 150% (1.5 of 4 passes) | 4 passes | Resumes: writes 2.5 more passes (150% → 400%) |
| 100% (1 pass complete) | 2 passes | Resumes: writes pass 2 (100% → 200%) |