Linux

The Fallocate Command: What does the fallocate command do?

fallocate

This is one of the least used and known commands in Linux and can be very useful for Administrators when building or configuring monitoring of disk space and directory usage. The fallocate command is used for the pre-allocation of blocks to a File. A team of Administrators are on a task to monitor specific directories in multiple servers. How do we test that? Fallocate command helps do this by allocating blocks requiring no I/O to the data blocks.

NOTE: This command is supported on BTRFS, EXT4, OCTFS2, and XFS filesystems

fallocate --help

Shows the basic usage and command syntax.

image_2021_09_10T04_02_50_422Z

To use this command lets check our current disk usage

df -hT
image_2021_09_10T03_53_25_162Z

Test by creating a 20GB file

fallocate -l 20G testfile1

view the file size and disk usage

image_2021_09_10T04_02_21_278Z

Fallocate command is similar to the dd command, however, dd exists mostly for older versions of Linux.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x