PDA

View Full Version : How to clean up /usr?


nihonto
06-21-2008, 10:07 AM
Hi there:)!

Recently I've updated my -current system via anoncvs (/usr/src, /usr/ports, /usr/xenocara). After that my 5.3 Gig /usr was almost completely filled up. So, I deleted /usr/xobj/* and ran "make clean" in /usr/src. This helped a little, but there are still some 87% of /usr in use - just 636 MB are free:(.

Are there any other steps I could take to regain some space on /usr?

openbsdspirit
06-21-2008, 10:48 AM
Previously, i also encounter the same problem with you and i manually delete some files which i seen is unusable.

I hope this help.

Thanks for your response

jggimi
06-21-2008, 11:56 AM
If you built userland properly, all the object files are in /usr/obj, which can also be cleared completely:

# rm -rf /usr/obj/*

Some small savings can also be had by clearing your kernel build of object files also. Here's an example with GENERIC,
if you built GENERIC.MP or you have custom kernels, do the same there:

# cd /usr/src/sys/arch/<arch>/compile/GENERIC
# make clean

ocicat
06-21-2008, 03:47 PM
Are there any other steps I could take to regain some space on /usr?
If you have another drive available, you may consider moving /usr/src, /usr/obj, & /usr/xenocara to externally mounted partitions. Allocating 5GB per partition is more than enough for each. These partitions only need to be mounted when doing a CVS update or building; otherwise, they do not need to be mounted at all.

As a personal anecdote, I have OpenBSD installed on a storage challenged system where these three partitions reside on an external USB drive. I only attach & mount them when I update & rebuild the system.

lvlamb
06-21-2008, 07:01 PM
The way I took.
While sources and ports tree can be read from an USB key (or evem a ro medium) I put my .../obj dirs on a hard drive slice. My distfiles, packages sources are on yet another slice. With my data (archives, postgresql, www, mail, user data ). The only slice I need to backup beyond /var/backups.

snip from my mk.conf
WORKOBJDIR=/sandbox/pobj
MAKEOBJDIR=/sandbox/sobj
XOBJDIR=/sandbox/xobj

Faster to newfs the /sandbox then rm :)
And .... the .../obj dirs are clean!

A very heavy /usr (with GTK and QT3 and QT4 and their apps) takes less than 4Gig.

nihonto
06-22-2008, 10:23 AM
Hi Folks,

thank's a lot for your advice;)! Think I will follow ocicats recommendation:cool:.