1

I have a 2TB NTFS formatted USB drive attached to a Raspberry Pi which I use as a NAS. I can access the drive through the Linux terminal and see all the files, and I can also access all the files from my Windows PC through Samba.

When I unplug this drive from the Pi (after shutting down of course) and plug it into my Windows PC, it is not recognized at all. My symptoms include:

  • Opening Windows Explorer sometimes causes explorer.exe to hang/crash (until I unplug the hard disk)
  • Other times, the disk shows up as "Local Disk (H:)" with no storage information. Double-clicking on this causes explorer.exe to hang/crash until I unplug the hard disk.
  • Disk management also hangs when the disk is plugged in, and only responds when I unplug the hard drive

I have tried running chkdsk H: from elevated command prompt - absolutely nothing happens. Just a blank console. I left this for 2 hours and still nothing happened. I have tried this on multiple Windows machines.

When I run TestDisk from the Pi, it recognizes the partition table and shows that it is a primary NTFS partition.

I can access all the files from a Linux environment (RPi) so I know that the disk works, so why is Windows not recognizing it?

EDIT1: Output of sudo fdisk-l /dev/sda:

pi@raspberrypi ~ $ sudo fdisk -l /dev/sda

Disk /dev/sda: 2000.4 GB, 2000398933504 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029167 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x73736572

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  3907040129  1953519041    7  HPFS/NTFS/exFAT

EDIT2: I ran GParted and TestDisk from a GParted Live CD. Below is a screenshot of the TestDisk terminal showing that an NTFS partition exists on the drive (I had to take with my phone because I don't know how to deal with screenshots on GParted) enter image description here

Here is the GParted window showing the same disk: enter image description here

So it seems that the information from the two tools is conflicting. GParted tells me that before I can create a partition, I must create a partition table which will erase all the data from the disk. I cannot do this because there is a load of data on it which is not feasible for me to transfer elsewhere.

Another thing I noticed is that TestDisk shows the partition size as 3,907,038,082 sectors, but GParted shows the total sectors as 3,907,029,167, implying that the partition length is incorrect somehow.

Is there still some way I can repair the partition table without losing all of my data?

9
  • What does diskpart says ? Type list disk, list volume and list partition. What does a gdisk -l /dev/<path_to_disk> says on GNU/Linux ?
    – piernov
    Mar 4, 2014 at 21:31
  • diskpart hangs when I run any of those commands. Edited question to show output of gdisk -l
    – nagyben
    Mar 4, 2014 at 21:39
  • Sorry, I'm too accustomed to GPT disks. Here you have an MBR disk, so the command to use is fdisk. (but even with gdisk you shouldn't get this sort of output) So I ask again : What does a fdisk -l /dev/<path_to_disk> says on GNU/Linux ?
    – piernov
    Mar 4, 2014 at 21:57
  • edited original. Thanks for your ongoing help though!
    – nagyben
    Mar 4, 2014 at 22:16
  • gdisk was showing something strange, but since fdisk is right, there shouldn't be any problem. What is the Windows version you're using ? And about the USB drive, is it a 2.5" or 3.5" ? Has it an external power supply ? Is it USB 2.0 or 3.0 ? Do you connect it to USB 2.0 or 3.0 ? (sorry, so many question and I may be not even able to figure out the problem)
    – piernov
    Mar 4, 2014 at 23:53

0

You must log in to answer this question.

Browse other questions tagged .