Re: How to generate a large file allocating space

Bruno Wolff III <[email protected]>
Newsgroups gmane.comp.file-systems.ext3.user
Message-ID <[email protected]>
On Sun, Oct 31, 2010 at 11:12:41 +0100,
  Alex Bligh <[email protected]> wrote:
> I want to generate or extend a large file in an ext4 filesystem allocating
> space (i.e. not creating a sparse file) but not actually writing any data.
> I realise that this will result in the file containing the contents of
> whatever was there on the disk before, which is a possible security problem
> in some circumstances, but it isn't a problem here.

There isn't going to be a way to do that through the file system, because
as you note it is a security problem.

What is the high level thing you are trying to accomplish here? Modifying
the filesystem offline seems risky and maybe there is a safer way to
accomplish your goals.
 
> Supplementary question: can I assume that if a non-sparse file is on disk
> and never opened, and never unlinked, then the sectors used to to store
> that file's data will never change irrespective of other operations on the
> ext4 filesystem? IE nothing is shuffling where ext4 files are stored.

I think SSDs will move stuff around at a very low level. They would look
like they are at the same place to stuff access the device like a disk,
but physically would be stored in a different hardware location.

With normal disks, you'd only see this if the device got a read error, but
was able to successfully read a marginal sector and remap it to a spare
sector. But again, stuff talking to the disk will see it at the same address.
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.