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.
Start your free 30 days