From owner-freebsd-questions@FreeBSD.ORG Wed Aug 22 13:47:05 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EDF7106566C for ; Wed, 22 Aug 2012 13:47:05 +0000 (UTC) (envelope-from jhein@symmetricom.com) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5AAAF8FC08 for ; Wed, 22 Aug 2012 13:47:05 +0000 (UTC) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q7MDkw6A056826; Wed, 22 Aug 2012 07:46:58 -0600 (MDT) (envelope-from jhein@symmetricom.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.5/8.14.5) with ESMTP id q7MDkVan014960; Wed, 22 Aug 2012 07:46:31 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.5/8.14.5/Submit) id q7MDkUrp014959; Wed, 22 Aug 2012 07:46:30 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20532.58038.689703.188732@gromit.timing.com> Date: Wed, 22 Aug 2012 07:46:30 -0600 From: John Hein To: Andy Wodfer In-Reply-To: References: X-Mailer: VM 8.2.0b-trunk-1408 under 23.4.1 (i386-portbld-freebsd7.4) Cc: freebsd-questions Subject: Re: /tmp filesystem full X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 13:47:05 -0000 Andy Wodfer wrote at 12:59 +0200 on Aug 22, 2012: > Hi, > I have about 500MB in my /tmp and it seems to be too small when the > periodic LOCATE script runs every week. > > What's the best way to increase the size of /tmp ? Could I simply remove it > and create a symbolic link ln -s to say /usr/tmp instead (where I have > several hundred GBs free)? > > PS! This is on a live server and I would like to keep downtime and > problems to a minimum. :-) One way is to work around your problem is to add 'TMPDIR=/path/to/bigger/filesystem' in /etc/crontab and/or 'export TMPDIR=/path/...' in /etc/periodic.conf. No downtime for that. But yes, you can make /tmp a sym link. You may have to worry about edge cases regarding booting (like if the filesystem you point to is not available early enough at boot time). In the typical case (e.g., locally mounted ufs), it should work fine. There may be very rare cases of software that gets confused by a sym link for /tmp, but certainly the stock periodic scripts should work with it. Depending on what processes have files open on /tmp, you may decide to use some down time to make the sym link. You can't use mv(1) to rename a mounted mount point. If you can umount /tmp, then you can rename it and make the sym link. But it's possible some processes have files open in /tmp preventing a normal umount (see lsof(8), fstat(1)). You would have to convince those processes to close the /tmp file descriptors.