[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

How to generate a large file allocating space



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.

Ideally what I'd like is a "make unsparse" bit of code. I'm happy for this
to use the libraries, and work on an unmounted fs (indeed that is probably
better).

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.

--
Alex Bligh


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]