dwipe 3.0.0__tar.gz → 3.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 (56) hide show
  1. dwipe-3.0.2/.github/workflows/tests.yml +47 -0
  2. {dwipe-3.0.0 → dwipe-3.0.2}/.gitignore +2 -1
  3. {dwipe-3.0.0 → dwipe-3.0.2}/PKG-INFO +52 -15
  4. {dwipe-3.0.0 → dwipe-3.0.2}/README.md +48 -14
  5. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/DeviceInfo.py +182 -13
  6. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/DeviceWorker.py +12 -6
  7. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/DiskWipe.py +53 -17
  8. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/FirmwareWipeTask.py +24 -51
  9. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/NvmeTool.py +4 -4
  10. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/PersistentState.py +25 -2
  11. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/SataTool.py +7 -5
  12. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/Tunables.py +5 -5
  13. dwipe-3.0.2/dwipe/VerifyTask.py +194 -0
  14. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/WipeJob.py +92 -686
  15. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/WriteTask.py +21 -26
  16. dwipe-3.0.2/dwipe/device_io.py +105 -0
  17. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/main.py +4 -0
  18. dwipe-3.0.2/dwipe/markers.py +155 -0
  19. dwipe-3.0.2/dwipe/verification.py +283 -0
  20. dwipe-3.0.2/images/dwipe-2026-02-05.07-58.gif +0 -0
  21. {dwipe-3.0.0 → dwipe-3.0.2}/pyproject.toml +21 -2
  22. dwipe-3.0.2/tests/conftest.py +50 -0
  23. dwipe-3.0.2/tests/device_double.py +135 -0
  24. dwipe-3.0.2/tests/test_cli_options.py +25 -0
  25. dwipe-3.0.2/tests/test_device_change_monitor.py +87 -0
  26. dwipe-3.0.2/tests/test_device_io.py +165 -0
  27. dwipe-3.0.2/tests/test_device_worker.py +228 -0
  28. dwipe-3.0.2/tests/test_deviceinfo_logic.py +314 -0
  29. dwipe-3.0.2/tests/test_diskwipe_terminal.py +41 -0
  30. dwipe-3.0.2/tests/test_drive_prechecker.py +157 -0
  31. dwipe-3.0.2/tests/test_exception_observability.py +92 -0
  32. dwipe-3.0.2/tests/test_firmware_wipe_task.py +126 -0
  33. dwipe-3.0.2/tests/test_nvme_tool.py +182 -0
  34. dwipe-3.0.2/tests/test_persistent_state.py +203 -0
  35. dwipe-3.0.2/tests/test_safe_write.py +90 -0
  36. dwipe-3.0.2/tests/test_satatool_parse.py +118 -0
  37. dwipe-3.0.2/tests/test_structured_logger.py +167 -0
  38. dwipe-3.0.2/tests/test_utils.py +172 -0
  39. dwipe-3.0.2/tests/test_verification.py +97 -0
  40. dwipe-3.0.2/tests/test_verify_analysis.py +80 -0
  41. dwipe-3.0.2/tests/test_wipejob_logic.py +208 -0
  42. dwipe-3.0.2/tests/test_wipejob_resume.py +214 -0
  43. dwipe-3.0.0/dwipe/VerifyTask.py +0 -412
  44. {dwipe-3.0.0 → dwipe-3.0.2}/LICENSE +0 -0
  45. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/DeviceChangeMonitor.py +0 -0
  46. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/DrivePreChecker.py +0 -0
  47. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/Prereqs.py +0 -0
  48. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/StructuredLogger.py +0 -0
  49. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/Utils.py +0 -0
  50. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/WipeTask.py +0 -0
  51. {dwipe-3.0.0 → dwipe-3.0.2}/dwipe/__init__.py +0 -0
  52. {dwipe-3.0.0 → dwipe-3.0.2}/images/dwipe-2025-12-31-09-37.gif +0 -0
  53. {dwipe-3.0.0 → dwipe-3.0.2}/linter +0 -0
  54. {dwipe-3.0.0 → dwipe-3.0.2}/resources/dwipe-help-screen.png +0 -0
  55. {dwipe-3.0.0 → dwipe-3.0.2}/resources/dwipe-main-screen.png +0 -0
  56. {dwipe-3.0.0 → dwipe-3.0.2}/runner +0 -0
