Appliance Disk full

From Swivel Knowledgebase Wiki

Jump to: navigation, search

Image:logo.gif

Contents

Symptoms

Log files fill the disk space as they are not correctly being purged.

The following command may show the disk space usuage as 100%

df –k

/dev/sda3 Use 100% Mounted on /backups


The following command may be of use in viewing where the disk usage is:

du -h --max-depth=1

Where depth is the number of folders to look within


/var/log/messages

Log files may build up in /var/log/messages


/var/lib/mysql

Transaction logs may build up in /var/lib/mysql, this is caused by A/A appliances being out of synchronisation. The transaction logs consist of binaries that contain data edits and/or relays that is information sent to a MySQL slave.


PINsafe 3.7.3727

Pinsafe 3.7.3727 contains debugging information for Repository syncs that may produce a large number of files and the files may need to be purged. To prevent the files being generated upgrade to a more recent version of PINsafe. As a temporary measure they can be deleted and a low frequency of repository sync can be set. The files are named:

profile.<date>.data

and reside in:

<path to Tomcat>/webapps/pinsafe/WEB-INF/logs


Prerequisites

The error has been seen on the following systems:

Appliance build 2.0.10


Error Messages

ERROR - Saving the XML config file "/usr/local/tomcat/webapps/pinsafe/WEB-INF/conf/config.xml" failed, error: java.io.IOException: No space left on device.

java.io.IOException: No space left on device at java.io.FileOutputStream.writeBytes(Native Method)

The above message can be seen when there are Tomcat errors related to no disk space.


cp: cannot create regular file ‘/backups/.default/tomcat/logs………. No space left on device

The above error message can be seen when performing a backup.


Solutions

Purge script fix

Edit the following script /etc/cron.daily/PINsafe_backup_purge.sh

There are two lines in that script that should read

 p_arch=`grep "archives" /etc/pinsafe.conf|cut -d\= -f2`
 p_logs=`grep "logs" /etc/pinsafe.conf|cut -d\= -f2`


Manually deleting files

Note: Take care when using the rm command so that only the correct files are deleted. Deleted files can only be recovered from valid backups.

The following commands are run from the command line, see Command Line Access How to guide

  • Ensure that you are in the correct directory
  • Using ./filename or ./folder ensures that only the file or folder with the directory is removed.

If there are too many files to list then the following command can be used to remove the files. This example is for files within the Tomcat logs folder which will delete all instances of localhost.

find . -iname 'localhost.*' | xargs rm


Deleting log files

To delete log files older than 5 days the following commands can be used.

find /var/log/tomcat/ -iname 'localhost.*' -mtime +5 | xargs rm


find /var/log/tomcat/ -iname 'manager.*' -mtime +5 | xargs rm


find /var/log/tomcat/ -iname 'catalina.*' -mtime +5 | xargs rm


find /var/log/tomcat/ -iname 'admin.*' -mtime +5 | xargs rm


find /var/log/tomcat/ -iname 'host-manager.*' -mtime +5 | xargs rm

Personal tools