From owner-freebsd-questions@FreeBSD.ORG Thu Aug 23 14:50:16 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B640106566B for ; Thu, 23 Aug 2012 14:50:16 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id BB6678FC14 for ; Thu, 23 Aug 2012 14:50:15 +0000 (UTC) Received: from r56.edvax.de (port-92-195-49-179.dynamic.qsc.de [92.195.49.179]) by mx02.qsc.de (Postfix) with ESMTP id 0231527E13; Thu, 23 Aug 2012 16:50:13 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q7NEoDgo002270; Thu, 23 Aug 2012 16:50:13 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 23 Aug 2012 16:50:13 +0200 From: Polytropon To: kpneal@pobox.com Message-Id: <20120823165013.f131bcf0.freebsd@edvax.de> In-Reply-To: <20120823135408.GA76656@neutralgood.org> References: <201208221934.q7MJYfwM063804@mail.r-bonomi.com> <1345664911.2501.8.camel@z6000.lenzicasa> <20120822232112.07ac3517@gumby.homeunix.com> <20120822232907.34fc82fc@gumby.homeunix.com> <20120823031754.0b52bed6@gumby.homeunix.com> <20120823135408.GA76656@neutralgood.org> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions , Andy Wodfer Subject: Re: /tmp filesystem full X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 14:50:16 -0000 On Thu, 23 Aug 2012 09:54:08 -0400, kpneal@pobox.com wrote: > On Thu, Aug 23, 2012 at 11:04:02AM +0200, Andy Wodfer wrote: > > Can't seem to figure out the problem with MAXPATHLEN. > > > > locate: integer out of +-MAXPATHLEN (1024): 1029 > > > > > > In my /etc/locate.rc I have pruned several directories (even the most > > obvious) - still the locate DB exeeds well over 1GB before outputting this > > error message. > > > > I have moved the tmp dir for locate to /usr/tmp which works fine (changed > > in locate script) and there is no problems with diskspace here. > > > > the find awk command suggested earlier in this thread didn't give me a > > better clue about what's happening. > > > > Anyone have any other ideas what I can try to find out why locate fails? > > I'm starting to wonder if you have a corrupt filesystem. Do you have > a large number of files or something? My locate database is about three > megs in size. Granted, I don't have that much data to index. On my home system, it's 16 GB, but that's still far away from any gigabyte "barrier"... > A loop in the filesystem will eventually result in a path that is > too long. Use fsck to diagnose a corrupt filesystem if you are using > UFS/UFS2. Performing a file system check is a good advice, just to make sure there's not a file system inconsistency that triggers some abnormal behaviour. Note that _repairing_ a potential defect should be done in single user mode ("boot -s") on the unmounted partitions. > If you don't mind a teeny bit of scripting then you can get close to > the problem with a find command that runs a short python script: > > find / -exec scriptname {} \; > > Where scriptname is an executable file with contents something like this: > > # /usr/local/bin/python > > import sys > > for x in sys.argv[1:]: > if len(x) > 900: # make higher or lower as needed > sys.stdout.write(x + "\n") > sys.stdout.flush() > > This script takes all command line arguments to it and prints them > out if the length of the argument exceeds 900 characters. The find > command I gave above should run this script and give it each > filename as it comes across it. In short and which system tools only: % find / -type d | awk 'length > 900' And with storing a list for further reference: % find / -type d | awk 'length > 900' > /tmp/longpaths.txt Also note that this test only considers path names. In case you have long _file_ names (or names containing corrupt characters maybe), that could also be a problem, as the locate command also records those, if I remember correctly. You can change the "-type d" to "-type f" to test for file names (_including_ the path). See "man find" for details. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...