Linux Format

Answers

Large file, small space

 Q How do I generate a very large file, say around 980GB, with the dd command? I’m trying to test a quota for an XFS file system under RHEL7. I use the following command as the user oracle, which has the user quota set:

and it outputs

Where is my file?

Michael Pleasant

A You have created an empty file because you have told dd to write no blocks, and it has done exactly that. If you run it with count=1 , you will create a 980TB sparse file, which may or may not trip the quota depending on how it is set up. It creates a sparse file because it doesn’t start writing until 980TB into the drive. Sparse files take up only as much space as they need. If you ran:

then the first command would show your file as its full size, while the second would show it as occupying very little disk space. Note that this is a 980TB file, because the seek and count options are given in block units, which you have specified to be 1K. If you want a 980GB file you need to use seek=980M , or use bs=1 . Sparse files are

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format1 min read
Vector Vexations
Why does MySQL not support vectors in its community edition? Generative AI is the hot topic in tech. GenAI relies on vector data. Yet Oracle has no plans to support vectors in the community edition of MySQL. If you want to try out vector data with ot
Linux Format5 min read
Tips For Managing Docker Containers
Everyone knows how containers revolutionised application building and deployment. Using a E disposable stack of containers that make up an app that aren’t using the docker-compose command to manage the stack are missing a trick. It allows the shippin
Linux Format1 min read
Wine For Wayland
2023 was a great year for the Wayland driver for Wine. The goal was to move forward from the experimental phase and make the driver a proper upstream component. A year later, after several merge requests, many people are now already able to use the l

Related Books & Audiobooks