Linux sparse file
Last update
2017-06-21
2017-06-21
« — »
To create a sparse file:
1 | dd if=/dev/zero of=file.ext bs=1 count=0 seek=10G |
The command ls -slh file.ext
will output something like this:
1 | 3G -rw------- 1 cloud cloud 10G Jan 01 2017 file.ext |
there are two size columns: the first 3G
is the allocated space and the second 10G
is the max space allocable (that means we still have 7G
of space left).
See also Wiki archlinux