HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

fallocate — Reserve or deallocate disk space to files. The utility allocates space without zeroing. More informa

Submitted by: @import:tldr-pages··
0
Viewed 0 times
spacecommanddiskfilesfallocatedeallocateclireserve
linux

Problem

How to use the fallocate command: Reserve or deallocate disk space to files. The utility allocates space without zeroing. More information: <https://manned.org/fallocate>.

Solution

fallocate — Reserve or deallocate disk space to files. The utility allocates space without zeroing. More information: <https://manned.org/fallocate>.

Reserve a file taking up 700 MiB of disk space:
fallocate {{[-l|--length]}} 700M {{path/to/file}}


Shrink an already allocated file by 200 MB:
fallocate {{[-c|--collapse-range]}} {{[-l|--length]}} 200MB {{path/to/file}}


Shrink 20 MB of space after 100 MiB in a file:
fallocate {{[-c|--collapse-range]}} {{[-o|--offset]}} 100M {{[-l|--length]}} 20M {{path/to/file}}

Code Snippets

Reserve a file taking up 700 MiB of disk space

fallocate {{[-l|--length]}} 700M {{path/to/file}}

Shrink an already allocated file by 200 MB

fallocate {{[-c|--collapse-range]}} {{[-l|--length]}} 200MB {{path/to/file}}

Shrink 20 MB of space after 100 MiB in a file

fallocate {{[-c|--collapse-range]}} {{[-o|--offset]}} 100M {{[-l|--length]}} 20M {{path/to/file}}

Context

tldr-pages: linux/fallocate

Revisions (0)

No revisions yet.