diff options
author | Karel Zak | 2009-08-18 13:33:27 +0200 |
---|---|---|
committer | Karel Zak | 2009-09-22 15:26:18 +0200 |
commit | d46a54994e30da03385b82f64eaecffe5c170c92 (patch) | |
tree | 8e6b308066d1744e4801cae9186f44661f69100c /sys-utils/fallocate.1 | |
parent | mount: document changed semantics of tmpfs size option in mount.8 (diff) | |
download | kernel-qcow2-util-linux-d46a54994e30da03385b82f64eaecffe5c170c92.tar.gz kernel-qcow2-util-linux-d46a54994e30da03385b82f64eaecffe5c170c92.tar.xz kernel-qcow2-util-linux-d46a54994e30da03385b82f64eaecffe5c170c92.zip |
fallocate: new command
The fallocate(1) utility is used to preallocate blocks to a file.
This can be useful for virtual images, database files, testing, etc.
Normally we'd hope that various tools will start using preallocation
internally, but until then such a utility may be useful, and could be
scripted as well.
The original Eric's version is available at:
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2490
This version:
- checks for fallocate glibc function and kernel syscall
- does not provide a fallback and does not call posix_fallocate()
- adds long options
- uses err.h for errro messages
- adds NLS support
- cleanups man page
Co-Author: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/fallocate.1')
-rw-r--r-- | sys-utils/fallocate.1 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sys-utils/fallocate.1 b/sys-utils/fallocate.1 new file mode 100644 index 000000000..00e973ceb --- /dev/null +++ b/sys-utils/fallocate.1 @@ -0,0 +1,51 @@ +.\" -*- nroff -*- +.TH FALLOCATE 1 "Jul 2009" "Version 1.0" +.SH NAME +fallocate \- preallocate space to a file. +.SH SYNOPSIS +.B fallocate +.RB [ \-n ] +.RB [ \-o +.IR offset ] +.B \-l +.IR length +.I filename +.SH DESCRIPTION +.B fallocate +is used to preallocate blocks to a file. For filesystems which support the +fallocate system call, this is done quickly by allocating blocks and marking +them as uninitialized, requiring no IO to the data blocks. This is much faster +than creating a file by filling it with zeros. +.PP +As of the Linux Kernel v2.6.31, the fallocate system call is supported by the +btrfs, ext4, ocfs2, and xfs filesystems. +.PP +The exit code returned by +.B fallocate +is 0 on success and 1 on failure. +.PP +.SH OPTIONS +.IP "\fB\-h, \-\-help\fP" +Print help and exit. +.IP "\fB\-n, \-\-keep-size\fP" +Do not modify the apparent length of the file. This may effectively allocate +blocks past EOF, which can be removed with a truncate. +.IP "\fB\-o, \-\-offset\fP \fIoffset\fP +Specifies the beginning offset of the allocation, in bytes. Suffixes of k, m, +g, t, p, e may be specified to denote KiB, MiB, GiB, etc. +.IP "\fB\-l, \-\-length\fP \fIlength\fP +Specifies the length of the allocation, in bytes. Suffixes of k, m, g, t, p, e +may be specified to denote KiB, MiB, GiB, etc. +.SH AUTHORS +.nf +Eric Sandeen <sandeen@redhat.com> +Karel Zak <kzak@redhat.com> +.fi +.SH SEE ALSO +.BR fallocate (2), +.BR posix_fallocate (3), +.BR truncate (1) +.SH AVAILABILITY +The fallocate command is part of the util-linux-ng package and is available from +ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. + |