On Wed, 25 Mar 2015 14:31:44 +0000 "Anderson, Ally" A.Anderson@tees.ac.uk wrote:
Hi Morten
Many thanks for the prompts response
No problem. Please do remember do Cc: the nav-users list when responding, unless revealing private information.
We are running the 4.2.2 distribution. This was installed using the package management system on a 10Gb disk with a single partition. This has been running for almost two years now.
I will assume this means you are using a stable version of Debian GNU/Linux as your OS.
Is this a virtual machine? 10GB sounds awfully small compared to most modern physical drives, even looking two years back - I would not run NAV in production on such a small drive. Just the OS itself would take up a large chunk of those 10GB, so I would strongly suggest that you increase the drive size.
Not entirely sure what has filled the disk, but the ARP/CAM tables would make sense. If you could point me in the right direction I will check
With only 10GB to go on, it could be anything. But I would typically guess log files or the PostgreSQL database. Use the `du` command to figure out where in the directory structure the disk space is being used:
du -csh /* | sort -h
To see how much space PostgreSQL takes up, run:
du -csh /var/lib/postgresql
Any help you could offer in clearing these down after a specific number of days has elapsed would be appreciated.
Once PostgreSQL is taking up X amount of space, it doesn't help to delete records to help the OS reclaim that space. The unused space is still allocated to PostgreSQL, which will re-use it when it needs to.
After deleting a bunch of records, a full vacuum (with downtime) of the database must usually be issued to let the OS reclaim the disk space:
sudo -u postgres vacuumdb --full
See http://www.postgresql.org/docs/9.1/static/sql-vacuum.html .
Regular record deletion will, of course, help maintain the database at a reasonable size. NAV comes with the navclean command, which can delete old log records from NAV's database. See
/usr/lib/nav/navclean.py -h
for more details. If the default expiry limit of 6 months is OK for you, you could set up a daily cron job to run something like this:
/usr/lib/nav/navclean.py -f --arp --cam
Thanks
Ally
Haha, apologies for the Mr. Anderson quip; With no first name to go by, I just couldn't resist a reference to the Matrix ;-)
Hi Morten
That's fantastic - thanks for your patience with such a novice - the help will be invaluable.
Not a problem with the name - I've been called far worse :)
You guys are doing a great job - we are well impressed with the software.
Thanks again
Ally
-----Original Message----- From: Morten Brekkevold [mailto:morten.brekkevold@uninett.no] Sent: 26 March 2015 07:31 To: Anderson, Ally Cc: nav-users@uninett.no Subject: Re: Hard Disk Full
On Wed, 25 Mar 2015 14:31:44 +0000 "Anderson, Ally" A.Anderson@tees.ac.uk wrote:
Hi Morten
Many thanks for the prompts response
No problem. Please do remember do Cc: the nav-users list when responding, unless revealing private information.
We are running the 4.2.2 distribution. This was installed using the package management system on a 10Gb disk with a single partition. This has been running for almost two years now.
I will assume this means you are using a stable version of Debian GNU/Linux as your OS.
Is this a virtual machine? 10GB sounds awfully small compared to most modern physical drives, even looking two years back - I would not run NAV in production on such a small drive. Just the OS itself would take up a large chunk of those 10GB, so I would strongly suggest that you increase the drive size.
Not entirely sure what has filled the disk, but the ARP/CAM tables would make sense. If you could point me in the right direction I will check
With only 10GB to go on, it could be anything. But I would typically guess log files or the PostgreSQL database. Use the `du` command to figure out where in the directory structure the disk space is being used:
du -csh /* | sort -h
To see how much space PostgreSQL takes up, run:
du -csh /var/lib/postgresql
Any help you could offer in clearing these down after a specific number of days has elapsed would be appreciated.
Once PostgreSQL is taking up X amount of space, it doesn't help to delete records to help the OS reclaim that space. The unused space is still allocated to PostgreSQL, which will re-use it when it needs to.
After deleting a bunch of records, a full vacuum (with downtime) of the database must usually be issued to let the OS reclaim the disk space:
sudo -u postgres vacuumdb --full
See http://www.postgresql.org/docs/9.1/static/sql-vacuum.html .
Regular record deletion will, of course, help maintain the database at a reasonable size. NAV comes with the navclean command, which can delete old log records from NAV's database. See
/usr/lib/nav/navclean.py -h
for more details. If the default expiry limit of 6 months is OK for you, you could set up a daily cron job to run something like this:
/usr/lib/nav/navclean.py -f --arp --cam
Thanks
Ally
Haha, apologies for the Mr. Anderson quip; With no first name to go by, I just couldn't resist a reference to the Matrix ;-)
-- Morten Brekkevold UNINETT