Re: Help: my /var/log/lastlog's as big as Canarsie!
In article <cistron.3922C9FB.8DB4A63@finux.com>,
montefin <montefin@finux.com> wrote:
>Miquel van Smoorenburg wrote:
>>
>> montefin <montefin@finux.com> wrote:
>> >Has anyone else encountered this situation?
>>
>> Yes, almost everyone.
>
>I wonder how come no one in #linux knew about it? Too bad no one in
>#debian ever speaks (at least to me), surely they would have known?
I did not say everybody knew the answer, I just said that almost
everyone must have stumbled over this issue one time or another.
>>
>> >I was looking at my /var/log directory and this popped out at me
>> >-rw-rw-r-- 1 root utmp 18692964 May 17 04:19 lastlog
>> >
>> No. Do a "du /var/log/lastlog" - you'll see that it's just a few K.
>
>I loaf this country! Where else can 18692964 of anything equal 12000?
>And /var/log/faillog isn't 1536408 either, it's just 7000. And Alan
>Greenspan is worried about inflation? Hah!
Yes, the new economy and all that.
>> This is a feature of Unix called "sparse files".
>
>This is a feature? Now I am amazed ;)
Yes. Try this:
% dd if=/dev/null of=bigfile bs=1k seek=1024
0+0 records in
0+0 records out
% ls -l bigfile
-rw-r--r-- 1 miquels staff 1048576 May 17 23:19 bigfile
% du bigfile
0 bigfile
The file contains zero bytes, yet it looks like it's 1MB.
Welcome to Unix ;)
Mike.
Reply to: