# increased kern.maxfiles now FileSystem is full



## ColdfireMC (Nov 9, 2012)

hi


Some hours ago I increased kern.maxfiles to 20000 because repeated "exceeded limit" messages. Once restarted, everything runs fine, but I started to build math/octave and some minutes after system started to go very slow, and every time slower, at the point of X was completely frozen. So I decided to halt, switched to TTY and once started halt, vnrlu was stopped by timeout and bufdaemon spent several minutes to complete(about *15 minutes*), but system halted successfully. When I started again, I have noticed that free space decreased from 20GB to 0. I have cleansed ports tree but I only recovered 1GB, so, I want to know, where are those 20GB and why are there, are they lost data? Are they erasable? Is this limit (kern.maxfiles) reasonable? If not, what is the reasonable value?


Thanks


----------



## jb_fvwm2 (Nov 9, 2012)

```
find /usr/ports -type d -name work -execdir du -h \; | tee -a /tmp/size.fil
find /usr/ports -type d -name work -execdir pwd \; | tee -a /tmp/size2.fil
```
Comparing those two files (the first won't have port names, the second will) may show which work accumulated size. OTOH there are one-liners in the forum somewhere that would clean them all in one pass...
I've used one but forgotten it already.
You can start simpler, just by doing the math ones, etc...

```
find /usr/ports/math ...
```


----------



## SirDice (Nov 9, 2012)

jb_fvwm2 said:
			
		

> OTOH there are one-liners in the forum somewhere that would clean them all in one pass...


`# rm -rf /usr/ports/*/*/work`


----------



## xtaz (Nov 9, 2012)

This is why I like to set WRKDIRPREFIX=/usr/obj in /etc/make.conf. Then the ports tree is kept clean and if anything goes wrong in the middle of a compile I can just run

`# rm -r /usr/obj/usr/ports/*`

which is probably a lot quicker than iterating through the entire ports tree.


----------



## cgigeek (Nov 16, 2012)

```
find /usr/ports -type d -name "work" -mindepth 3 -maxdepth 3 | sed "s:work::g" | awk '{print "make clean -C "$1}' | sh
```

(full paths if you going to cron it)


----------



## wblock@ (Nov 16, 2012)

I use

```
find -X /usr/ports -name work -type d -depth 3 -prune -print -exec rm -rf {} \;
```


----------



## ColdfireMC (Nov 18, 2012)

ok is solved

your scripts worked, but the biggest file was a dumped core, i erased it and freespace increased 15gb D:, was a vlc player dumped core.

thanks for your help


----------

