Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 May 2003 17:00:55 -0400
From:      "Bob Hall" <rjhalljr@starpower.net>
To:        FreeBSD Users <questions@freebsd.org>
Subject:   Re: Repositioning /var | /tmp to avoid disk full condition
Message-ID:  <20030531210055.GD686@svold.krig.net>
In-Reply-To: <3ED8FB4E.76498642@jaymax.com>
References:  <3ED8FB4E.76498642@jaymax.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030531210055.GD686>