Re: How to generate a large file allocating space

Matija Nalis <[email protected]>
Newsgroups gmane.comp.file-systems.ext3.user
Message-ID <[email protected]>
On Sun, Oct 31, 2010 at 04:34:44PM +0100, Alex Bligh wrote:
> That's /almost/ perfect:
> 
>   9  247808 15069184           14336 unwritten,eof
> testfile: 2 extents found
> 
> I think all I need do is clear the unwritten flag in each of the extents.
> Else I think if I read the file using ext4 later (i.e. after I've
> written directly to the sectors concerned) it will appear to be
> empty. 

Yes, it would appear empty. It is due to security concers others mentioned
too.

> Any idea how I do that?

Sorry, I don't. debugfs(8) only appears to have read-only support for
reading extents, and not for (re-)writing them, so I guess you'll have to
find some function in libext2fs if it exists (or write your own if it
doesn't) to use on unmounted fs.

-- 
Opinions above are GNU-copylefted.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.