Yes, I am doing something similiar ': > logfile' which in bash is the
equivalent of 'cp /dev/null logfile'. After I zero the logfile out, I still
get the filesystem discrepancies.
-Chuck
-----Original Message-----
From: Mikkel L. Ellertson [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 27, 2001 8:07 PM
To: '[EMAIL PROTECTED]'
Subject: Re: 'fsck' on a mounted partition
On Sat, 27 Jan 2001, Chuck Carson wrote:
>
> Is there a way to safely run 'fsck' on a mounted partition? Under Solaris
> you can do this by reffering to /dev/rdsk/<partition> and not worry about
> pear shaping anything (I could not find anything resembling this in RH's
> device tree). I have several hard hit web servers with /var patition
getting
> hammered. Often times I will free up nearly 2gigs of space in /var but the
> OS does not recognize the newly acquired space unless the filesystem is
> inspected with fsck. This does not happen every time but at least once a
> week it will happen. These are 6.2 boxes with the latest patches and
kernel
> 2.2.18smp. I have tried to unmount /var after stopping nearly every
service
> I could including syslog but still cannot 'umount' gracefully. I cannot
> reboot the machines on a nightly basis, in fact, once a month is my ideal
> schedule. I would push these boxes even longer than that but these boxes
are
> running buggy code.
>
> Oh, one other question. Is 'df' a reliable method to check disk space?
This
> is what I use after freeing up 2gig's of space, but 'df -k' will still
read
> the same amount of free space as before. However, if I 'du -sk /var' it
will
> show maybe 138megs total, as opposed to the 2gig 'df' reports. What about
> using snmp?
>
>
> Thanks for any help,
> CC
>
>
>
One thing that will cause df and du to show different values is if you
delete a log file that is still open and being written to by a running
program. Untill that file is closed, it is still on the disk, and
taking up space. But it is not in any directory. As soon as the file
is closed, the disk space is freed. This is the reasion for the
"killall -HUP" commands in logrotate scripts.
One way I have found around this is to use "cat /dev/null >logfile"
Mikkel
--
Do not meddle in the affairs of dragons,
for you are crunchy and taste good with ketchup.
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list