From owner-freebsd-questions@FreeBSD.ORG Sun Dec 17 21:07:27 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 17F7E16A417 for ; Sun, 17 Dec 2006 21:07:27 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout5.cac.washington.edu (mxout5.cac.washington.edu [140.142.32.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7403643CA3 for ; Sun, 17 Dec 2006 21:07:20 +0000 (GMT) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141]) by mxout5.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id kBHL7JiS008885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 17 Dec 2006 13:07:20 -0800 X-Auth-Received: from [128.208.5.99] (nilakantha.cs.washington.edu [128.208.5.99]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id kBHL7JQf005950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 17 Dec 2006 13:07:19 -0800 Message-ID: <4585B186.5090204@u.washington.edu> Date: Sun, 17 Dec 2006 13:07:18 -0800 From: Garrett Cooper User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <20061217120040.9EF0316A607@hub.freebsd.org> <20061217203629.GA79172@ns.umpquanet.com> In-Reply-To: <20061217203629.GA79172@ns.umpquanet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.2.2.285561, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2006.12.17.124933 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __STOCK_PHRASE_24 0, __USER_AGENT 0' Subject: Re: var out of space 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: Sun, 17 Dec 2006 21:07:27 -0000 James Long wrote: >> Date: Sat, 16 Dec 2006 23:31:58 -0800 >> From: Bradley Giesbrecht >> Subject: var out of space >> To: freebsd-questions@freebsd.org >> Message-ID: <00190780-C6FE-42DB-9AD8-5D985625545F@pixilla.com> >> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed >> >> Hello, >> >> >> I inherited a freebsd installation with a var slice/mount that is to >> small and filling up all the time. >> >> What type of info should I provide to allow someone to help me with a >> solution? >> >> I would very much prefer to not install another drive just for /var. >> >> /usr has plenty of space. Can I mount var off of /usr? >> > > Here is a slightly simpler solution than what Anders proposed that > may work for you. > > Find out which sub-directories of /var are the disk space consumers: > > du -d1 /var | sort -rn | head > > That will list the top ten. This method assumes you have only one > or two large directories, and that moving them would yield > a substantial reduction in /var disk space usage. > > Let's assume that /var/log and /var/db are the top two directories. > > Shutdown to single-user mode. Stop any daemons like syslog, sendmail, > etc. that might write to /var/log or /var/db, since you will be working > with those two directories. > > cd into /var and move the log sub-directory onto the /usr mount point, > and then create a symlink to make /var/log redirect to the new location > on /usr: > > cd /var > mv log /usr/var-log > ln -s /usr/var-log log > > Repeat for /var/db: > > mv db /usr/var-db > ln -s /usr/var-db db > > Reboot. > > This procedure eliminates the need to mess with your disklabel or your > fstab. > > BTW, it looks like your / partition is a bit crowded, also. :) > > > Jim Depends on what your cluster size is too for the slice. I created a 3.9 GB partition for /usr recently with 16kB clusters (not thinking), and installed ports-which ate up almost all the free space. After I started installing stuff I ran out of space. Solution (in my case): -Delete files (otherwise tunefs has no effect). -Reboot into single-user mode. -Run tunefs on slice setting the average filesize (-f flag) to something a lot lower. -Boot into multiuser mode. Voila! Problem fixed. In your case though, you may want to just backup and redo the system if stuff fills up far too quickly, or look into circular buffer logging with syslog. I don't remember how to accomplish it but it has been done. -Garrett