Problem: clearing up disk space

I recently upgraded to the 13.0-RELEASE and everything went fine. But now when I check my disk space ( df):

Filesystem Size Used Avail Capacity Mounted on
/dev/ada0p2 16G 9.2G 5.1G 64% /
devfs 1.0k 1.0k 0B 100% /dev
procfs 4.1k 4.1k 0B 100% /proc

I only have 2 window managers installed and not that many packages (498). I do have ports installed but have only built one package from it (one of the formentioned wm's). Using du is not helping very much. I've already cleared /var/crash/ and have used pkg autoremove and pkg clean.

Can someone point me in the right direction? It doesn't seem normal that I'm sitting at 9.2 GB of used disk space.
Thanks.
 
For a quick comparison, I have an upgraded 12.2->13.0 install with a similar installation profile sitting at 5.4G.
 
A suggestion on when using du, you can set the depth (totaling everything up to that level) that it reports.

So doing du -h -d 1 does a depth of one, so it totals subdirectories to your current level. (the -h is to display in human readable like Megs, Gigs, etc...)
 
p.s. -x File system mount points are not traversed.

The -d switch is good to know about. Ah, -s is different bsd vs not-bsd
 
freebsd-update stores a roll-back that can be cleaned. Usually around 2 gigs and lots of small files.
/var/db/freebsd-update/files

Also you mentioned a WM port that you compiled. Have you cleaned that build?
make clean and then delete the ports /work directory.
 
/var/db/freebsd-update/files (can be cleaned)
Thanks.

I realised my use of du was still not the bsd way, was still doing it the '-s' way from not-bsd. the -d needed 0, not 1.

Code:
root@eeepc:~ # df -h
Filesystem            Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default     98G    3.2G     95G     3%    /
root@eeepc:~ # du -h -x -d 0 /* | sort -h | tail -5
7.6M    /rescue
8.1M    /lib
162M    /boot
1.3G    /var
1.7G    /usr
 
Sorry for the late reply. Email notifications weren't working.

I cleaned /var/db/freebsd-update/files and went from 8.5 GB to 7.5 GB. So that's great. Still seems high, though.

The port of the wm I installed had been cleaned already, but it was a trifle. Wasn't causing any space problems.

Results of du:

Code:
du -xh -d 0 /* | sort -h
  0B    /home
  0B    /proc
  0B    /sys
3.5K    /dev
4.0K    /entropy
4.0K    /mnt
4.0K    /net
8.0K    /COPYRIGHT
8.0K    /media
 32K    /tmp
264K    /libexec
288K    /root
1.3M    /bin
3.1M    /etc
6.6M    /sbin
 13M    /rescue
 15M    /lib
295M    /boot
309M    /var
6.4G    /usr
 
du -h -d1 /usr/lib

You may have the debug files installed (which takes up a ridiculous amount of space).

Here's what I found:

Code:
$ du -h -d 1 /usr/lib

4.0K    /usr/lib/compat
232K    /usr/lib/i18n
 93M    /usr/lib/clang
 24K    /usr/lib/engines
 24K    /usr/lib/libxo
148K    /usr/lib/dtrace
443M    /usr/lib/debug
 16K    /usr/lib/flua
960M    /usr/lib

Not as big a contributor as I was hoping. Is it safe to just delete these manually?
 
du -h -d1 /usr/lib

You may have the debug files installed (which takes up a ridiculous amount of space).
This thread enabled me to save some space: find . -type f -name " *.debug" -exec /bin/rm -v {} \; and the system still works good. I don't recall from which directory it was run though.
 
I only have 2 window managers installed and not that many packages (498).
6.4G /usr
Not the number of packages are decisive but how big are they. Running pkg info -sa | sort -hk2 will show the total size of files installed by each package, sorted after size ascending. pkg-info(8). To display the disk space occupied of all installed packages: pkg-stats(8).

Besides du(1) sysutils/ncdu is an excellent tool to inspect the disk usage of a file system. It has functions to view and manipulate the found results. To name a few features: The results can be sorted after different properties, files and directories deleted, a shell spawned. For more options see ncdu(1).
 
Not the number of packages are decisive but how big are they. Running pkg info -sa | sort -hk2 will show the total size of files installed by each package, sorted after size ascending. pkg-info(8). To display the disk space occupied of all installed packages: pkg-stats(8).

Besides du(1) sysutils/ncdu is an excellent tool to inspect the disk usage of a file system. It has functions to view and manipulate the found results. To name a few features: The results can be sorted after different properties, files and directories deleted, a shell spawned. For more options see ncdu(1).

Thanks for the advice. I'll see if I can lose some of this stuff.
 
I'll see if I can lose some of this stuff.

If you want to lose some packages, with pkg-query(8) you can list all packages with no reverse dependencies (packages which are not required by other packages). The following command is a modified example from pkg-query(8) including the flat size of the packages and sorted ascending:

pkg query -e '%#r = 0' '%o %sh' | sort -hk2

After deleting packages from the list run pkg-autoremove(8) afterwards.
 
Back
Top