NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

Schorse's avatar
Schorse
Aspirant
Apr 21, 2016

system volume 'root' usage is large ==> PHP5 session ID's where not cleaned up

Hello,

 

I encontered a problem which may have its beginning somewhere end of 2015 (December). The log file reported

 

Volume: System volume root's usage is 88%. This condition should not occur in normal conditions. Contact technical support.

and the shares were not available. 

 

I have installed only a few apps

- PHP5

- PHPMyAdmin

- Wordpress

- Owncloud

 

During investigation I found, that there seems to be plenty of space on the 4GB root system (75%) but the free inodes where down to 21%.

 

I found also, that accidentaly I put 60MB backup of Owncloud to root / (Didn't know at this time, that root is limited to 4GB). After deleting there where any more logs about root usage to large.

 

More investigation showed that in /var/lib/php5 was a collection of 143MB session files and the number was uncountable (I'm not very familiar with Linux). That seems to cause the problem too. Normaly they should be deleted by the garbage collection of PHP5 itself. Looking for this showed me, that with Debian Linux the clean up defined in /etc/php5/apache2/php.ini is not activated as the variables session.gc_probability = 0 instead of 1. In http://serverfault.com/questions/511609/why-does-debian-clean-php-sessions-with-a-cron-job-instead-of-using-phps-built   one can read, that Debian sets up a cron job to delete this files. It is effectively onyl one line but very complex to understand for me:

 

# /etc/cron.d/php5: crontab fragment for php5
#  This purges session files older than X, where X is defined in seconds
#  as the largest value of session.gc_maxlifetime from all your php.ini
#  files, or 24 minutes if not defined.  See /usr/lib/php5/maxlifetime

# Look for and purge old sessions every 30 minutes
09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete

I found that this is not working for me, examine it step by step. But it works since I made a small change in the last part of the find comand - I removed the exclamation mark ( ! ) in front of the -execdir ...

 

... find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) -execdir fuser -s {} 2>/dev/null \; -delete

I do not understand why this was not discussed already and why is the same comand with exclamation mark also to be found on the link above? Is there another cause?

 

Nevertheless, since I made it the way shown, my /var/lib/php5 folder does contain only 27 files.

No RepliesBe the first to reply

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More