Solved /usr/lib disk usage differences between 11.2 and 12.0

Are these differences in disk usage normal?

FreeBSD 11.2-RELEASE:

Code:
du -sh /usr/lib
475MB

du -sh /usr/lib/debug/usr/bin
166MB

FreeBSD 12.0-RELEASE:
Code:
du -sh /usr/lib
1.2G

du -sh /usr/lib/debug/usr/bin
547MB
 
I suspect you have a bunch of old libraries lingering in /usr/lib. Is the 12.0-RELEASE an upgrade? If it is, how did you upgrade?

Code:
dice@maelcum:~ % du -sh /usr/lib
552M    /usr/lib
dice@maelcum:~ % uname -a
FreeBSD maelcum.dicelan.home 12.0-STABLE FreeBSD 12.0-STABLE r343956 MAELCUM  amd64
 
Yes it's an upgrade from 11.2.

Code:
svnup release

cd /usr/src

make buildworld
make buildkernel

make installkernel
mergemaster -p
make installworld
mergemaster -Ui

make -DBATCH_DELETE_OLD_FILES delete-old
make -DBATCH_DELETE_OLD_FILES delete-old-libs
 
FreeBSD 11.2:

Code:
root@server:/usr/lib/debug/usr/bin # du -sh * | grep M | sort
 14M    clang.debug
 46M    ld.lld.debug
 50M    llvm-tblgen.debug
1.0M    openssl.debug
1.1M    svnlite.debug
1.2M    as.debug
1.2M    troff.debug
1.9M    nvi.debug
7.3M    llvm-objdump.debug
8.0M    lldb.debug
9.3M    clang-tblgen.debug

FreeBSD 12.0:

Code:
root@server:/usr/lib/debug/usr/bin # du -sh * | grep M | sort
 11M    llvm-cov.debug
 11M    svnlite.debug
 17M    llvm-objdump.debug
 84M    ld.lld.debug
1.9M    nvi.debug
135M    lldb.debug
166M    clang.debug
3.3M    make.debug
3.4M    objdump.debug
3.7M    svnliteversion.debug
3.8M    clang-tblgen.debug
4.1M    dtc.debug
4.7M    svnlitefsfs.debug
5.0M    svnlitedumpfilter.debug
5.0M    svnlitelook.debug
5.1M    svnliteadmin.debug
5.4M    ar.debug
5.6M    svnliteserve.debug
5.9M    ld.bfd.debug
6.1M    as.debug
6.8M    svnlitesync.debug
7.7M    llvm-tblgen.debug
8.6M    svnlitemucc.debug
8.7M    svnlitebench.debug
8.8M    svnliterdump.debug
 
I don't think that something left from 11.2

For example ld.lld.debug has big difference between 11.2 and 12.0.

And everything inside /usr/lib has new date.
 
Code:
$ du -sh /usr/lib
86M    /usr/lib

$ du -sh /usr/lib/debug/usr/bin
du: /usr/lib/debug/usr/bin: No such file or directory

