Question "File or directory is corrupted and unreadable" Error

fastshot

Distinguished
May 7, 2014
44
0
18,530
I run a dual boot windows 10 & ubuntu on my PC. Rarely I work with windows but this error occurs only in windows environment, not ubuntu's, from last month. I've got a certain folder in my "storage" NTFS partition (which is named E: in windows and /dev/sda6 in ubuntu) and, every time I try to access it from windows I get "File or directory is corrupted and unreadable" error.
I've tried to copy this folder from E: to C: (where windows is installed) and all works fine there therefore I think it's an only E: partition related issue.

I've already run 2 HDD tests to establish if it's a bad sectors issue and these are my results:
- CrystalDiskInfo 7.7.0
Code:
    OS : Windows 10  [10.0 Build 17763] (x64)
  Date : 2023/09/02 12:53:50

-- Controller Map ----------------------------------------------------------
 + Controller AHCI SATA standard [ATA]
   - WDC WD1003FZEX-00K3CA0
 - Controller AHCI SATA standard [ATA]
 - Controller spazi di archiviazione Microsoft [SCSI]

-- Disk List ---------------------------------------------------------------
 (1) WDC WD1003FZEX-00K3CA0 : 1000,2 GB [0/0/0, pd1] - wd

----------------------------------------------------------------------------
 (1) WDC WD1003FZEX-00K3CA0
----------------------------------------------------------------------------
           Model : WDC WD1003FZEX-00K3CA0
        Firmware : 01.01A01
   Serial Number : [...]
       Disk Size : 1000,2 GB (8,4/137,4/1000,2/1000,2)
     Buffer Size : Unknown
     Queue Depth : 32
    # of Sectors : 1953525168
   Rotation Rate : 7200 RPM
       Interface : Serial ATA
   Major Version : ACS-3
   Minor Version : ACS-3 Revision 3b
   Transfer Mode : SATA/600 | SATA/600
  Power On Hours : 11941 hours
  Power On Count : 4344 count
     Temperature : 34 C (93 F)
   Health Status : Good
        Features : S.M.A.R.T., 48bit LBA, NCQ
       APM Level : ----
       AAM Level : ----
    Drive Letter : C: E:
- wester digital Data Lifeguard Diagnostic for Windows
Code:
Test Option: EXTENDED TEST 
Model Number: WDC WD1003FZEX-00K3CA0 
Unit Serial Number: [...] 
Firmware Number: 01.01A01 
Capacity: 1000.20 GB 
SMART Status: PASS 
Test Result: PASS 
Test Time: 14:58:33, September 02, 2023
So it's not a hardware HDD issue in my opinion, do you agree?

I've run a test on E: drive to check its file system while windows was running on and this is the result (sorry if it's not in english!)
Code:
Chkdsk eseguito in modalità analisi su uno snapshot di volume.  

Controllo in corso del file system su E:
L'etichetta del volume è STORAGE.

Fase 1: analisi della struttura del file system di base in corso...
                                                                                       
  115600 record file elaborati.                                                         Verifica file completata.
                                                                                       
  465 record di file di grandi dimensioni elaborati.                                                                                                              
  0 record file non validi elaborati.                                      
Fase 2: analisi del collegamento dei nomi file in corso...
    Rilevata struttura file di base danneggiata per "<0x5,0x3536>"
        ... in coda per la riparazione offline.
[...]
As you can see in step 2 ("fase 2") there's the first one of many sectors with errors but this test establishes only logical errors, doesn't it?

All that said:
- Do you know why this error occurs only in windows and not in ubuntu?
- Can we be sure my WD HDD has got no hardware damages?
- Is it possible to establish the cause of this error? I mean I'd want to know if I did something wrong so I'll avoid that in future;
- How to fix it?
 
Hi Ralston18, I try to give you a translation based on what I've found around the web about Chkdsk in english.

"Fase 2: analisi del collegamento dei nomi file in corso..." would be:
"Stage 2: Examining file name linkage ..."

"Rilevata struttura file di base danneggiata per "<0x5,0x3536>"" would be:
"Found corrupt basic file structure for "<0x5,0x3536>""

"in coda per la riparazione offline" would be:
"queued for offline repair."

And there're many other entries for this kind of output in "stage 2"; I've saved the "event manager" file with the complete list as a txt.

Use WD's diagnostic tools to check the WD HDD.
Afaik this tool is the one I've used above ("western digital Data Lifeguard Diagnostic for Windows"). If not, what do you refer to?

Now can we be sure this issue is related only to logical errors and not physical ones?
What about the 3 questions I asked above?
 
Regarding the three questions:

1) Error only in Windows:

Is Samba or SSHFS installed? As I understand it, one or the other is needed in order for Windows and Unbuntu to share files. Perhaps the Samba or SSHFS installation and/or configuration is corrupted or buggy.

2) WD HDD damage.

Very much need to rely on the manufacturer's diagnostic tools. Maybe run some other third party tools.

Or use Microsoft's tools (chkdsk):

https://learn.microsoft.com/en-us/w...ion/windows-commands/chkdsk?tabs=event-viewer

https://learn.microsoft.com/en-us/t.../troubleshoot-data-corruption-and-disk-errors

3) Fixing the cause:

May be fixable but the cause is unknown at the moment.

Going out of my comfort zone but there may be some "loop" involved. Some Windows issue gets fixed but then Unbuntu is corrupted. Fixing Unbuntu then corrupts Windows again.

Hopefully there will be some other ideas and suggestions posted.

If not, it moving this thread to Open Source may solicit additional ideas and suggestions from that community.
 
I've just tried to access that folder again from windows (C: ) and everything works fine now though I didn't do anything to fix that issue! Then I've run check disk another time and no error is reported. What's your opinion about all that? I mean the "cause" of all that.
If it could be important my windows release is "Windows 10 Enterprise LTSC 10.0.17763 build 17763".

Before that I tried to establish if something related to samba or SSHFS was present and set on my windows properties and I found these 2 entries:
- smb 1.0/cifs file sharing support -> not ticked
- smb direct -> ticked
Anyway consider this NTFS partition ("E:" by windows aka "sda6" by ubuntu aka "storage") is "indipendent" by the 2 bootable OSS, flagged as "msftdata" and I haven't ever installed or modified anything to "share" it anyhow, if this could be interesting.

By the way I saw E: was 77% fragmented and I performed a defragmentation in windows environment. Afaik ubuntu doesn't write data "randomly" as windows does but it writes them in "sequence", does it? If yes and considering I use windows very rarely, why does windows say they're so fragmented?