Re: Reserving blocks without actually creating files



Is it possible to mark blocks on a filesystem as used without actually
putting anything into those blocks? It is like creating a sparse file
but actually putting all the blocks aside.
[snip]
So is there an easy way to "fake" that the filesystem is already
pretty full without actually copying 10TB of data?

If the operating system and file system are new enough to support
fallocate(), then: create a file for writing (thus empty), fallocate(),
sleep() without close()ing the file descriptor. There may be limits,
so you might have to use many files. Actual space exhaustion might
revoke previous unused reservations, but it's worth a try.

--
.



Relevant Pages

  • Re: Reserving blocks without actually creating files
    ... It is like creating a sparse file ... pretty full without actually copying 10TB of data? ... If the operating system and file system are new enough to support ... but it's worth a try. ...
    (comp.os.linux.misc)
  • Re: Reserving blocks without actually creating files
    ... pretty full without actually copying 10TB of data? ... If the operating system and file system are new enough to support ... What if you open file, write block, seek a long way and write another block, does that leave large sparse file on disk? ... Attempts to read n-3 block will fail, attempts to write n-3 block will allocate new block etc. ...
    (comp.os.linux.misc)
  • Re: File holes in Linux
    ... writing null bytes doesn't automatically create a sparse file on Unix-y ... Generally, on file systems that support it, files become ... checks for all-zero blocks when copying and then uses lseek to skip over ...
    (comp.lang.python)
  • RE: Stop People Copying a Workbook
    ... There is no way to stop people from copying a workbook. ... operating system that is ultimately doing the copy. ... to work out which sheets in each are most up to date and merge them back into ...
    (microsoft.public.excel.misc)
  • Re: Here We Go Again!
    ... deleting, copying and moving files? ... It seems there may be a bug in Microsoft's new operating system ... That's only cos there's an Space Character in that Link ...
    (uk.people.silversurfers)