Today, on my Centos server I tried to add a user but got the following error:

-bash: /usr/sbin/useradd: Input/output error

How do I fix it?

up vote 9 down vote accepted

“Input/output error” indicates something that shouldn't happen somewhere in the input/output stack. The intended meaning is a hardware failure: your hard disk is failing.

Often this error turns up in cases where the problem is a software bug or a misuse of a special-purpose filesystem. But here, you're reading from a system directory, so a hardware failure is the most likely explanation.

RAM also tends to fail, so when you see an inexplicable error, do test your RAM.

  • OK I see...What I maybe forgot to mention is that the Server is a VPS... So I guess a restart might fix it? – DextrousDave Aug 12 '13 at 4:03
  • @DextrousDave A restart might make the symptom go away, but it can't fix the problem. On a VPS, there's also a chance of a bug in the virtualization layer. Investigate a little more (for example, is this fully deterministic?) and contact your hosting provider's support. – Gilles Aug 12 '13 at 7:35
  • I contacted my Service Provider and they restarted the server from their end. The problem is now resolved, they also cannot give me a definitive answer, so I will have to monitor the OS closely. Thanks for the help – DextrousDave Aug 16 '13 at 9:43
  • how to test RAM? – J. Chang Oct 5 '13 at 2:35

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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