Menu

Command-line usage

Bogdan Drozdowski

Type 'info wipefreespace' to get help.

Syntax:

wipefreespace [options] /dev/XY [...]

Command line options:
--all-zeros

Use only zeros for wiping

--background

Continue work in the background, if possible. This disables verbose mode.

-b|--superblock offset

Superblock offset on the given filesystems

-B|--blocksize size

Block size on the given filesystems

-f|--force

Wipe even if the file system has errors

-h|--help

Print help

--last-zero

Perform additional wiping with zeros

-l|--license|--licence

Print license information

--method name

Use the given method for wiping (read below)

-n|--iterations NNN

Number of passes (greater than 0)

--nopart

Do NOT wipe free space in partially used blocks

--nounrm

Do NOT wipe undelete information

--nowfs

Do NOT wipe free space on file system

--no-wipe-zero-blocks

Do NOT wipe all-zero blocks on file system (useful for virtual/sparse devices, where empty areas are read as all-zeros and do not take physical space unless actually written to)

--order type

Use the given order for wiping (read below)

--use-dedicated

Use the program dedicated for the given filesystem type if supported. Fallback to WipeFreeSpace if unsupported (currently, only 'ntfswipe' is supported)

--use-ioctl

Disable device caching during work (can be DANGEROUS). NOTE: this may not work for sub-partitions on drives. To disable the cache, run the 'hdparm' utility with the correct options to disable the cache before running wipefreespace and enable the cache afterwards.

-v|--verbose

Verbose output. Use twice for more. This also enables progress bars, but be warned: these may not always be accurate or increase at a constant rate.

-V|--version

Print version number

The /dev/XY part stands for a device with a supported file system. Examples: /dev/hda1, /dev/fd0.
More than one device can be given on the command line, but they will be wiped sequentially, NOT in multiple threads. WipeFreeSpace is not multithreaded and probably won't be, because the libraries used can be not thread-safe.
But, you can run multiple WipeFreeSpace processes (but not wiping the same filesystem) in multiple terminals (or under screen/nohup) as a substitute for multi-threading.

The following method names (case-insensitive) are available:

  • Gutmann (method similar to Gutmann's, the default, 36 passes)
  • random (shred-like, 25 passes)
  • Schneier (Shneier's method, 7 passes, contains ITSG-06)
  • DoD (DoD, 3 passes, contains NAVSO P-5239-26 and German Federal Office for Information Security)

WipeFreeSpace also works for file systems created inside regular files on any host file system.

WipeFreeSpace supports two wiping orders:

  • block - wipe block by block with all patterns and flush the overwriting data to disk after each pattern (so, each block waits to be wiped until the previous one is done),
  • pattern - wipe the whole filesystem with each pattern (all blocks with the first pattern, then all blocks with the second pattern, and so on), and flushing the overwriting data to disk after each pattern. This is the default.

NOTE: wiping with just one pattern at a time (-n 1) will NOT perform wiping with all patterns of the given method one by one, it will always use the first pattern. However, it will be MUCH faster than any "full" method.

If you need just random wiping, run

wipefreespace -n 1 /dev/XY

a few times in a row.

Any option affects all filesystems given on the command line, not just the ones following it.

To perform a command after wiping (like sending e-mail), simply run a program after WipeFreeSpace is finished, for example:

wipefreespace [options] /dev/XY; mail [options]

or in a script:

1
2
3
#!/bin/bash
wipefreespace [options] /dev/XY
mail [options]

To run WipeFreeSpace with a higher or lower priority, simply use the renice utility, for example:

renice +1 $(pidof wipefreespace)

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.