nwipe - Man Page
securely erase disks
Synopsis
nwipe [options] [device1] [device2] ...
Description
nwipe is a command that will securely erase disks using a variety of recognized methods. It is a fork of the dwipe command used by Darik's Boot and Nuke (DBAN). nwipe is included with partedmagic if you want a quick and easy bootable CD version. nwipe was created out of a need to run the DBAN dwipe command outside of DBAN, in order to allow its use with any host distribution, thus giving better hardware support. It is essentially the same as dwipe, with a few changes:
- pthreads is used instead of fork.
- The parted library is used to detect drives.
- The code is designed to be compiled with gcc.
- SIGUSR1 can be used to log the stats of the current wipe.
- Additional wiping methods and PRNGs.
- Configurable I/O modes (cached, direct, auto) using large I/O buffers for higher throughput.
- Support for stable device paths such as /dev/disk/by-id/.
All PRNG implementations are seeded using the Linux getrandom(2) system call instead of reading from /dev/urandom via a file descriptor.
Devices
Devices can be specified either as block device nodes (for example /dev/sda, /dev/nvme0n1, /dev/mapper/cryptroot) or via stable symlinks under /dev/disk/by-id/. nwipe will resolve these paths and operate on the underlying block device.
Options
- -V, --version
Prints the version number.
- -h, --help
Prints a help summary.
- --autonuke
If no devices have been specified on the command line, starts wiping all devices immediately. If devices have been specified, starts wiping only those specified devices immediately.
- --autopoweroff
Power off system on completion of wipe delayed for one minute. During this one minute delay you can abort the shutdown by typing sudo shutdown -c
- --sync=NUM
Specify how often nwipe performs an fdatasync() during cached I/O mode. The value refers to the number of *device hardware blocks* (commonly 512 or 4096 bytes) written before triggering a sync. Since nwipe now writes using large multi-megabyte buffers, this value is automatically scaled so the sync interval in bytes is consistent with historic behaviour.
The default value (100000) results in a sync approximately every 50–400 MB, similar to earlier nwipe releases. This ensures timely detection of I/O errors while maintaining good throughput.
This setting has no effect when using --directio, as write() returns errors immediately under direct I/O.
0 - Perform one sync only at the end of the pass.
Not advised; errors may only be detected after the entire wipe.1 - Sync immediately after each write.
Extremely safe but extremely slow.1000 - Sync after the equivalent of 1000 hardware blocks.
Useful for testing or more aggressive error detection.- --cachedio
Use buffered I/O with large write buffers (page cache enabled). This is the default on most systems and generally gives the best performance for rotational disks.
- --directio
Use direct I/O with large write buffers. This opens devices with O_DIRECT to bypass the page cache. It can be useful when running multiple wipes in parallel or when you do not want to pollute the system page cache. On some devices this may be slower than cached I/O.
- --io-mode=MODE
Select the I/O mode explicitly. MODE can be:
auto - (default) automatically choose the best supported mode for
the device and kernel.cached - force buffered I/O.
direct - force direct I/O (O_DIRECT).
Large I/O buffers are used in all modes to maximise throughput.
- --noblank
Do not perform the final blanking pass after the wipe (default is to blank, except when the method is RCMP TSSIT OPS-II).
- --nowait
Do not wait for a key before exiting (default is to wait).
- --nosignals
Do not allow signals to interrupt a wipe (default is to allow).
- --nousb
Do not show or wipe any USB devices, whether in GUI, --nogui or autonuke mode. (default is to allow USB devices to be shown and wiped).
- --nogui
Do not show the GUI interface. Can only be used with the autonuke option. Nowait option is automatically invoked with the nogui option. SIGUSR1 can be used to retrieve the current wiping statistics.
- --pdftag
Enables a field on the PDF that holds a tag that identifies the host computer
- -v, --verbose
Log more messages, useful for debugging.
- --verify=TYPE
Whether to perform verification of erasure (default: last).
off - Do not verify.
last - Verify after the last pass.
all - Verify every pass.
Please mind that HMG IS5 enhanced always verifies the last (PRNG) pass regardless of this option.
- -m, --method=METHOD
The wiping method (default: prng).
dod522022m / dod - 7 pass DOD 5220.22-M method
dodshort / dod3pass - 3 pass DOD method
gutmann - Peter Gutmann's algorithm
ops2 - RCMP TSSIT OPS-II
random / prng / stream - PRNG Stream
zero / quick - Overwrite with zeros (0x00)
one - Overwrite with ones (0xFF)
verify_zero - Verifies disk is zero (0x00) filled
verify_one - Verifies disk is one (0xFF) filled
is5enh - HMG IS5 enhanced
bruce7 - Schneier Bruce 7-pass mixed pattern
bmb - Chinese BMB21-2019 State Secrets Bureau standard.
This method overwrites the device with ones (0xFF),
then zeros (0x00), followed by three passes of PRNG-
generated random data, and finishes with a final pass
of ones (0xFF). Designed to meet the BMB21-2019
technical sanitization requirements.- -l, --logfile=FILE
Filename to log to. Default is STDOUT.
- -P, --PDFreportpath=DIR
Directory to write the PDF nwipe reports/certificates to. Defaults to ".". If DIR is set to noPDF no report PDF files are written.
- -p, --prng=METHOD
The PRNG option (default: aes_ctr_prng). (mersenne|twister|isaac|isaac64|add_lagg_fibonacci_prng|xoroshiro256_prng|aes_ctr_prng)
aes_ctr_prng uses the Linux kernel AF_ALG interface to AES-CTR as a cryptographically strong stream generator. It is seeded via getrandom(2) and requires kernel crypto support for AES-CTR.
- -q, --quiet
Anonymize serial numbers, GUI & logs display:
XXXXXXXX = S/N obtained & anonymized.
???????? = S/N not available.- -r, --rounds=NUM
Number of times to wipe the device using the selected method (default: 1).
- -e, --exclude=DEVICES
Up to ten comma separated devices to be excluded, examples:
--exclude=/dev/sdc
--exclude=/dev/sdc,/dev/sdd
--exclude=/dev/sdc,/dev/sdd,/dev/mapper/cryptswap1
--dev/disk/by-path/pci-0000:00:17.0-ata-1
Bugs
Please see the GitHub site for the latest list: (https://github.com/martijnvanbrummelen/nwipe/issues)
Author
nwipe is developed by Martijn van Brummelen <github@brumit.nl>.