-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
439 lines (335 loc) · 18 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
This is the README file for WipeFreeSpace, a program for secure wiping
of free space on file systems.
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.
NOTE: it is best to use this program on un-mounted file systems, what
makes sure the journal is committed.
NOTE: if a block is damaged, it is only wiped until the first error. There is
no guarantee that it will be fully wiped.
Read the info documentation (type 'info doc/wipefreespace.info') to get more
information.
Project homepage: https://wipefreespace.sourceforge.io/.
Author: Bogdan Drozdowski, bogdro (at) users . sourceforge . net
License: GPLv2+
================================================================
The binary version of WipeFreeSpace is linked with the GNU C Library,
licensed under the GNU LGPL:
Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,2001,2002,2003,2004,2005,
2006,2007 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU C Library; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
================================================================
Requirements for compiling the full version:
- a working C compiler. XFS, ReiserFS, Reiser4 and NTFS support require the
'long long' data type. NTFS support may require the gcc compiler.
C++ compilers won't work due to variable casts.
- development package for the C library (like glibc-devel and glibc-headers)
XFS support requires the following headers: unistd.h, fcntl.h, mntent.h
(but sys/wait.h, sched.h and paths.h can be useful, too) and the following
functions: fork(), execvp(), dup2(), close(), pipe(), kill() and
waitpid() or wait() (sleep() can be useful, too).
- the 'make' program
- Ext2/3/4: the development package for the ext2 file system library, libext2fs
(usually included in something like e2fsprogs-devel). If you don't have
anything like this installed or available (check twice), then go to
http://e2fsprogs.sf.net/
Then compile and install that package. Ext4 support requires new enough
versions, like 1.41.
- NTFS: the development package for the NTFS file system library,
ntfs3g-ntfsprogs. If you don't have anything like this installed or
available (check twice), then go to
http://www.tuxera.com/community/ntfs-3g-download/
Then compile and install that package. You can also use libntfs (usually
included in something like ntfsprogs-devel).
- XFS: xfsprogs installed and in your PATH variable.
Get these at https://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/. The
following utilities should be available: xfs_db, xfs_freeze, xfs_unfreeze.
The xfs_db program should support the following command-line options: "-i",
"-c" and the following interactive mode commands: "quit", "freesp -d",
"blockget -n", "ncheck", "sb 0", "print". Version 2.7.11 is enough, earlier
versions will probably also work.
- ReiserFSv3: development package for reiserfsprogs (header files - *.h - and
compiled static libraries - *.a - from the package). ReiserFS requires either
the fork() function (unistd.h) and one of the waitpid(), wait() functions
(sys/wait.h), the mntent.h header file (with at least one of its functions
- getmntent() or getmntent_r()).
If you're having trouble compiling, try to apply the patch first:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/reiser-3.6.XX-compile-fix.diff
See below for other patches that may be necessary.
- Reiser4: development package for reiser4progs, libuuid (e2fsprogs or
e2fsprogs-libs), libaal and the mntent.h header file. Go to
http://www.kernel.org/pub/linux/utils/fs/reiser4/
and
http://e2fsprogs.sf.net/
to get the libraries. After installing, libmisc.a needs to be copied
in the same place as libreiser4.a, but under a different name,
libreiser4misc.a:
cp reiser4progs-XX/libmisc/.libs/libmisc.a /dst/path/libreiser4misc.a
Libmisc.a is in reiser4progs, of course. Nobody thought it would be
needed, but libreiser4.a is useless without it.
- FAT12/16/32: tffs-lib, the Tiny FAT FS library. Go to
https://github.com/likema/tffs-lib
to get the library (former address: http://code.google.com/p/tffs-lib/).
To make WipeFreeSpace work faster, apply the patch that removes synchronising
the filesystem from TFFS (WipeFreeSpace does its own synchronising):
patch -F10 -p0 < /path/to/wipefreespace-XX/patches/tffs-speed.diff
If you experience crashes (especially on x64), you may try to apply three
more patches:
patch -F10 -p0 < /path/to/wipefreespace-XX/patches/tffs-free-fix.diff
patch -F10 -p0 < /path/to/wipefreespace-XX/patches/tffs-overflow-fix.diff
patch -F10 -p0 < /path/to/wipefreespace-XX/patches/tffs-fat-eof-fix.diff
patch -F10 -p0 < /path/to/wipefreespace-XX/patches/tffs-dir-fix.diff
After applying any patch, you need to recompile and install the library -
libtffs.a - and ALL its header files - *.h - (including the private ones,
from the src directory).
- MinixFS: "mfstool", the MinixFS tool. Go to
http://mfstool.sourceforge.net/
to get this program. Before compiling, perform:
sed -i 's/opt_squash/0/g' `ls *.c | egrep -v main`
then compile the program (./configure && make), then perform
ar surf libminixfs.a `ls *.o | egrep -v main`
Then copy the files libminixfs.a, minix_fs.h and protos.h to a directory
where the C compiler can find them (or put the correct -I and -L options
in the compiler flags). You can use the provided patches to do this
instead of the sed command:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/mfstool-0.5.diff
- JFS: jfsutils and libuuid (the <uuid/uuid.h> header file). Go to
http://jfs.sourceforge.net/
to get jfsutils. Libuuid can be a part of "util-linux-ng", which can be
found on the kernel site:
http://kernel.org/pub/linux/utils/util-linux/
or as a part of e2fsprogs available at
http://e2fsprogs.sf.net/
Compile jfsutils, then copy all the jfs_*.h header files from the
"include" subdirectory and the libfs.a file to a directory where the
C compiler can find them (or put the correct -I and -L options in the
compiler flags).
If you're having trouble compiling, try to apply the patch first:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/jfsutils-1.1.11-compile-fix.diff
- HFS+: the "hfsplus" package. Go to
https://launchpad.net/ubuntu/+archive/primary/+files/hfsplus_1.0.4.orig.tar.gz
to get it. Before compiling, apply the patch:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/hfsplus-1.0.4.diff
After compiling, install all the libraries - *.a - and ALL the header
files - *.h - from the libhfsp/src/ directory where the C compiler can
find them (or put the correct -I and -L options in the compiler flags).
- OCFS: the "ocfs2-tools" series 1.6.x package (other versions also work, but
disable wiping undelete data in such case). Go to
http://oss.oracle.com/projects/ocfs2-tools/
to get it. Then compile and install that package.
If you're having trouble compiling, try to apply the patch first:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/ocfs2-tools-1.6.4-compile-fix.diff
WARNING: If both ReiserFSv3 and ReiserFSv4 are enabled, the program may
refuse to link if the compiler doesn't support the command line option
"-Wl,-z -Wl,muldefs" that makes the linker accept multiple symbol
definitions. If you have this problem, disable the support for either
of these filesystems (you can compile two versions of the program).
Don't complain to me, complain to the guys that made reiserfsprogs and
reiser4progs. You can fix either of these libraries yourself, by running
find . -type f -exec sed -i 's/misc_mntent/new_misc_mntent/g' '{}' \;
in the root directory of either reiserfsprogs or reiser4progs (but
NOT both, because this would bring back the same problem, but with a
different name). Type the command as above. The command must be run
BEFORE compiling the reiserfs programs. You can use the provided patches
to do this:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/reiser-3.6.XX.diff
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/reiser4-1.0.7.diff
WARNING: If both ReiserFSv3 and MinixFS are enabled, the program
may refuse to link if the compiler doesn't support the command line option
"-Wl,-z -Wl,muldefs" that makes the linker accept multiple symbol
definitions. If you have this problem, disable the support for either
of these filesystems (you can compile two versions of the program).
You can fix either of these libraries yourself, by running
find . -type f -exec sed -i 's/die/new_die/g' '{}' \;
in the root directory of either reiserfsprogs or mfstool (but
NOT both, because this would bring back the same problem, but with a
different name). Type the command as above. The command must be run
BEFORE compiling reiserfs/mfstool. You can use the provided patches
to do this:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/mfstool-0.5.diff
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/reiser-3.6.XX.diff
WARNING: If both ReiserFSv3 and JFS are enabled, you MUST either disable
the support for either of these filesystems (you can compile two
versions of the program) or fix either of these libraries yourself,
by running
find . -type f -exec sed -i 's/bread/new_bread/g' '{}' \;
in the root directory of either reiserfsprogs or jfsutils (but
NOT both, because this would bring back the same problem, but with a
different name). Type the command as above. The command must be run
BEFORE compiling reiserfs/jfsutils. You can use the provided patches
to do this:
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/jfsutils-1.1.11.diff
patch -F10 -p1 < /path/to/wipefreespace-XX/patches/reiser-3.6.XX.diff
Even if your linker/compiler accepts the "-Wl,-z -Wl,muldefs" option, it
won't help in this case.
The patches for ntfsprogs are optional. Whether or not they will be included
in the official release of ntfsprogs, WipeFreeSpace still will compile.
Type
./configure
to configure the program for your system.
If you do not wish support for a filesystem, give the '--enable-FS=no'
option to ./configure (FS=EXT234, NTFS, XFS, REISERFS, REISER4, FAT,
MINIX, JFS, HFSP, OCFS).
If you do not wish support for a particular wiping operation, give the
'--enable-OPER=no' option to ./configure (OPER=wfs, unrm, part - these
are wiping free space, undelete data and partially-used blocks,
respectively). You cannot disable all of these.
Run './configure --help' for details.
If you do NOT wish WipeFreeSpace to use the network or get the computer's IP
address, get LibHideIP>=0.2 and LibNetBlock and configure WipeFreeSpace with
./configure --enable-LIBHIDEIP --enable-LIBNETBLOCK
NOTE: this may cause network filesystem wiping to fail.
Type
make
to compile the program.
Documentation will be compiled, if you have the 'makeinfo' program
('texinfo' package).
Translations will be compiled, if you have the 'gettext' package.
NOTE: if you have trouble compiling, send me some of the first error messages
in each file and the config.h file generated by the 'configure' script.
Type
make install
to install the program (NOT recommended) or read below on how to make an
RPM package (recommended).
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 <off> 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)
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 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 pass 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 the block-order
method with more than one pass. It is more secure to use pattern-order,
where you can have more than one iteration and still good performance.
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:
#!/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)
=======================================================
Building an RPM package:
1) copy the wipefreespace.spec file to $HOME/rpmbuild/SPECS
2) copy the source package wipefreespace-XX.tar.gz to $HOME/rpmbuild/SOURCES
3) type
rpmbuild -ba $HOME/rpmbuild/SPECS/wipefreespace.spec
4) get the RPMs from $HOME/rpmbuild/RPMS/<arch> and $HOME/rpmbuild/SRPMS
Building an RPM package (the old way):
1) copy the wipefreespace.spec file to /usr/src/redhat/SPECS
2) copy the source package wipefreespace-XX.tar.gz to /usr/src/redhat/SOURCES
3) type
rpmbuild -ba /usr/src/redhat/SPECS/wipefreespace.spec
4) get the RPMs from /usr/src/redhat/RPMS/<arch> and /usr/src/redhat/SRPMS
NOTE: some systems may use other directories than these.
=======================================================
Translating the docs to your language:
Type `msginit -i wipefreespace.pot -o XX.po', substituting your
2-letter language code for 'XX' (e.g. 'pl' or 'de'). This requires the
'gettext' package installed. You can manually copy the file
wipefreespace.pot to XX.po and manually add the following header, if
you wish.
In the resulting XX.po file you have to fill in all the fields
marked with capital letters in the header:
# YOUR LANGUAGE translations for WipeFreeSpace package.
# Copyright (C) 2007-2024 Bogdan 'bogdro' Drozdowski
# This file is distributed under the same license as
# the WipeFreeSpace package.
# YOUR FULL NAME <EMAILADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: WipeFreeSpace VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-03 15:28+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAILADDRESS>\n"
"Language-Team: LANGUAGE <EMAILADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
The rest of the file will contain messages from the program. Translate
them all and send me the resulting XX.po file.
Translating the documentation:
- info: simply change the wipefreespace.texi file
- man: Unpack the page using 'gunzip wipefreespace.1.gz' and
translate the resulting wipefreespace.1 file.