Compared with desktop computers, iPad is unable to inform the storage device of probably approaching disconnection from the ongoing writing process so it always causes your files on the external flash drive corrupted. Meanwhile, it cannot detect and scan/repair corrupted storage device. Therefore, the bluntest but elective dismount of the external hard drive you can takes is shut down your iPad completely before disconnecting the drive.
Hope this answer helps you deal with corrupted files in the external hard drive. Take care~