Corrupted files..

Hello there,

I am running DietPi for a few weeks now and didn’t have any issues so far. Yesterdays I copied files via Samba to my Windows client and it was extremely slow (several bytes per second). After an hour I cancelled the transfer and decided to reboot the pi using the shell. Afterwards everything was back to normal. Today I wanted to delete a directory over Samba and while all files got deleted the directory itself was still there. So I opened the shell and tried to delete the directory, without success:

 rm -rf delete/
rm: das Entfernen von 'delete/files1.rar' ist nicht möglich: Ungültige Nachricht
rm: das Entfernen von 'delete/files2.rar' ist nicht möglich: Ungültige Nachricht

When I list the files in the directory, this is the result:

ls -l
ls: Zugriff auf 'files1.rar' nicht möglich: Ungültige Nachricht
ls: Zugriff auf 'files2.rar' nicht möglich: Ungültige Nachricht
insgesamt 0
-????????? ? ? ? ?            ? files1.rar
-????????? ? ? ? ?            ? files2.rar

As you can see those files seem to be corrupted. I cannot delete the whole directory nor can I delete a single file. Those files are placed on an external drive connected via USB, not the SD card. The drive was never removed and the raspberry only got rebooted using the shell. Does anyone have a clue how this could be happened? It could be possible that those files were written when I decided to reboot the pi, but I guess the drive should be unmounted before rebooting without leaving corrupted files.

Those files seem to be the only one that are affected, but since I cannot delete them I will have to format the whole drive again…

try to fix the /dev/sdX via fsck

bash#: fsck --help or fsck -? maybe solve your question

I was able to repair the drive using fsck. Today I found some new corrupt files. I tried using smartctl to read the SMART values of the drive, but I won’t get any more information than that:

SMART Health Status: OK
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging

Any further advices?