0

This is the ls -l result

I have a text file Summary_DataTypes.txt which was created by me earlier. It appears in lsand vs code. But does not show in the folder even if I do show hidden folder. I want to delete this file but sudo rm -f also not able to delete it. I also tried deleting it with sudo -s but it did not get delete.

I am getting

Error when getting information for file "fileName" : Input/Outout error.

Raffa
  • 32,237
PVD
  • 23
  • You'll have to give specifics, including the name of this file and its permissions. It is possible that the file you are trying to delete is being created by a program that is running. Of course there are other reasons as well. – Ray Feb 13 '24 at 14:04
  • @Ray Linux allows holding open descriptors to files without any hard links (i.e. deleted), so "being created" feels unlikely. – mcendu Feb 13 '24 at 14:07
  • Do you have an anti-virus service running on your system? that can prevent any type of access to a certain file ... Also filesystem-level encryption can do that as well. – Raffa Feb 13 '24 at 14:10
  • @ Ray I have mentioned the file name and attached a Screen Shot as well.

    @ Raffa - No anti-virus service running on my system

    – PVD Feb 13 '24 at 14:18
  • Oh, that looks like a filesystem corruption ... Short answer run a filesystem check and let it fix errors ... Long answer see https://askubuntu.com/a/1467086 – Raffa Feb 13 '24 at 14:27

1 Answers1

0

From the Linux man pages for unlink(2), the system call behind rm:

ERRORS

EFAULT
pathname points outside your accessible address space.
EIO
An I/O error occurred.
...
...

...and EIO's error string is exactly "Input/output error."

So, I think I can assume that this is more likely a hardware or data corruption issue, instead of anything related to permissions etc.

P.S. (after edit)

I am confident that this is inode corruption now. Best course of action is to unmount the device (or reboot to a rescue drive if it is stored on root) and run fsck.

mcendu
  • 307
  • I agree with this ... Most likely filesystem corruption and less likely hardware/connection failure (bad /degraded blocks included) although possible ... Notice that "data corruption" in itself i.e. data contained in the file is not likely a problem here but rather data storage structure i.e. filesystem can do that. – Raffa Feb 13 '24 at 14:34
  • 3
    ... Although judging by directory sizes of 0 in OP screenshot, the filesystem might be NTFS and in this case a filesystem check under Windows is advised. – Raffa Feb 13 '24 at 14:57
  • @mcendu : I got this error msg at vs code also while opening this file. Got convinced that this is something data corruption error. As I am using aria2 for downloading torrents and there is a file .aria2 which tracks the state of the download today suddenly this file got deleted by its own and I ran my usual aria2 command to resume. Hence many folders were showing the same error. But It made me post here when I saw the same error with above mentioned file. As that file was not the part of aria2 downloads. – PVD Feb 13 '24 at 15:54
  • 1
    @Raffa : Thank you Sir, for this solution. It worked. I have a dual boot windows 11 + Ubuntu 22.04 and when I boot from w11 while booting Windows fixed it itself. – PVD Feb 13 '24 at 15:55