I have one of our production Ubuntu machines set up by PRODUCTION Unix team here in our company, but somehow when I am doing like this -

root@machineA:/test01# ls -lt
ls: reading directory .: Input/output error
total 0

It is giving me an error. And if I am trying to create any directory in the promary01 directory, it is giving me an error as well -

mkdir: cannot create directory `/test01/primary': Read-only file system

Any thoughts on what is wrong? I am thinking to fix this myself instead of telling UNIX PROD guys as I have root access, and I will be able to learn something new as well.

Maybe it was not mounted properly?

  • what is the output of cat /proc/mounts ? – SHW Feb 1 '14 at 9:00
  • It may be a good idea to do a filesystem check (e2fsck), which may happen automatically if you reboot the system. – brm Feb 1 '14 at 10:29
  • @SHW: This is what I get on the console from cat /proc/mounts - /dev/sdb /test01 ext4 ro,relatime,user_xattr,barrier=1,data=ordered 0 0 /dev/sdc /test02 ext4 rw,relatime,user_xattr,barrier=1,data=ordered 0 0 – arsenal Feb 1 '14 at 17:23
  • It's clear that I/O error has to do with faulty disc, as said by Timo. And I guess, denial of directory creation is because, you have mounted the test01 as Read-Only. remount it as sudo mount -o remount,rw /test01 – SHW Feb 3 '14 at 5:15

Input/Output errors are more an indication of faulty discs than of unproperly mounted filesystems. I have seen that mostly with USB drives, but also with IDE, SATA and SCSI.

You should definitely ask your support to get a look at that and replace.

  • 1
    Indeed. My experience has been that if Linux gets an I/O error with a given partition, it will immediately remount the partition in question read-only. The thinking: We don't want to write to a hard disk with problems, because that might corrupt data. – samiam Feb 2 '14 at 4:51
  • I had something very similar: my virtual machine lives in a network drive. When there is a momentary loss of network connection the virtual machine remounted the root partition as read-only. The system crashed soon after because it couldn't even write tmp files. On reboot it went to an initramfs prompt and requested to run fsck. – craq Jul 18 '18 at 2:09

I have encountered this several times on micro SD cards running on a variation of Raspberry pi's - the fix has been fsck /dev/sdx -a where sdx is your partition.

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.