I have a machine where running various commands results in an Input/output error. This is the result of a hardware fault.

I am trying to determine what files remain undamaged.

My best heuristic so far is that the shell shows the message for some files in /usr/bin when I try to run them, with most of the files that I have tried so far being fine. I would like to be able to have a full list without having to run all the program images in /usr/bin one by one. After all, that is laborious, and might have side effects.

  • 1
    What? If you are getting input/output errors there is likely a problem with your machine. You should check /var/log/messages for disk errors. – Jesse_b Mar 31 '18 at 14:29
  • @Jesse_b I know. – argle Mar 31 '18 at 14:30
  • @Jesse_b I would not expect to find disk errors in /var/log/messages but they are mentioned in the output of dmesg. – Hauke Laging Mar 31 '18 at 14:50
  • @HaukeLaging: depends on the system. On many systems anything that shows in dmesg will also be in /var/log/messages – Jesse_b Mar 31 '18 at 14:54
  • 1
    Please! If you have a hardware fault on a disk, stop using it immediately, get another disk of the same or equal size and do a ddrescue of the bad disk onto the new disk immediately or you risk losing it all together. – Fabby Apr 1 '18 at 6:49

Using touch -a /usr/bin/* will result in a list of only Input/output error filenames in stderr.

  • In a deleted comment, Erik F said that this method would only work if the inode is in a damaged section of the disk: if the actual data is damaged, touch will not suffice. – argle May 20 '18 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.