@@ -0,0 +1,47 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python ${{ matrix.python-version }}
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+
22
+ - name: Install package with test extras
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install -e '.[test]'
26
+
27
+ - name: Run unit tests with coverage
28
+ run: pytest --cov=dwipe --cov-report=term-missing --cov-fail-under=40
29
+
30
+ lint:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.13"
39
+
40
+ - name: Install pylint
41
+ run: python -m pip install --upgrade pip pylint
42
+
43
+ - name: Static checks (undefined names / bad calls)
44
+ # Full advisory lint is available locally via ./linter. This job blocks
45
+ # only on the error classes that indicate real bugs (undefined name,
46
+ # bad call signature) and currently passes at 10.00/10.
47
+ run: pylint --disable=all --enable=E0601,E0602,E0603,E1120,E1121 dwipe
@@ -6,4 +6,5 @@ venv.zd/
6
6
  *.pyc
7
7
  *egg-info*
8
8
  dist/
9
- .github/
9
+ .coverage
10
+ htmlcov/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dwipe
3
- Version: 3.0.0
3
+ Version: 3.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>
@@ -11,13 +11,16 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: POSIX :: Linux
12
12
  License-File: LICENSE
13
13
  Requires-Dist: console-window == 1.4.2
14
+ Requires-Dist: pytest >= 7.0 ; extra == "test"
15
+ Requires-Dist: pytest-cov >= 4.0 ; extra == "test"
14
16
  Project-URL: Bug Tracker, https://github.com/joedefen/dwipe/issues
15
17
  Project-URL: Homepage, https://github.com/joedefen/dwipe
18
+ Provides-Extra: test
16
19
 
17
20
  # dwipe
