var out of space

Anders Gulden Olstad andersgo at alge.anart.no
Sun Dec 17 00:18:35 PST 2006


-----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-----


More information about the freebsd-questions mailing list