0

I have a problem in my external hard drive 5tb samsung. When I try to delete some files (just some files), I receive an error:

/bin/rm: cannot remove 'file': input/output error

Everything began when I used FreeFileSync to sync a folder from my computer to the ext hd. The files with problem are all of the files in .Trash-1000 and sync.ffs_lock.

Some files appear in the ls output with an * in the end, why that?

An example of ls output (I cannot delete none of these files/folders):

d?????????    ? ?       ?               ?            ?  Colony/
-rwxrwxrwx    1 camargo camargo    282224 ago  4  2017  Cover.jpg*

Whe I do file in files/folders with ?, I got an error:

file Colony
Colony: cannot open `Colony' (Input/output error)

But when I do file in the file with an * it seems ok, and when I try to remove with rm, it returns $?=0, but the file are not removed.

file Cover.jpg 
Cover.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=12, height=1651, bps=0, PhotometricIntepretation=RGB, orientation=upper-left, width=1213], baseline, precision 8, 441x600, frames 3

What I tried

1) ntfsfix /dev/sdc1

Says that it is ok with the drive.

2) rm -rf file or sudo rm -rf file or chown $USER:$USER file && rm -f file

Same error message

3) Oppened in gnome-disks and scan filesystem (there are no errors) and correct filesystem

Same behavior after.

Sunfloro
  • 194
  • 1
  • 11
  • 1
    See [this answer of mine](https://superuser.com/a/1144611/432690). I'm not voting to close as duplicate because your issue is somewhat different and I'm not sure `chkdsk /f` in Windows is the right first step. Nevertheless `ntfsfix` is limited and these question marks and `input/output error` probably indicate filesystem corruption and maybe a hardware problem. Have you ruled out the latter? What does SMART say about the drive? Anything interesting in `dmesg` when the error occurs? – Kamil Maciorowski Jun 29 '19 at 19:52
  • Please [edit] the question and place the relevant information there. – Kamil Maciorowski Jun 29 '19 at 21:49
  • Thanks for your answer! I guess I can't run SMART in an external hard drive over USB (can I?), in gnome-disks the SMART option for this drive is unavailable. `dmesg` shows almost nothing when I tried to remove that files, but when I disconnect the drive the only error I got are this one: ``` [147487.632078] sd 6:0:0:0: [sdc] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK ``` Should I try chkdsk? It is a very weird problem, difficult to guess if is a hardware or filesystem problem. – Sunfloro Jun 29 '19 at 21:55
  • [Another similar problem](https://superuser.com/q/1390325/432690), another answer from me. You can try to use `smartctl` with a hard drive connected via USB. Most enclosures support this, some old ones don't. – Kamil Maciorowski Jun 29 '19 at 22:01
  • Tried: `sudo smartctl -a -d scsi /dev/sdc` and got `SMART Health Status: OK`, smart support is available but disabled. When I tried to run the short or long test I got `[unsupported field in scsi command]`. The drive is ok then? – Sunfloro Jun 29 '19 at 22:13
  • Cannot tell. Do you really need `-d scsi`? – Kamil Maciorowski Jun 29 '19 at 22:17
  • Yes, I tried withoud -d scsi and it returned `/dev/sdc: Unknown USB bridge [0x0bc2:0xab28 (0x100)]` – Sunfloro Jun 29 '19 at 22:20
  • Consider `badblocks` (Linux) or `chkdsk /r` (Windows) to detect hardware problems. Sole `chkdsk /f` may be enough if the hardware is healthy. At the moment I cannot help you further. – Kamil Maciorowski Jun 29 '19 at 22:29
  • I run the `chkdsk D: /f` and it made a lot of corrections althoug the strange files are still there and cannot be removed, same behavior as before. In output said that were no erros in disk too. Tried `badblocks /dev/sdc` but got `...invalid end block (4883770583): must be 32-bit value`. – Sunfloro Jun 29 '19 at 23:44
  • I tried to remove the files in Windows and I could remove most part of them, but not all (I couldn't remove all, but some of them were moved from .Trash-100 to RECICLED.BIN. The another weird thing is that it removed 33.2 TB of files... The chkdsk also removed some sync.ffs_lock weird files that couldn't be remove. – Sunfloro Jun 30 '19 at 00:25
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/95542/discussion-between-kamil-maciorowski-and-octavius). – Kamil Maciorowski Jun 30 '19 at 05:54

0 Answers0