ClearlyIP’s Tips and Tricks
Have you ever received an email like this coming from your CIP Appliance:
/dev/mapper/SangomaVG-root is 75% full ?
Every client scenario is different, but our appliances CIP are set up to send an email when 75% of the HD is used, and for those who would like to know what is using your hard drive space here is today’s tips & trick for.
The only thing is all these steps have to be done in the Linux Command Line Interface (CLI), so fire up your terminal emulator and log into your PBX’s using SSH protocol.
To start we need to know the status of our Hard Drive. To do that we execute the following command:
df stands for Disk Free and -h means human-readable
The output of the command is:
The line of our interest is the one that tells us the disk is 79% used.
But what if you want to see what folder or directory is using a lot of disk space.
With the command du -h –max-depth=1 we can see it
du means Disk Usage, -h, as before, human-readable, and the option –max-depth=1 means the program will go down one level below the current directory and print how much space is using the directories below our current working directory.
So we will go to the root directory / with the command cd / and execute
du -h –max-depth=1
For our example, we can notice the /var directory is the one that is eating all the HD. Now let’s see what folder under /var is using more space. For this, we just move to that directory with the command cd /var and execute the du command as well.
As you can see there are four directories that are eating a lot of space: lib, log, spool, and www
Now let’s see the disk usage for the spool directory by moving to that directory with the command cd spool and run du -h –max-depth=1 again.
Here is the output.
As you can see the folders asterisk, monitor, and backup are the ones you are using almost all of our disk space.
We can conclude that the combined use of the commands cd and du -h –max-depth=1 gives you a better understanding of how your Hard Drive is being used by all the applications associated with your Telephony service. With this, you can make the best decision on what to do with your files, free disk space, and keep your PBX in its optimal state.