Why is my external USB hard drive sometimes completely inaccessible?

To determine whether the problem is the drive or the enclosure, remove the drive from the enclosure, install it in a desktop with sufficient power and check the smart status.

For a deeper test, you can check every sector of the drive utilizing tools like ddrescue. ddrescue will report error size during the process and you can attempt data recovery at the same time as in: sudo ddrescue /dev/sdb2 /path/to/recovery.image logfile. List the partitions with sudo lsblk or classic fdisk -l.

If you truly have no interest in the data you can force the output file to /dev/null as in:

sudo ddrescue --force /dev/sdc /dev/null logfile 

and you'll still get a report on any error size on stdout

Tested on Ubuntu 14.04 with GNU ddrescue 1.17 as follows inthis short example using /dev/sdb2 (a 1MB swap partition)

$ sudo ddrescue --force /dev/sdb2 /dev/null logfile


GNU ddrescue 1.17
Press Ctrl-C to interrupt
rescued:      1024 B,  errsize:       0 B,  current rate:     1024 B/s
   ipos:         0 B,   errors:       0,    average rate:     1024 B/s
   opos:         0 B,    time since last successful read:       0 s