/usr/obj very large

Code:
# du -h -d 1 /
1.4M    /bin
386M    /boot
3.5K    /dev
3.2M    /etc
 16M    /lib
484K    /libexec
4.0K    /media
 24K    /mnt
4.0K    /net
4.0K    /proc
 28M    /rescue
5.3M    /root
7.3M    /sbin
 36K    /tmp
 22G    /usr
375M    /var
3.1G    /src
1.7M    /www
 20K    /skripte
 26G    /
#
Code:
# du -h -d 1 /usr
371M    /usr/bin
 31M    /usr/include
3.0G    /usr/lib
 72K    /usr/libdata
4.0M    /usr/libexec
667M    /usr/local
 16G    /usr/obj
 24M    /usr/sbin
114M    /usr/share
4.0K    /usr/src
226M    /usr/lib32
107M    /usr/tests
 88K    /usr/home
 20G    /usr
#

Any idea if/how it can be cleaned?
 
Mine is 20GiB, doing full builds (world/kernel) for amd64 and i386. So far, this doesn't bother me.

It's the default working directory for anything built from /usr/src, containing object files, linked binaries, temporary (cross-)tools, etc. You can just delete all its contents, the tradeoff will be that your next base build won't have any chance to reuse anything that didn't change.
 
Code:
# df -h /usr/obj/
Filesystem    Size    Used   Avail Capacity  Mounted on
fbsd1/obj     544G     36G    507G     7%    /usr/obj
Doing lots of builds WITH_METAMODE turned on tends to make it grow a lot. It's not a big issue on this machine. You just have to clean it every now and then.
 
Code:
# df -h /usr/obj/
Filesystem    Size    Used   Avail Capacity  Mounted on
fbsd1/obj     544G     36G    507G     7%    /usr/obj
Doing lots of builds WITH_METAMODE turned on tends to make it grow a lot. It's not a big issue on this machine. You just have to clean it every now and then.
df -h /usr/obj/
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 120G 16G 103G 14% /

ls -a /usr/obj/
. ..

I've never done any builds and for me it also seems to say it's using 16GB.
Then when I run ls -a /usr/obj/ it doesn't find any directories or files in this directory, which I don't understand.
 
df -h /usr/obj/
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 120G 16G 103G 14% /

ls -a /usr/obj/
. ..

I've never done any builds and for me it also seems to say it's using 16GB.
Then when I run ls -a /usr/obj/ it doesn't find any directories or files in this directory, which I don't understand.

You don't have a /usr/obj dataset. The output is from the dataset containing the directory, in this case zroot/ROOT/default.
You can use du(1) to get the size for a directory.
Code:
du -h /usr/obj
du -hx / | sort -h -t 1  # sort output by size of directory
 
Make sure you don't have extra artifacts from `make release` or similar in there. They don't get cleaned out during `make world` and can be big.
 
One big culprit is debug files. With the following flags
Code:
WITH_CCACHE_BUILD=yes
WITH_META_MODE=yes
WITHOUT_DEBUG_FILES=yes
/usr/obj/usr/src/amd64.amd64 is 6.5GB. But /usr/obj/ccache keeps growing so I have to periodically CCACHE_DIR=/usr/obj/ccache ccache -c. Some debug libraries may be needed depending on what you are debugging but I haven't explored this.
 
Back
Top