Created
September 12, 2019 02:49
-
-
Save tnibert/e993d86ec6f12130d32605866935652f to your computer and use it in GitHub Desktop.
Fill a disk to 5 TB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this will fill a disk to 5TB with one command, accounting for existing disk usage | |
# $a will be in kilobytes, so it must be converted in the expr to units of 150MB | |
# bs is set for efficiency, results on your disk may vary, if you change this, you'll need to change the number at the end in expr (currently 1024 * 150) | |
# the sed command specifies line 9 of the output pulled from df -k, you will need to change for your df output | |
dd if=/dev/zero of=/mnt/partition/bigfile bs=150MB count=$(let "a = 5368709120-`df -k | awk '{ print $3 "\t" }' | sed -n '9p'`"; expr $a / 153600) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment