aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/zerofree/zerofree.892
-rw-r--r--system/zerofree/zerofree.SlackBuild11
-rw-r--r--system/zerofree/zerofree.info10
3 files changed, 108 insertions, 5 deletions
diff --git a/system/zerofree/zerofree.8 b/system/zerofree/zerofree.8
new file mode 100644
index 0000000000000..fb6f277e7bd50
--- /dev/null
+++ b/system/zerofree/zerofree.8
@@ -0,0 +1,92 @@
+.TH "ZEROFREE" "8"
+.SH "NAME"
+zerofree \(em zero free blocks from ext2, ext3 and ext4 file-systems
+.SH "SYNOPSIS"
+.PP
+\fBzerofree\fR [\fB-n\fP] [\fB-v\fP] [\fB-f fillval\fP] \fIfilesystem\fR
+.SH "DESCRIPTION"
+.PP
+\fBzerofree\fR finds the unallocated,
+blocks with non-zero value content in an ext2, ext3 or ext4
+\fIfilesystem\fR (e.g. /dev/hda1) and
+fills them with zeroes (or another octet of your choice).
+
+
+.PP
+Filling unused areas with zeroes is useful if the device on
+which this file-system resides is a disk image. In this case,
+depending on the type of disk image, a secondary utility may be
+able to reduce the size of the disk image after zerofree has
+been run.
+
+.PP
+Filling unused areas may also be useful with solid-state
+drives (SSDs). On some SSDs, filling blocks with ones (0xFF)
+is reported to trigger Flash block erasure by the firmware,
+possibly giving a write performance increase.
+
+.PP
+The usual way to achieve the same result (zeroing the
+unallocated blocks) is to run \fBdd\fR (1) to
+create a file full of zeroes that takes up the entire free
+space on the drive, and then delete this file. This has many
+disadvantages, which zerofree alleviates:
+.IP " \(bu" 6
+it is slow;
+.IP " \(bu" 6
+it makes the disk image (temporarily) grow to its maximal
+extent;
+.IP " \(bu" 6
+it (temporarily) uses all free space on the disk, so other
+concurrent write actions may fail.
+
+.PP
+\fIfilesystem\fR has to be unmounted or
+mounted read-only for \fBzerofree\fR to work. It
+will exit with an error message if the
+\fIfilesystem\fR is mounted writable. To
+remount the root file-system readonly, you can first switch to
+single user runlevel (\fBtelinit 1\fR) then use
+\fBmount \-o remount,ro
+\fIfilesystem\fR\fR.
+
+.PP
+\fBzerofree\fR has been written to be run
+from GNU/Linux systems installed as guest OSes inside a virtual
+machine. In this case, it is typically run from within the guest
+system, and a utility is then run from the host system to shrink
+disk image (\fBVBoxManage modifyhd \-\-compact\fR,
+provided with virtualbox, is able to do that for some disk image
+formats).
+
+.PP
+It may however be useful in other situations: for instance
+it can be used to make it more difficult to retrieve deleted
+data. Beware that securely deleting sensitive data is not in
+general an easy task and usually requires writing several times
+on the deleted blocks.
+
+.SH "OPTIONS"
+.IP "\fB-n\fP " 10
+Perform a dry run (do not modify the file-system);
+.IP "\fB-v\fP " 10
+Be verbose;
+.IP "\fB-f value\fP " 10
+Specify the octet value to fill empty blocks with (defaults to
+0). Argument must be within the range 0 to 255.
+.SH "SEE ALSO"
+.PP
+dd (1).
+.SH "AUTHOR"
+.PP
+This manual page was written by Thibaut Paumard <paumard@users.sourceforge.net> for
+the \fBDebian\fP system (but may be used by others). Permission is
+granted to copy, distribute and/or modify this document under
+the terms of the GNU General Public License, Version 2 or any
+later version published by the Free Software Foundation.
+
+.PP
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL-2.
+
+.\" created by instant / docbook-to-man, Mon 31 Mar 2014, 15:41
diff --git a/system/zerofree/zerofree.SlackBuild b/system/zerofree/zerofree.SlackBuild
index 239c325907d36..046cd21bcc5e0 100644
--- a/system/zerofree/zerofree.SlackBuild
+++ b/system/zerofree/zerofree.SlackBuild
@@ -22,9 +22,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20141021 bkw: add man page, add sparsify, bump BUILD to 2.
+
PRGNAM=zerofree
VERSION=${VERSION:-1.0.3}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -77,6 +79,13 @@ strip --strip-unneeded $PRGNAM 2> /dev/null
mkdir -p $PKG/usr/sbin
cp -a $PRGNAM $PKG/usr/sbin
+# This looks useful, include it.
+gcc $SLKCFLAGS -Wl,-s -o $PKG/usr/sbin/sparsify $CWD/sparsify.c -lext2fs
+
+# man page comes from Debian.
+mkdir -p $PKG/usr/man/man8
+gzip -9c $CWD/$PRGNAM.8 > $PKG/usr/man/man8/$PRGNAM.8.gz
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
diff --git a/system/zerofree/zerofree.info b/system/zerofree/zerofree.info
index 4720d45995bdf..1a7582daa8918 100644
--- a/system/zerofree/zerofree.info
+++ b/system/zerofree/zerofree.info
@@ -1,10 +1,12 @@
PRGNAM="zerofree"
VERSION="1.0.3"
HOMEPAGE="http://intgat.tigress.co.uk/rmy/uml/index.html"
-DOWNLOAD="http://intgat.tigress.co.uk/rmy/uml/zerofree-1.0.3.tgz"
-MD5SUM="7fffca9639a2acc9c889c49b3f94a0c6"
+DOWNLOAD="http://intgat.tigress.co.uk/rmy/uml/zerofree-1.0.3.tgz \
+ http://intgat.tigress.co.uk/rmy/uml/sparsify.c"
+MD5SUM="7fffca9639a2acc9c889c49b3f94a0c6 \
+ 919ad782c7120d1e4a9c0ccc9f45b8ef"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="B Watson"
-EMAIL=" yalhcru@gmail.com"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"