Page 1 of 1

USB integrity check

PostPosted: 01/04/2015, 8:49
by massimo.iorio@wildix.com
Symptom:
No event is present in CDR, no Fax/Voicemail is stored and sent via email.

Diagnosis:
In most cases such data is stored on the USB device (check the partition added for storage of CDR, Voicemail, Faxes in WMS Settings > System > Storages).
It is necessary to check the eventual problem with the USB device:

SSH access to the PBX;
acquire administrator permissions;

Run the command below:
Code: Select allls -laR /mnt 2>>test>>/dev/null

Where:
ls -laR : read all files from "/mnt", so all the files stored in the storage device;
/ : path where to start the check;
2>>test>>/dev/null : write all errors in test file and no video output is generated.

3. After this, it is possible to read the test file
Code: Select allcat test


A log example is provided below:

Code: Select allroot@wildixgw:/home/admin# cat test
ls: reading directory /dev/shm/var/spool/callweaver/monitor/29/INBOX: Input/output error
ls: reading directory /dev/shm/var/spool/callweaver/voicemail/29/INBOX: Input/output error
ls: cannot access /mnt/backups/uploads: Input/output error
ls: cannot open directory /mnt/backups/uploads: Input/output error
ls: reading directory /mnt/cdr/29/INBOX: Input/output error
ls: reading directory /mnt/cdrcsv/29/INBOX: Input/output error
ls: reading directory /mnt/cticonnect/29/INBOX: Input/output error
ls: reading directory /mnt/faxes/29/INBOX: Input/output error


From the log it is clear that the blackout and wearing out of the USB device are the main causes of these errors.

Solution:
Connect the PBX to a UPS and use Wildix SLC USB device as a storage.

To recover the stored data that had been damaged, use a tool like fsck (File System Consistency Check).

    - Umount all partition from Setting > Storage;
    - run fsck command via shell.

Code: Select allroot@wildixgw_test:/home/admin# fsck -a /dev/sda1
fsck 1.41.3 (12-Oct-2008)
/dev/sda1 primary superblock features different from backup, check forced.
/dev/sda1: 81/65536 files (12.3% non-contiguous), 102102/262079 blocks


Retry twice the last step, if the errors are still present, you have to change the USB device.
We suggest to use always SLC memory to prevent errors on USB http://en.wikipedia.org/wiki/Multi-level_cell