FreePBX distro harddrive is apparently filling up. What can I remove?

I downloaded the FreePBX distro 3 months ago, installed it in a virtual machine on VMware ESXi. It’s been working great!

But PRTG is reporting that there’s only 2767 MB (for some strange reason, I don’t know why).

As this PBX isn’t much used, it’s just our one line home phone, what is filling up the drive?
What can I get rid of?
And how?

I found that most of this are in the mysql log. Is there any way to clear the log?

1 Like

rm foo* …

Thanks, although removing a file is not the problem. Finding what to remove is harder, at least for me (as a Linux-noob).

I tried a du -ch command, and got:

[…]
2.8 GB total

that didn’t seem like much, so I did df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda2 29G 24G 3.2G 89% /
tmpfs 499M 0 499M 0% /dev/shm
/dev/sda1 291M 34M 243M 13% /boot

… that’just a whole different story. 24 GB used? Where?!

try:-

du -h -d 1 /

Find the big one and go into it, for example

du -h -d 1 /var/

etc.

find / -type f -size +20M -exec ls -lh {} \; | awk '{ print $NF ": " $5 }'	

Thank you both for answering. Dicko, I have gone through the big folders, but still can’t find anything I find “irregular”.

I tried this here:
[root@localhost /]# find / -type f -size +20M -exec ls -lh {} ; | awk ‘{ print $NF ": " $5 }’
/var/lib/rpm/Packages: 29M
/sys/devices/pci0000:00/0000:00:0f.0/resource1: 64M
/sys/devices/pci0000:00/0000:00:0f.0/resource1_wc: 64M
find: /proc/5574/task/5574/fd/5': No such file or directory find:/proc/5574/task/5574/fdinfo/5’: No such file or directory
find: /proc/5574/fd/5': No such file or directory find:/proc/5574/fdinfo/5’: No such file or directory
/tftpboot/firmwaredownloads/digium.1.06.tar.gz: 130M
/tftpboot/firmwaredownloads/cisco.1.02.tar.gz: 68M
/tftpboot/digium/0/D50.eff: 33M
/tftpboot/digium/0/D45.eff: 33M
/tftpboot/digium/0/D40.eff: 33M
/tftpboot/digium/0/D70.eff: 33M
/usr/lib64/libwireshark.so.2.0.10: 55M
/usr/java/jre1.7.0_05/lib/rt.jar: 52M
/usr/lib/locale/locale-archive: 95M
/root/installer-tmp/tmp/install.img: 138M

… I still don’t understand where the last 21 GB is…

the options to du that Dicko suggested didn’t work on my distro, here is what I use…

[root@vps1412129802 /]# du -h --max-depth 1 /
4.0K	./srv
164K	./dev
798M	./var
4.0K	./media
4.0K	./mnt
176M	./lib
48K	./tmp
4.0K	./selinux
61M	./opt
1.1G	./usr
4.0K	./htdocs
5.8M	./bin
28K	./kickstart-sourcefiles
du: cannot access `./proc/4627/task/4627/fd/4': No such file or directory
du: cannot access `./proc/4627/task/4627/fdinfo/4': No such file or directory
du: cannot access `./proc/4627/fd/4': No such file or directory
du: cannot access `./proc/4627/fdinfo/4': No such file or directory
0	./proc
13M	./sbin
138M	./root
0	./sys
111M	./home
16K	./lost+found
22M	./boot
2.7G	./tftpboot
52M	./etc
5.0G	.
[root@vps1412129802 /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        19G  5.2G   13G  29% /
tmpfs           504M     0  504M   0% /dev/shm

or you could do something like

du  --max-depth 2 / | sort -n

But your values make more sense. The du command tells that you have ca. 5 GB data used. The same does df-

I have about 21 GB difference between the two. That’s what is getting me puzzled!

The only thing I can think of is an open file, but I didn’t think the local filesystem did anything funny with open files. Have you tried rebooting?

D’oh! That helped, thanks!

I still find it somewhat strange… something is eating up the space.

The reboot fixed it? Yes, it is strange.

This may help, or may send you down a rat hole… No promises.

lsof | sort -n -k 7

If I am remembering my unix correctly (and some quick googling), df will include the space for files that are open by a process that were deleted while the process had them open.

Above will show open files, sorted by size.

Thanks again for your help! I’m not sure this new command told me anything…

Here are some of the bottom lines:

httpd 1409 asterisk mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
java 1525 asterisk mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
lsof 4315 root mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
lsof 4317 root mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
mysqld_sa 1172 root mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
safe_aste 1708 root mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
sort 4316 root mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive
startup.s 1495 asterisk mem REG 8,2 99158576 1311720 /usr/lib/locale/locale-archive

if the last number is the size, I’m not really alarmed. If it’s the one before that however…