[Gllug] Filesystem Holes

Alain Williams addw at phcomp.co.uk
Mon Oct 8 10:50:04 UTC 2001


On Mon, Oct 08, 2001 at 11:33:35AM +0100, t.clarke wrote:
> Re further comments on filesystem holes;
> 
> not sure I can make sense of the explanations given !
> 
> Just out of interest i catted /dev/zero to a file and took note of
> the before and after filesystem 'df' statistics:
> 
> Before:  used 208792  free 263335
> file size created 73310208
> After:   used 280667  free 191460
> 
> Can't obviously say whether anything was physically written to the disc,
> but the space certainly appears to have been allocated !

/dev/zero generates an infinite stream of NUL bytes. The file that you created
would have contains large numbers of NUL bytes, this will have take disk space.

The file would not have contained holes. The way that you create a hole is to
open a file, seek to some location beyond the end of file and write a byte.
The file will now have an extra block allocated to it, the intervening blocks
between the previous end of file and the new end of file will not be allocated
this is called a hole.

-- 
Alain Williams

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list