Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Dec 2006 09:18:32 +0100
From:      Anders Gulden Olstad <andersgo@alge.anart.no>
To:        Bradley Giesbrecht <brad@pixilla.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: var out of space
Message-ID:  <4584FD58.5040803@alge.anart.no>
In-Reply-To: <00190780-C6FE-42DB-9AD8-5D985625545F@pixilla.com>
References:  <00190780-C6FE-42DB-9AD8-5D985625545F@pixilla.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bradley Giesbrecht wrote:
> 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?

Given that I don't know what version of FreeBSD you're running, I would
first try to move and symlink /var into /usr

Got to single user mode first. Then copy /var with cpio

# find /var -print | cpio -pvdmu /usr

Remove the old /var and make a symlink to /usr/var

# rm -rf /var
# ln -s /usr/var var

Reboot to normal operations.

Second - if all seems like to work well - I would perhaps prefer to
expand the g partition into the old e partition and do a growfs on /usr
to make use of the extra space left over from old /var, IF these two
partitions are close neighbours on the disk.

As I understand it's only possible to growfs within a partition, so we
need to merge the old e partition with the existing g.

Go to single user mode again

# bsdlabel -e /dev/ad0s1

Add the size of the g partition to the f partition in the editor. Delete
the g partition line and save.

Run a growfs on the "new" g

# growfs /dev/ad0s1g

Reboot. You will probably run into some fsck problems, but that will
hopefully be a one timer.

I have only done the last approach one time myself on a 6.2-RC1 install
- - so any second opinions from some more seasoned users would be grateful.

Don't forget to study the man pages for bsdlabel and growfs - and do
your backups. But it would give you a general idea of how your problems
may be solved.

/Anders
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Grunbacher Altweizen Dunkel
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFhP1UMVyOPWVstbURAgYRAKCikpLatgEUq5L1bDOccUOf21wrfACfT/YJ
gu41y+tiHOnNyn4yJk2/9pc=
=alP4
-----END PGP SIGNATURE-----



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