At certain time, various commands started to give various error messages.

I catched a few of them and then rebooted the system and these commands were working.

$ mkdir x
  mkdir: cannot create directory `x':
$ file x.txt
  bash: /usr/bin/file:
    Input/output error
$ touch x.txt
  Segmentation fault

There were other commands giving the same error messages. ls, px was working. Some command output "read/only filesystem".

Now it's OK after reboot.

What could I try (to measure or diagnose) to know more about what was happening? If it's rather relating to hardware or security?

  • 1
    hardware. Most likely a bad drive or faulty cable. – jordanm Dec 16 '16 at 20:03
  • Could have been the filesystem got mounted read-only. – DopeGhoti Dec 16 '16 at 20:59
  • @DopeGhoti It might, but that would have been a consequence of the same I/O problem, not a cause of these messages. – Gilles Dec 18 '16 at 22:32

Next step would probably involve looking at your dmesg | tail -40 output. Then again, it would probably answer with an other Input/output error. I guess you had to physically reboot this machine/commands were failing as well?

Looks like your root filesystem is gone. Could be a problem with a disk, some sata cable, or a faulty RAID array.

  • Yes, I had to physically reboot. So, you eliminate security risk? Or I can focus on something to be more sure? – xralf Dec 16 '16 at 19:56
  • By focus, I mean, use the command with grep, to get more precise information related to the situation before reboot. – xralf Dec 16 '16 at 20:00
  • From my experiences, these kind of messages are related to some hardware issue. You could try configuring rsyslog to forward messages to some remote logger: missing disks/broken root doesn't mean your running processes are necessarily broken too. – SYN Dec 16 '16 at 20:03
  • If file input/output errors, my bet is grep won't work any better. – SYN Dec 16 '16 at 20:03
  • dmesg shouldn't fail with an input/output error because dmesg info is stored in memory, not on disk. – jordanm Dec 16 '16 at 20:04

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.