2019-02-24 15:47:41 +00:00
|
|
|
# fallocate
|
2018-05-06 14:08:41 +01:00
|
|
|
|
|
|
|
> Reserve or deallocate disk space to files.
|
|
|
|
> The utility allocates space without zeroing.
|
2021-07-09 15:45:55 +01:00
|
|
|
> More information: <https://manned.org/fallocate>.
|
2018-05-06 14:08:41 +01:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Reserve a file taking up 700 MiB of disk space:
|
2018-05-06 14:08:41 +01:00
|
|
|
|
|
|
|
`fallocate --length {{700M}} {{path/to/file}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Shrink an already allocated file by 200 MiB:
|
2018-05-06 14:08:41 +01:00
|
|
|
|
|
|
|
`fallocate --collapse-range --length {{200M}} {{path/to/file}}`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Shrink 20 MB of space after 100 MiB in a file:
|
2018-05-06 14:08:41 +01:00
|
|
|
|
|
|
|
`fallocate --collapse-range --offset {{100M}} --length {{20M}} {{path/to/file}}`
|