wipefreespace(1)
| wipefreespace(1) | General Commands Manual | wipefreespace(1) |
NAME
wipefreespace - Secure cleaning of free space on filesystems.
SYNOPSIS
wipefreespace [options] /dev/XY ...
DESCRIPTION
The wipefreespace program securely cleans the free space and undelete data on the given ext2/3/4, NTFS, XFS, ReiserFSv3/4, FAT12/16/32, MinixFSv1/2, JFS, HFS+ and OCFS file systems. Write permissions are required for the devices (or regular files containing the file system), but the program MUST NOT be setuid(root).
Each given filesystem is wiped ONLY ONCE, no matter how many times it appears on the command line. WipeFreeSpace also works for file systems created inside regular files on any host file system.
Wipefreespace wipes the following things (when supported by the
backing
library):
- -
-
free space (space in unused blocks/clusters) - -
-
free space in partially used blocks (also called the "slack space") - -
-
deleted files' names and other data that can be used to undelete a file (like the journal)
Wipefreespace does NOT decrease the amount of available free space
when
working.
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:
#!/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)
OPTIONS
Any option affects all filesystems given on the command line, not just the ones following it.
- --all-zeros
- Use only zeros for wiping.
- --background
- Continue work in the background, if possible. This disables verose 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
- Print license information
- -n|--iterations NNN
- Number of passes (greater than 0)
- --method NAME
- Use the given method for wiping (read below).
- --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
- --use-ioctl
- Disable device caching during work (can be DANGEROUS)
- -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
WIPING METHODS
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
DIAGNOSTICS
The program returns with 0 exit code if everything went fine. If there were errors, the program exits with non-zero exit code:
- 1:
- Only version number, help or licence information was requested and printed, no action.
- -1:
- Bad/missing command line syntax.
- -2:
- Unable to check if the file system is mounted. Cannot continue.
- -3:
- The file system was mounted in read-write mode. Cannot continue.
- -4:
- Unable to open the file system.
- -5:
- Unable to read block bitmap from the file system (thus, unable to determine, which blocks are unused).
- -6:
- Memory allocation failed.
- -7:
- The file system contained errors and the option --force was not given.
- -8:
- Closing the file system failed.
- -9:
- Opening i-node scan failed. Thus, the program was unable to wipe free space in partially used blocks.
- -10:
- Iterating over blocks failed. Thus, the program was unable to wipe free space in partially used blocks.
- -11:
- I-node read failed. Some undelete data may not have been removed.
- -12:
- Directory iterating failed. Thus, the program was unable to remove some of (maybe all) undelete data.
- -13:
- The program found out that it has the suid permission bit set and the owner is root. Read the first chapter of the info documentation for an explanation and a solution.
- -14:
- Flushing the changes to the filesystem failed.
- -15:
- Block writing failed.
- -16:
- Failed to open an attribute (mostly on NTFS).
- -17:
- Failed runlist on NTFS.
- -18:
- Getting name failed.
- -19:
- Context error (NTFS).
- -20:
- Bad parameter was passed to one of the functions.
- -21:
- Pipe error (mostly XFS).
- -22:
- Fork error (XFS or ReiserFSv3).
- -23:
- Exec error (XFS).
- -24:
- Seek error (mostly ReiserFSv4).
- -25:
- Block reading failed.
- -100:
- A signal was caught and the program was forced to exit.
NOTES
The error code is reset after each file system. If the last file system was wiped successfully, but the previous weren't, their errors are currently lost.
It is best to use this program on un-mounted file systems, which makes sure the journal is committed.
AUTHOR
Bogdan 'bogdro' Drozdowski, bogdandr /AT/ op . pl
bogdro /AT/ rudy . mif . pg . gda . pl
[EN] http://wipefreespace.sf.net
[PL] http://wipefreespace.sf.net/index-pl.php
[EN] http://rudy.mif.pg.gda.pl/~bogdro/soft/
[EN] http://rudy.mif.pg.gda.pl/~bogdro/inne/
[PL] http://rudy.mif.pg.gda.pl/~bogdro/
THANKS
Theodore Ts'o, for the great ext2fs library and e2fsprogs.
The linux-ntfs team for their research on NTFS and a great programming library.
Colin Plumb, for the great 'shred' program, parts of which are used here.
Patrick R. McDonald 'marlowe' (www.antagonism.org) - for bug reports, testing and promoting wipefreespace.
Mark Lord (mlord@pobox.com) for the gread hdparm utility.
knightray@gmail.com for The Tiny FAT FS library (on LGPL).
SEE ALSO
shred(1), info libsecrm
The 'info' documentation is more descriptive and is the main one. Type
info wipefreespace
to read it.
| Linux | User's Manual |
