From owner-freebsd-questions@FreeBSD.ORG Sat May 31 14:03:38 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C5FB37B408 for ; Sat, 31 May 2003 14:03:38 -0700 (PDT) Received: from smtp02.mrf.mail.rcn.net (smtp02.mrf.mail.rcn.net [207.172.4.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F9C343FB1 for ; Sat, 31 May 2003 14:03:37 -0700 (PDT) (envelope-from rjhalljr@starpower.net) Received: from 66-44-56-156.s156.tnt2.lnhva.md.dialup.rcn.com ([66.44.56.156] helo=svold.krig.net) by smtp02.mrf.mail.rcn.net with smtp (Exim 3.35 #4) id 19MDVo-00003Y-00 for questions@freebsd.org; Sat, 31 May 2003 17:03:37 -0400 Received: by svold.krig.net (sSMTP sendmail emulation); Sat, 31 May 2003 17:00:55 -0400 From: "Bob Hall" Date: Sat, 31 May 2003 17:00:55 -0400 To: FreeBSD Users Message-ID: <20030531210055.GD686@svold.krig.net> Mail-Followup-To: Bob Hall , FreeBSD Users References: <3ED8FB4E.76498642@jaymax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ED8FB4E.76498642@jaymax.com> User-Agent: Mutt/1.4.1i Subject: Re: Repositioning /var | /tmp to avoid disk full condition X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2003 21:03:38 -0000 On Sat, May 31, 2003 at 11:58:23AM -0700, Joseph Maxwell wrote: > Hello, > The 3rd edition of "The Complete FreeBSD" suggest repositioning the /var > directory ( and even /tmp) to prevent filling up that partition. I > ignored it and did just that today, filled it up. So I attempted the > repositioning with the following recommended command steps and results: > > cd /var > tar cf - . | (cd /usr/var; tar xf - ) > cd / > rm -rf /var > ln -s /usr/var /var > > However the 'rm -rf /var' returned > > rm: /var: Device busy > > After trying all known tricks to me to remove /var, I concluded that > since it was mounted from the /etc/fstab I should dismount it and remove > the directory (link point ?) and create a soft link there as > recommended. However, on rebooting boot was aborted, was thrown into I've got a note in my copy of that book about that. Apparently, back when I installed my first FBSD system, I tried the delete the /var partition. The note indicates that I discovered that it couldn't be done. :) If you were following Leahy's instructions, then you copied the contents of /var to /usr/var. If you haven't deleted /usr/var, the you can copy the contents back to var. If you have deleted /usr/var, but you have backup, then you can restore the contents from your backup. If either of the above were true, you probably wouldn't be posting here asking how to restore. Since you are asking, you probably can't restore the contents. However, you can still restore the directories (without any files that might have been in them). If you installed from a CD set, the second CD should contain a live file system. Copy the contents of /cdrom/var to /var. If you installed from downloaded sources, I'm guessing that the freebsd.org site has a similar live file system somewhere, so if you can find it, you should be able to copy it to /var. I've never looked for it, so I don't know where it would be. Even if you can restore from /usr/var or backup, you should check a live file system to ensure that the restored directories in /var have the correct flags and you haven't made some other error. When you create /var and /temp in the disklable editor during installation, you are creating partitions in your slice. Unlike directories, which are only listings of addresses for files and other directories, a partition is a persistent part of your hard disk. The tools that delete directories have no effect on it. You could probably muck up your system in a way that makes a partition unavailable, but it is still occupying space on your hard disk, and that space will be wasted. If you want to delete the /var and /tmp partitions, you should do a 0-level dump of your system, remove /var and /tmp in the disklabel editor during reinstallation, and the restore your files from the dump archive. Unless your have a tiny hard drive and are desperate for space, I don't think it's worth the effort.