Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 1999 13:54:42 -0500 (CDT)
From:      James Wyatt <jwyatt@RWSystems.net>
To:        Andreas Klemm <andreas@klemm.gtn.com>
Cc:        xiyuan qian <xiyuan@dns.hgs.com.cn>, freebsd-isp@FreeBSD.ORG
Subject:   Re: Why the file size becomes so large?
Message-ID:  <Pine.BSF.4.05.9905161341190.23288-100000@kasie.rwsystems.net>
In-Reply-To: <19990516104742.A74673@titan.klemm.gtn.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 16 May 1999, Andreas Klemm wrote:
> On Tue, May 04, 1999 at 05:05:57PM +0800, xiyuan qian wrote:
> > 
> > Hi, today I suddenly noticed that a file locates at /usr/local/program/data dir
> > its size becomes 11235678909 large. Why? This file is wrote by a running prog.
> > What's the reason?
> 
> lsof from the ports collection can be used to determine, which process
> opened the file just in case you don't know which application is causing
> this.

lsof rocks! I had some stale ftpds holding /var/adm/wtmp open the other
day and rm'd it after gzipping it. When the space didn't come back, I knew
something had it open. lsof shows file size too! I owe someone a beer!

> And the question why the file size becomes so large sounds a little
> bit silly to me. Perhaps the application simply writes so much data ?!
> Or you started the application with extra verbosity, just in case it
> is a logfile. Or you enabled debugging ...

Uh, it doesn't sould *that* silly... The size (11235GB or 11.2TB!) is
*much* larger than the drives I use even if you count ccds. This could be
wither filesystem corruption or a 'sparse' file (holes in data). I would
recommend you fsck the filesys immediately. If that shows OK, do a 'du -k'
on the file and see how much disk space it's *really* using. If your
application ever does an lseek() and write() (or fprintf()), one wrong
offset and you can generate a *huge* sparse file - much larger than the
disk. You just can't edit it, back it up (other than dump), or really fill
it in.

As Andreas said, if you can give us more context, we would be able to help
you more. What created it, how big is the filesys, 'du -k', etc...

btw: Some X servers use a rather sparsee 256MB shared memory segment (for
color mapping?) and run on less than that amount of VM. Weird... - Jy@




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9905161341190.23288-100000>