Traduisez - Übersetzen - Traduzca - Traduza - Tradurre - Translate

VanLUG Email Archive

Re: aha!

Ted Powell
Sat, 3 Oct 1998 13:52:07 -0700

On Sat, Oct 03, 1998 at 11:15:00AM -0700, Vincent Janelle wrote:
> killall syslogd klogd, then you can either remote it or back it up, then
> "syslogd && klogd"
>
> If you just erase the file, you'll find out that you'll get a file thats
> 100mb or so.. 100 mb of NULL.

This happens if a program had the log file open at the time you removed
the content. It just goes on writing at the offset that it thinks is
the end of the file. The blocks between the beginning of the file and
there don't actually exist on disk though.

The reason you see null bytes is that if you do a read at an offset that
does not correspond to an allocated disk block, the system fakes it and
gives you all null bytes.

The fun begins if you copy or compress the file. When the copy program
reads from the file and is given null bytes it will actually write
blocks of null bytes to the destination file, using up real disk space.
When the compress program reads from the file and is given null bytes,
it will output a compressed representation of them, but this still
takes up space on disk, so the "compressed" file can come out using
significantly more space on disk than the original one did.

One of the many useful things I learned while I was a sysadmin at
Microplex. Thanks, Fred!

-- 



http://psg.com/~ted/ (Ted Powell) If your hard drive crashes, perhaps you have a recent backup. If Earth crashes, what then? We need off-site backup: Luna, L5, Mars, wherever.