Windows – Confirm HDD errors were due to USB enclosure not supporting large capacity drives

external hard drivewindows

I suddenly started getting errors when copying files to my external hard drive. There is plenty of free space: 1.64TB free of 3.63TB. I was able to complete the file copy by doing one of two things:

  1. Deleting some large files from the external hard drive, first
  2. OR putting the HDD in a different USB enclosure

In addition, the Windows 8 error checking tool fails with an error unless a different USB enclosure is used (deleting large files does not help in this case). The CHKDSK command-line tool always works and reports no errors on the disk.

How do I confirm the USB HDD enclosure was the problem? (I would like to confirm the problem was not with my hard drive and it is safe to continue using.) And how can I determine the capacity supported by a USB HDD enclosure?


detailed info:

The error when copying a large file:

enter image description here

  • The code 0x80070057 seems to be a fairly generic code.
  • Right after getting this error, I successfully copied a 2GB file. I tried copying the same file again (for 4TB total) and get the same error.
  • In the system event logs, this seems to be logged each time a copy fails: "The shadow copies of volume D: were aborted because of an IO failure on volume D:."

Windows 8 error checking tool error:

  • After failing it opens up the Windows event viewer with some error related to the volume shadow copy. (Forgot to record the details about this one)

Hardware:

  • Enermax Jazz 3.5 USB HDD enclosure (This one causes errors; it's quite an old model.)
  • Leto DATACLONE3.0 USB HDD dock (This one seems to have no errors; much more recent model.)
  • Western Digital 4TB GREEN hard drive WD40EZRX

File system:

  • GPT (2TB MBR drive was cloned to 4TB drive, then partition table converted to GPT)
  • NTFS

System:

  • Windows 8
  • Lenovo X1 Carbon laptop

update: More details from "The shadow copies of volume D: were aborted…" logged event:

System 
  - Provider 
   [ Name]  volsnap 
  - EventID 14 
   [ Qualifiers]  49158 
   Level 2 
   Task 0 
   Keywords 0x80000000000000 
  - TimeCreated 
   [ SystemTime]  2015-01-24T21:23:54.296013300Z 
   EventRecordID 1063256374 
   Channel System 
   Computer X1-Carbon 
   Security 
- EventData 
   \Device\HarddiskVolumeShadowCopy6 
   D: 
   D: 
   0000000003003000000000000E0006C00A0000000D0000C002000000000000000000000000000000 

update 2:

Error mounting the 4TB drive in Ubuntu with the dock that works from Windows:

Error mounting /dev/sdc1 at /media/daniel/DeskStar: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdc1" "/media/daniel/DeskStar"' exited with non-zero exit status 13: ntfs_attr_pread_i: ntfs_pread failed: Input/output error
Failed to read NTFS $Bitmap: Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

The drive isn't listed in in fdisk -l, so can't try dd
I tried hooking back up to Windows: no problem; Windows disk properties error checking tool reports no errors.

Also:

Tried using dd on the (problem?) enclosure with a different 2TB hard drive:

  • No error reading skip=0
  • No error reading skip=SOMEWHERE_NEAR_MIDDLE_OF_DRIVE
  • Errors reading sectors at end or near end of drive:
daniel@computer:~$ sudo dd bs=512 if=/dev/sdb1 of=test skip=3907026942 count=1
dd: ‘/dev/sdb1’: cannot skip: Invalid argument
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000210598 s, 0.0 kB/s

Best Answer

If it is the USB drive, and it is size-related, then the USB drive is failing to correctly process a sector write (and probably read, too) request. The file size does not matter. The cause is that the larger file has "pieces" falling beyond the addressable boundary.

Due to disk fragmentation, it is difficult to confirm or deny this hypothesis, but you can try with any tool which displays the disk fragmentation map. This should display a large disk with the beginning which is filling up, and nothing past a certain point. Not at the end, especially.

On a FAT32 disk you could try and fill the disk with small files, each 8Kb in size, until the "reachable" area was filled up and the disk became unwriteable. But the disk is NTFS and however the method isn't really very precise, or certain.

If at all possible, I would mount the disk on a Linux live distribution. At that point you could try and read the disk one sector at a time:

fdisk -l

will tell you how many 512-byte blocks are there in the external disk. Then

dd bs=512 if=/dev/sdc of=test skip=NNNNN count=1

will request a read of sector NNNNN (one-based :-) ).

If it is a matter of a limit to NNNNN, you will observe that:

N=1         it works
N=MAX_NUM   it fails
N=MAX_NUM/2 it fails

...

so you can start with a classic bisection algorithm and determine where the critical sector "C" lies (any sector before C is readable, any after is not). If such a sector exists, you've got either an incredibly weird hardware damage, or the proof you were looking for of the enclosure's guilt.

Update - finding the boundary by bisecting: an example

So let's say the disk is 4TB, so 8,000,000,000 sectors. We know that sector 1 is readable and sector 8-billion isn't. Let READABLE be 1, let UNREADABLE be 8. Then the algorithm is:

 let TESTING be (READABLE + UNREADABLE)/2
 if sector TESTING is readable then READABLE becomes equal to TESTING
 else, UNREADABLE becomes equal to TESTING.
 Lather, rinse, repeat with the new values of (UN)READABLE.
 When two consecutive values of TESTING are obtained, that's your boundary.

Let's imagine the boundary lies at sector 3,141,592,653 because of some strange bug in the enclosure.

 first pass: testing = (1 + 8000000000)/2 = 4000000000.
 4,000,000,000 is unreadable, so replace 8,000,000,000 with 4,000,000,000
 second pass: testing (1 + 4M)/2 = 2M
 sector 2M is readable, so replace 1 with 2,000,000,000
 third pass: testing (2M + 4M)/2 = 3M
 sector 3,000,000,000 is readable
 fourth pass: testing (3M + 4M)/2 = 3,500,000,000 which is UNREADABLE
 fifth: (3 + 3.5) / 2 = 3,250,000,000 UNREADABLE
 ...

So READABLE and UNREADABLE stalk the unknown boundary more and more closely, from both directions. When they are close enough you can even go and try all the sectors in between.

To locate the boundary, only log2(max - min) = log2(4TB - 0) = log2(4TB) = log2(240) = 40 (actually I think perhaps 42) sectors need to be read. Given a 30" reset delay on the enclosure when a reading error occurs, that should be 20 minutes at the most; probably much less.

Once you have the boundary B, to confirm it is a boundary you can do a sequential read of large chunks before B (this will not take too long), maybe one megabyte every gigabyte or so; and then a random sampling of sectors beyond B. For example the first 4*63 sectors beyond the boundary, then one sector every 3905 (or every RAND(4000, 4100) ) to try to avoid hitting always the same magnetic platter.

But actually, if you do find a boundary-like behaviour, and confirm that with another enclosure there is no such boundary -- well, I'd declare the case (en)closed.

Related Question