$ uname -v
FreeBSD 12.0-STABLE-20190108 #0 r342861: Thu Jan 10 16:42:06 CET 2019
Code:
$ grep '^WITHOUT' /etc/src.conf
WITHOUT_ATM=yes
WITHOUT_AUDIT=yes
WITHOUT_AUTHPF=yes
WITHOUT_AUTOFS=yes
WITHOUT_BHYVE=yes
WITHOUT_BLUETOOTH=yes
WITHOUT_BOOTPARAMD=yes
WITHOUT_BOOTPD=yes
WITHOUT_BSDINSTALL=yes
WITHOUT_CCD=yes
WITHOUT_CTM=yes
WITHOUT_CUSE=yes
WITHOUT_CXGBETOOL=yes
WITHOUT_DEBUG_FILES=yes
WITHOUT_FLOPPY=yes
WITHOUT_FREEBSD_UPDATE=yes
WITHOUT_GCOV=yes
WITHOUT_HAST=yes
WITHOUT_HTML=yes
WITHOUT_HYPERV=yes
WITHOUT_I4B=yes
WITHOUT_IPFILTER=yes
WITHOUT_LPR=yes
WITHOUT_MLX5TOOL=yes
WITHOUT_MODULE_DRM=yes
WITHOUT_MODULE_DRM2=yes
WITHOUT_NCP=yes
WITHOUT_NDIS=yes
WITHOUT_OBJC=yes
WITHOUT_PF=yes
WITHOUT_PMC=yes
WITHOUT_PPP=yes
WITHOUT_PROFILE=yes
WITHOUT_QUOTAS=yes
WITHOUT_RADIUS_SUPPORT=yes
WITHOUT_RBOOTD=yes
WITHOUT_REPRODUCIBLE_BUILD=yes
WITHOUT_SHAREDOCS=yes
WITHOUT_SYSINSTALL=yes
WITHOUT_TESTS=yes
WITHOUT_TFTP=yes
WITHOUT_TIMED=yes
WITHOUT_USB_GADGET_EXAMPLES=yes
WITHOUT_WIRELESS=yes
WITHOUT_WPA_SUPPLICANT_EAPOL=yes
WITHOUT_ZFS=yes
 
I use the GENERIC kernel without /etc/src.conf in both cases.

Also I think DEBUG option in GENERIC kernel is enabled by default in 11.2 and 12.0.

What I try to find is if the disk usage is normal or something is not good with my system.
 
If you're using a -RELEASE version with a GENERIC kernel, why don't you update using freebsd-update(8)?

Does /etc/make.conf exist? If so, what does it contain?
 
I find it easier to upgrade using source.


cat /etc/make.conf

DISABLE_VULNERABILITIES=yes
SSHGUARDFW=ipfw
OPTIONS_UNSET=X11
WITH_PKGNG=yes
DEFAULT_VERSIONS+=ssl=openssl
DEFAULT_VERSIONS+=php=72
DEFAULT_VERSIONS+=bdb=6
 
Remove the DISABLE_VULNERABILITIES, the SSHGUARDFW is pointless and WITH_PKGNG is useless too. But none of them have anything to do with the system's libraries so that's not a cause of this issue. The DEFAULT_VERSIONS seem to be fine but those are only for ports and have no influence on the base OS.
 
Can you run this command in your system?

Code:
du -sh /usr/lib/debug/usr/bin/clang.debug

166M    /usr/lib/debug/usr/bin/clang.debug
 
Code:
dice@maelcum:~ % du -sh /usr/lib/debug/usr/bin/clang.debug
 73M    /usr/lib/debug/usr/bin/clang.debug
 
Oh, wait. I suddenly realized something. 12-STABLE recently got a major update for Clang, LLVM, etc. That might explain at least some of the differences.


Double checking a 12.0-RELEASE:
Code:
dice@case:~ % uname 
FreeBSD case.dicelan.home 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
dice@case:~ % du -sh /usr/lib
180M    /usr/lib
Still, nowhere near the 1.2GB you appear to have.
 
I'm afraid I can't explain either why the difference is that big on your machine. However, if the size is a problem for you, just set WITHOUT_DEBUG_FILES=yes in /etc/src.conf, as already mentioned. You don't need the debug files if you're not a developer and/or if you don't need to hunt down bugs.
See the entry labeled “20151207” in /usr/src/UPDATING, and the src.conf(5) manual page.
 
6160


FreeBSD 12, web has nginx, nodejs, erlang
db has postgresql, erlang
proc1 has erlang
 
FreeBSD 12, web has nginx, nodejs, erlang
db has postgresql, erlang
proc1 has erlang
It does not matter at all which packages you install, because those go into /usr/local, while /usr/lib belongs to the base system.
Also see the hier(7) manual page for reference; it describes in detail the layout of FreeBSD's file system hierarchy.
 
Hmm my /usr/lib is 1.9 GB big, of which 1.5 GB /usr/lib/debug. Guess make delete-old-libs doesn't do what I thought.
 
Back
Top