Help fix database?

I am using PBX Version 2.210.62-2

This morning the system was hung or non-responsive, our only recourse was to shut the power off and restart. This normally works without a hitch. But this morning, the server restarted but asterisk did not start. Looking at the log file /var/log/asterisk/full I found these log entries.

[2013-04-03 12:02:44] VERBOSE[16418] config.c: == Parsing ‘/etc/asterisk/asterisk.conf’: [2013-04-03 12:02:44] VERBOSE[16418] config.c: == Found
[2013-04-03 12:02:44] WARNING[16418] db.c: Couldn’t prepare statement ‘CREATE TABLE IF NOT EXISTS astdb(key VARCHAR(256), value VARCHAR(256), PRIMARY KEY(key))’: disk I/O error
[2013-04-03 12:02:44] WARNING[16418] db.c: Couldn’t create astdb table: disk I/O error

To me it looks like the database that asterisk uses is corrupt. Can someone confirm this and instruct me the proper way to repair?
I would try to restore from backup but the option is not available now in FreePBX.

Thank you in advance for your help!


that was probably the cause of the initial hang as well. also i am not sure what you mean by the restore feature not being in freepbx. does that mean you are not doing backups?

I have the system do weekly backups, but the [Admin]>{Backup & Restore] Menu is grayed out at this moment! I am not sure how to do a work around at this point.

then i would simply do a refresh install of the system and a restore using your backup. which version are you using?

The version is show as FreePBX 2.210.62-2

of the system?

I believe you have a damaged harddrive. you need to run fsck on your / partitions, there is a caveate in that you can’t do that on a mounted file system.

from bash type


and see where your / partition is mounted, boot from your install disk and choose recover or whatever , and then run

fsck /dev/sda1 or whatever your you found your / partition to be mounted on.