create a large file
Make a file of a given size, for testing disks, uploads or swap.
filesdisks
danger Steps marked danger delete, overwrite or stop something. Read each one before you run it.
-
fallocate -l 1G big.img1 GB at once, reserved on the disk (Linux)
-
truncate -s 1G sparse.imgdanger 1 GB that takes no room until written
-
dd if=/dev/zero of=big.img bs=1M count=1024 status=progressdanger 1 GB of zeros, written out
-
head -c 100M /dev/urandom > random.bin100 MB of random bytes
fallocatetruncatedd
Each has a page in lore: lore fallocate opens it.
disk full but df says there is room
"No space left on device" with free gigabytes: the disk is out of inodes, the slots for files. Find the folder with too many small files.
find big files
Find the files that take the most room, on a whole disk or in a folder.
free disk space
Find what fills a disk, then clear what is safe to clear: old package files, logs, caches.
see the size of files and folders
How much room each file and folder takes, here or anywhere, biggest last.