18
21
  `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.
19
22
 
20
- ![Demo of dwipe](https://raw.githubusercontent.com/joedefen/dwipe/master/images/dwipe-2025-12-31-09-37.gif)
23
+ ![Demo of dwipe](https://raw.githubusercontent.com/joedefen/dwipe/master/images/dwipe-2026-02-05.07-58.gif)
21
24
  ### Quick Comparison
22
25
 
23
26
  | Feature | dwipe | nwipe | shred | dd |
@@ -31,7 +34,7 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
31
34
  | Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
32
35
  | Resume interrupted software wipes | ✓ | ✗ | ✗ | ✗ |
33
36
  | Wipe operation logging | ✓ | ✗ | ✗ | ✗ |
34
- | Mount detection/prevention | ✓ | ✓ | ✗ | ✗ |
37
+ | Mount & LUKS/LVM/RAID/swap detection | ✓ | ✓ | ✗ | ✗ |
35
38
  | Fast Statistical sampling verification | ✓ | ✗ | ✗ | ✗ |
36
39
  | Certified destruction (DoD/Gutmann standards, full verification, certificates) | ✗ | ✓ | ✗ | ✗ |
37
40
 
@@ -46,7 +49,7 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
46
49
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once with individual progress tracking and completion states
47
50
  * **Persistent state tracking** - Wipe status survives reboots; partially wiped and completed states persist on the device (can resume wipes across power cycles)
48
51
  * **Smart device identification** - Uses UUID/PARTUUID/serial numbers for stable device tracking across reconnections
49
- * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports device blocking, inline confirmation prompts
52
+ * **Safety protections** - Prevents wiping mounted or in-use devices (including LUKS/LVM/RAID containers and swap), detects overlapping wipes, supports device blocking, inline confirmation prompts
50
53
  * **Intelligent verification with statistical sampling** - Fast verification that covers entire disk even at low percentages (1% verification samples from all 100 disk sections)
51
54
  * **Direct I/O to disk** - Fast and efficient wiping that avoids page cache pollution with automatic slowdown/stall detection and graceful abort
52
55
  * **Multiple color themes** - Terminal color themes designed for readability with context-sensitive visual feedback (mounted devices dimmed, active wipes bright)
@@ -81,7 +84,7 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
81
84
  1. **Drives and the OS often lie about drive type.** Outwit them both:
82
85
  * For spinning HDDs, **always** use `Rand` or `Zero` (interruptible, shows progress).
83
86
  * 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.
87
+ 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
88
  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
89
  1. **Hot-swap workflow for SATA drives**: `DEL` to detach, physically swap drives, then `r` to rescan (if needed).
87
90
 
@@ -91,7 +94,7 @@ Project-URL: Homepage, https://github.com/joedefen/dwipe
91
94
  `dwipe` provides comprehensive disk wiping capabilities with safety features:
92
95
 
93
96
  * **Smart device display** - Shows disks and partitions with labels, sizes, types, and vendor/model information to help identify devices correctly
94
- * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk blocking
97
+ * **Safety protections** - Prevents wiping mounted or in-use devices (including LUKS/LVM/RAID containers and swap), detects overlapping wipes, supports manual disk blocking
95
98
  * **Hot-swap detection** - Updates the device list when storage changes; newly added devices are marked with **^** to make them easy to spot
96
99
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once, with individual progress tracking and completion states
97
100
  * **Flexible wipe modes** - Choose between Rand, Zero, Rand+V (with auto-verify), or Zero+V (with auto-verify)
@@ -141,6 +144,10 @@ Simply run `dwipe` from the command line without arguments: `dwipe`
141
144
  - `--firmware-wipes` or `-F` - Enable firmware wipes
142
145
  - Enables hardware-based secure erase operations (NVMe Sanitize/Format, SATA ATA Security Erase)
143
146
  - Without this flag, only software wipes (Zero/Rand) are available
147
+ - `--auto-block-containers {on,off}` - Auto-block encrypted/stacked containers on first sight (default: on)
148
+ - Blocks devices whose filesystem is a container (LUKS, LVM, RAID member, swap) the first time they are seen, so wiping requires an explicit unblock (**b**)
149
+ - The block is remembered per device; once you unblock, it stays unblocked
150
+ - Set to `off` when re-provisioning many encrypted disks to avoid unblocking each one
144
151
  - `--dump-lsblk` - Dump parsed device information and exit (for debugging)
145
152
  - `--help` - Show help message with all available options
146
153
 
@@ -148,7 +155,7 @@ Simply run `dwipe` from the command line without arguments: `dwipe`
148
155
 
149
156
  `dwipe` uses color coding to provide instant visual feedback about device and operation status:
150
157
 
151
- - **Dimmed (gray)** - Mounted or blocked devices (cannot be wiped)
158
+ - **Dimmed (gray)** - Mounted, in-use (LUKS/LVM/RAID/swap), or blocked devices (cannot be wiped)
152
159
  - **Default (white)** - Ready to wipe, idle state, or previously wiped (before this session)
153
160
  - **Bright cyan/blue + bold** - Active wipe or verification in progress (0-100% write, v0-v100% verify)
154
161
  - **Bold yellow** - Stopped or partially completed wipe
@@ -190,15 +197,41 @@ The **STATE** column shows the current status of each device:
190
197
  |-------|---------|
191
198
  | **-** | Device is ready for wiping |
192
199
  | **^** | Device is ready for wiping AND was added after `dwipe` started (hot-swapped) |
193
- | **Mnt** | Partition is mounted or disk has mounted partitions - cannot be wiped |
200
+ | **Mnt** | Partition/disk is mounted, or in use via a swap/LUKS/LVM/RAID mapping - cannot be wiped |
194
201
  | **N%** | Wipe is in progress (shows percentage complete, 0-100%) |
195
202
  | **vN%** | Verification is in progress (shows percentage complete, v0-v100%) |
196
203
  | **STOP** | Wipe or verification is being stopped |
197
204
  | **s** | Wipe was stopped - device is partially wiped (can restart or verify) |
198
205
  | **W** | Wipe was completed successfully (can wipe again or verify) |
199
- | **Blk** | Disk is manually blocked - partitions are hidden and cannot be wiped |
206
+ | **Blk** | Device/disk is blocked (with **b**, or auto-blocked when it is a LUKS/LVM/RAID/swap container) - cannot be wiped |
200
207
  | **Unbl** | Disk was just unblocked (transitory state) |
201
208
 
209
+ ### Mounts / Status Column
210
+
211
+ The **MOUNTS/STATUS** column shows how a device is currently in use:
212
+
213
+ | Display | Meaning |
214
+ |---------|---------|
215
+ | **/**, **/data** | A real mount point (mounted directly, or through a LUKS/LVM/RAID mapping) |
216
+ | **\busy** | In use but not mounted — e.g. an *open* LUKS container, an active LVM volume group, a running RAID array, or active swap |
217
+
218
+ Both are treated as mounted: the device is dimmed and **w** (wipe) is not offered. `\busy` uses a backslash (not `/`) to make clear it is not a real mount point, yet it is treated like one for safety. To wipe such a device, first release the layer holding it (see [Wipe issues](#wipe-issues)).
219
+
220
+ > **Note:** A device held by a lower layer (dm-crypt/LUKS, LVM, md/RAID, swap) is protected even when it is not itself mounted. Wiping the backing device while a mapping is active would corrupt the container, so `dwipe` treats it as mounted. Mount points reached through a mapping are attributed back to the underlying device, so a LUKS partition shows the mount of its unlocked mapping.
221
+
222
+ ### Auto-Blocking Containers
223
+
224
+ `dwipe` auto-blocks devices that hold encrypted or stacked containers **the first time they are seen**, whether or not they are currently in use. This guards data that is otherwise easy to wipe by accident, since a *closed* container shows almost no hint beyond its type:
225
+
226
+ - `crypto_LUKS` (dm-crypt/LUKS)
227
+ - `LVM2_member` (LVM physical volume)
228
+ - `linux_raid_member` / `isw_raid_member` / `ddf_raid_member` (RAID members)
229
+ - `swap`
230
+
231
+ Such a device shows state **Blk** with an `auto-blocked` status, and its whole disk is protected too (inherited block). To wipe it, press **b** to unblock — the unblock is remembered, so it is not re-blocked on later scans.
232
+
233
+ Auto-blocking is on by default. Disable it for bulk re-provisioning with `--auto-block-containers off` (saved as a preference).
234
+
202
235
  ### Available Actions
203
236
 
204
237
  The top line shows available actions. Some are context-sensitive (only available for certain devices):
@@ -464,9 +497,14 @@ Press **ESC** from the main screen to clear the filter and return to showing all
464
497
  - **Colors don't work** - Ensure your terminal supports colors (most modern terminals do)
465
498
 
466
499
  ### Wipe issues
467
- - **Can't wipe a device** - Check the STATE column:
500
+ - **Can't wipe a device** - Check the STATE and MOUNTS/STATUS columns:
468
501
  - **Mnt** - Unmount the partition first: `sudo umount /dev/sdXN`
469
- - **Blk** - Press **b** to unblock
502
+ - **`\busy`** status, or **Mnt** caused by a lower layer - release the mapping/volume first, then rescan (**r**):
503
+ - LUKS: unmount, then `sudo cryptsetup close <name>`
504
+ - LVM: `sudo vgchange -an <vg>` (deactivate the volume group)
505
+ - RAID: `sudo mdadm --stop /dev/mdX`
506
+ - Swap: `sudo swapoff /dev/...`
507
+ - **Blk** - Press **b** to unblock (containers such as LUKS/LVM/RAID/swap are auto-blocked until you do)
470
508
  - **Busy** - Another partition on the disk is being wiped
471
509
  - **Wipe is very slow** - Normal for large drives; check write rate to verify progress
472
510
  - **Wipe seems stuck** - Most likely due to bad disks; Direct I/O makes progress almost constant on good disks.
@@ -477,11 +515,10 @@ Press **ESC** from the main screen to clear the filter and return to showing all
477
515
  Firmware wipes (SATA/NVMe secure erase operations) have different characteristics than software wipes:
478
516
 
479
517
  **Frozen Drives:**
480
- - Firmware wipes sometimes report the drive as "Frozen" if the device is present (mounted or in use) when capabilities are detected
518
+ - SATA drives are typically frozen by the BIOS/UEFI during POST as a security measure
481
519
  - 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
520
+ - **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.
521
+ - If the drive remains frozen after suspend/resume, try a full power-off (10+ minutes to drain drive capacitors) followed by boot and rescan
485
522
 
486
523
  **Device Quirks and Compatibility:**
487
524
  - Storage devices have various firmware implementations and hardware quirks that affect secure erase operations
@@ -1,7 +1,7 @@
1
1
  # dwipe
2
2
  `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.
3
3
 
4
- ![Demo of dwipe](https://raw.githubusercontent.com/joedefen/dwipe/master/images/dwipe-2025-12-31-09-37.gif)
4
+ ![Demo of dwipe](https://raw.githubusercontent.com/joedefen/dwipe/master/images/dwipe-2026-02-05.07-58.gif)
5
5
  ### Quick Comparison
6
6
 
7
7
  | Feature | dwipe | nwipe | shred | dd |
@@ -15,7 +15,7 @@
15
15
  | Device/partition blocking | ✓ | ✗ | ✗ | ✗ |
16
16
  | Resume interrupted software wipes | ✓ | ✗ | ✗ | ✗ |
17
17
  | Wipe operation logging | ✓ | ✗ | ✗ | ✗ |
18
- | Mount detection/prevention | ✓ | ✓ | ✗ | ✗ |
18
+ | Mount & LUKS/LVM/RAID/swap detection | ✓ | ✓ | ✗ | ✗ |
19
19
  | Fast Statistical sampling verification | ✓ | ✗ | ✗ | ✗ |
20
20
  | Certified destruction (DoD/Gutmann standards, full verification, certificates) | ✗ | ✓ | ✗ | ✗ |
21
21
 
@@ -30,7 +30,7 @@
30
30
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once with individual progress tracking and completion states
31
31
  * **Persistent state tracking** - Wipe status survives reboots; partially wiped and completed states persist on the device (can resume wipes across power cycles)
32
32
  * **Smart device identification** - Uses UUID/PARTUUID/serial numbers for stable device tracking across reconnections
33
- * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports device blocking, inline confirmation prompts
33
+ * **Safety protections** - Prevents wiping mounted or in-use devices (including LUKS/LVM/RAID containers and swap), detects overlapping wipes, supports device blocking, inline confirmation prompts
34
34
  * **Intelligent verification with statistical sampling** - Fast verification that covers entire disk even at low percentages (1% verification samples from all 100 disk sections)
35
35
  * **Direct I/O to disk** - Fast and efficient wiping that avoids page cache pollution with automatic slowdown/stall detection and graceful abort
36
36
  * **Multiple color themes** - Terminal color themes designed for readability with context-sensitive visual feedback (mounted devices dimmed, active wipes bright)
@@ -65,7 +65,7 @@
65
65
  1. **Drives and the OS often lie about drive type.** Outwit them both:
66
66
  * For spinning HDDs, **always** use `Rand` or `Zero` (interruptible, shows progress).
67
67
  * For SSDs, **always** use firmware wipes if available (faster, reaches hidden blocks).
68
- 1. **If a drive is 'Frozen'**, press `DEL` to detach it and, when gone, press `r` to rescan; it should come back unfrozen.
68
+ 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.
69
69
  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.
70
70
  1. **Hot-swap workflow for SATA drives**: `DEL` to detach, physically swap drives, then `r` to rescan (if needed).
71
71
 
@@ -75,7 +75,7 @@
75
75
  `dwipe` provides comprehensive disk wiping capabilities with safety features:
76
76
 
77
77
  * **Smart device display** - Shows disks and partitions with labels, sizes, types, and vendor/model information to help identify devices correctly
78
- * **Safety protections** - Prevents wiping mounted devices, detects overlapping wipes, supports manual disk blocking
78
+ * **Safety protections** - Prevents wiping mounted or in-use devices (including LUKS/LVM/RAID containers and swap), detects overlapping wipes, supports manual disk blocking
79
79
  * **Hot-swap detection** - Updates the device list when storage changes; newly added devices are marked with **^** to make them easy to spot
80
80
  * **Multiple simultaneous wipes** - Start wipes on multiple devices at once, with individual progress tracking and completion states
81
81
  * **Flexible wipe modes** - Choose between Rand, Zero, Rand+V (with auto-verify), or Zero+V (with auto-verify)
@@ -125,6 +125,10 @@ Simply run `dwipe` from the command line without arguments: `dwipe`
125
125
  - `--firmware-wipes` or `-F` - Enable firmware wipes
126
126
  - Enables hardware-based secure erase operations (NVMe Sanitize/Format, SATA ATA Security Erase)
127
127
  - Without this flag, only software wipes (Zero/Rand) are available
128
+ - `--auto-block-containers {on,off}` - Auto-block encrypted/stacked containers on first sight (default: on)
129
+ - Blocks devices whose filesystem is a container (LUKS, LVM, RAID member, swap) the first time they are seen, so wiping requires an explicit unblock (**b**)
130
+ - The block is remembered per device; once you unblock, it stays unblocked
131
+ - Set to `off` when re-provisioning many encrypted disks to avoid unblocking each one
128
132
  - `--dump-lsblk` - Dump parsed device information and exit (for debugging)
129
133
  - `--help` - Show help message with all available options
130
134
 
@@ -132,7 +136,7 @@ Simply run `dwipe` from the command line without arguments: `dwipe`
132
136
 
133
137
  `dwipe` uses color coding to provide instant visual feedback about device and operation status:
134
138
 
135
- - **Dimmed (gray)** - Mounted or blocked devices (cannot be wiped)
139
+ - **Dimmed (gray)** - Mounted, in-use (LUKS/LVM/RAID/swap), or blocked devices (cannot be wiped)
136
140
  - **Default (white)** - Ready to wipe, idle state, or previously wiped (before this session)
137
141
  - **Bright cyan/blue + bold** - Active wipe or verification in progress (0-100% write, v0-v100% verify)
138
142
  - **Bold yellow** - Stopped or partially completed wipe
@@ -174,15 +178,41 @@ The **STATE** column shows the current status of each device:
174
178
  |-------|---------|
175
179
  | **-** | Device is ready for wiping |
176
180
  | **^** | Device is ready for wiping AND was added after `dwipe` started (hot-swapped) |
177
- | **Mnt** | Partition is mounted or disk has mounted partitions - cannot be wiped |
181
+ | **Mnt** | Partition/disk is mounted, or in use via a swap/LUKS/LVM/RAID mapping - cannot be wiped |
178
182
  | **N%** | Wipe is in progress (shows percentage complete, 0-100%) |
179
183
  | **vN%** | Verification is in progress (shows percentage complete, v0-v100%) |
180
184
  | **STOP** | Wipe or verification is being stopped |
181
185
  | **s** | Wipe was stopped - device is partially wiped (can restart or verify) |
182
186
  | **W** | Wipe was completed successfully (can wipe again or verify) |
183
- | **Blk** | Disk is manually blocked - partitions are hidden and cannot be wiped |
187
+ | **Blk** | Device/disk is blocked (with **b**, or auto-blocked when it is a LUKS/LVM/RAID/swap container) - cannot be wiped |
184
188
  | **Unbl** | Disk was just unblocked (transitory state) |
185
189
 
190
+ ### Mounts / Status Column
191
+
192
+ The **MOUNTS/STATUS** column shows how a device is currently in use:
193
+
194
+ | Display | Meaning |
195
+ |---------|---------|
196
+ | **/**, **/data** | A real mount point (mounted directly, or through a LUKS/LVM/RAID mapping) |
197
+ | **\busy** | In use but not mounted — e.g. an *open* LUKS container, an active LVM volume group, a running RAID array, or active swap |
198
+
199
+ Both are treated as mounted: the device is dimmed and **w** (wipe) is not offered. `\busy` uses a backslash (not `/`) to make clear it is not a real mount point, yet it is treated like one for safety. To wipe such a device, first release the layer holding it (see [Wipe issues](#wipe-issues)).
200
+
201
+ > **Note:** A device held by a lower layer (dm-crypt/LUKS, LVM, md/RAID, swap) is protected even when it is not itself mounted. Wiping the backing device while a mapping is active would corrupt the container, so `dwipe` treats it as mounted. Mount points reached through a mapping are attributed back to the underlying device, so a LUKS partition shows the mount of its unlocked mapping.
202
+
203
+ ### Auto-Blocking Containers
204
+
205
+ `dwipe` auto-blocks devices that hold encrypted or stacked containers **the first time they are seen**, whether or not they are currently in use. This guards data that is otherwise easy to wipe by accident, since a *closed* container shows almost no hint beyond its type:
206
+
207
+ - `crypto_LUKS` (dm-crypt/LUKS)
208
+ - `LVM2_member` (LVM physical volume)
209
+ - `linux_raid_member` / `isw_raid_member` / `ddf_raid_member` (RAID members)
210
+ - `swap`
211
+
212
+ Such a device shows state **Blk** with an `auto-blocked` status, and its whole disk is protected too (inherited block). To wipe it, press **b** to unblock — the unblock is remembered, so it is not re-blocked on later scans.
213
+
214
+ Auto-blocking is on by default. Disable it for bulk re-provisioning with `--auto-block-containers off` (saved as a preference).
215
+
186
216
  ### Available Actions
187
217
 
188
218
  The top line shows available actions. Some are context-sensitive (only available for certain devices):
@@ -448,9 +478,14 @@ Press **ESC** from the main screen to clear the filter and return to showing all
448
478
  - **Colors don't work** - Ensure your terminal supports colors (most modern terminals do)
449
479
 
450
480
  ### Wipe issues
451
- - **Can't wipe a device** - Check the STATE column:
481
+ - **Can't wipe a device** - Check the STATE and MOUNTS/STATUS columns:
452
482
  - **Mnt** - Unmount the partition first: `sudo umount /dev/sdXN`
453
- - **Blk** - Press **b** to unblock
483
+ - **`\busy`** status, or **Mnt** caused by a lower layer - release the mapping/volume first, then rescan (**r**):
484
+ - LUKS: unmount, then `sudo cryptsetup close <name>`
485
+ - LVM: `sudo vgchange -an <vg>` (deactivate the volume group)
486
+ - RAID: `sudo mdadm --stop /dev/mdX`
487
+ - Swap: `sudo swapoff /dev/...`
488
+ - **Blk** - Press **b** to unblock (containers such as LUKS/LVM/RAID/swap are auto-blocked until you do)
454
489
  - **Busy** - Another partition on the disk is being wiped
455
490
  - **Wipe is very slow** - Normal for large drives; check write rate to verify progress
456
491
  - **Wipe seems stuck** - Most likely due to bad disks; Direct I/O makes progress almost constant on good disks.
@@ -461,11 +496,10 @@ Press **ESC** from the main screen to clear the filter and return to showing all
461
496
  Firmware wipes (SATA/NVMe secure erase operations) have different characteristics than software wipes:
462
497
 
463
498
  **Frozen Drives:**
464
- - Firmware wipes sometimes report the drive as "Frozen" if the device is present (mounted or in use) when capabilities are detected
499
+ - SATA drives are typically frozen by the BIOS/UEFI during POST as a security measure
465
500
  - This is a drive-level security feature, not a `dwipe` limitation
466
- - **Solution**: Unmount the device, wait briefly (often just a few seconds of idle time is enough), then use **r** to rescan capabilities
467
- - The freeze state is usually temporary and clears after the device is no longer actively in use
468
- - If the drive remains frozen, try hot-swapping (remove and reinsert) or power-cycling the device
501
+ - **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.
502
+ - If the drive remains frozen after suspend/resume, try a full power-off (10+ minutes to drain drive capacitors) followed by boot and rescan
469
503
 
470
504
  **Device Quirks and Compatibility:**
471
505
  - Storage devices have various firmware implementations and hardware quirks that affect secure erase operations