1FALLOCATE(1) General Commands Manual FALLOCATE(1)
2
3
4
6 fallocate - preallocate space to a file.
7
9 fallocate [-n] [-p] [-o offset] -l length filename
10
12 fallocate is used to preallocate blocks to a file. For filesystems
13 which support the fallocate system call, this is done quickly by allo‐
14 cating blocks and marking them as uninitialized, requiring no IO to the
15 data blocks. This is much faster than creating a file by filling it
16 with zeros.
17
18 As of the Linux Kernel v2.6.31, the fallocate system call is supported
19 by the btrfs, ext4, ocfs2, and xfs filesystems.
20
21 The exit code returned by fallocate is 0 on success and 1 on failure.
22
24 -h, --help
25 Print help and exit.
26
27 -n, --keep-size
28 Do not modify the apparent length of the file. This may effec‐
29 tively allocate blocks past EOF, which can be removed with a
30 truncate.
31
32 -p, --punch-hole
33 Punch holes in the file, the range should not exceed the length
34 of the file.
35
36 -o, --offset offset
37 Specifies the beginning offset of the allocation, in bytes.
38 Suffixes of k, m, g, t, p, e may be specified to denote KiB,
39 MiB, GiB, etc.
40
41 -l, --length length
42 Specifies the length of the allocation, in bytes. Suffixes of
43 k, m, g, t, p, e may be specified to denote KiB, MiB, GiB, etc.
44
46 Eric Sandeen <sandeen@redhat.com>
47 Karel Zak <kzak@redhat.com>
48
50 fallocate(2), posix_fallocate(3), truncate(1)
51
53 The fallocate command is part of the util-linux-ng package and is
54 available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
55
56
57
58
59Version 1.0 Jul 2009 FALLOCATE(1)