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?
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)
Here is the GParted window showing the same disk:
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?