I had same problema with a AVC792H AVTECH DVR, I solved putting the HD on another AVTECH DVR and clearing it there, after that took the HD and pput it back in the original DVR and started the clearing function and it performed it and it work good.
My conclusión it is not a hardware failure it is a write HD error. Once it was working good I upgrade the firmware.