14

I'm having a problem with Ubuntu that I'm finding hard to troubleshoot for reasons that will become clear:

# reboot
-bash: /sbin/reboot: Input/output error
# dmesg
-bash: /bin/dmesg: Input/output error
# ps -e
ps: error while loading shared libraries: /lib/libproc-3.2.8.so: cannot read file data: Input/output error
# lsof
-bash: /usr/bin/lsof: Input/output error
# fsck
-bash: /sbin/fsck: Input/output error
# badblocks
-bash: /sbin/badblocks: Input/output error

So I can't see what is going on, and I can't remotely reboot. What can I do to get to the bottom of this?

Interestingly:

# init 0
Segmentation fault

I can cat /var/syslog but not /var/log/messages or several other important files. less and more don't work, neither do tail or head, etc.

1
  • 1
    Sounds pretty similar to what you get after running sudo rm -rf /. (I did it on purpose, just to see what actually happens.) Sep 12, 2013 at 19:27

2 Answers 2

13

The system is having severe trouble reading off of your hard disk. It's likely that the disk is dead (almost certain), but it could be something as simple as a loose/disconnected cable (don't count on it). There isn't anything you can do to troubleshoot it from here. Just power it off.

Check for loose connections on your hard disk. If everything is fine there boot from a rescue disk and run fsck or badblocks from there.

I hope you have a back up.

3
  • 2
    The weird thing though is that when I was able to physically reboot the machine and did so, it came back on seemingly with no problems. I still have not found any problems, though I am taking this as a warning sign that the disk is not reliable and could go at some point. I do keep my all my important files in at least two places using git, so at least that wouldn't have been a problem.
    – rplevy
    Jan 3, 2011 at 1:51
  • Then it is possible that it was just a communication error (e.g., loose cable). Keep an eye on it though. Once a disk starts to fail it's usually completely dead soon after.
    – bahamat
    Jan 3, 2011 at 5:54
  • The same happened to my virtual machine. Once rebooted it started working fine.
    – droope
    Nov 29, 2012 at 20:51
2

If you're using a VM it's quite likely that there was some interruption in the filesystem mounts, and linux switch the mounts to read only as a failsafe measure.

Unfortunately, it leaves your system practically unusable.

If you check /proc/mounts, and look for the root filesystem, there should be a line like this:

/dev/dm-0 / ext4 ro,relatime,errors=remount-ro,data=ordered 0 0

You'll see that the root filesystem has been mounted readonly.

Basically the only thing to do at this point (assuming this is the problem) is to reboot (via a KVM or other console power-off switch).

2
  • Thanks for this!
    – ajh158
    Nov 2, 2020 at 17:56
  • 2
    This answer explained what happened to my local WSL2 Ubuntu 20 environment after filling up my local disk. Aftering investigating the disk mounts with cat /proc/self/mounts my disk was mounted as ro If anyone else runs into this, the WSL equivalent to this solution is to free up some disk space, open PowerShell and run wsl --shutdown. After I booted back into my wsl environment the disk was mounted as rw and everything was working again. This answer really saved the day!
    – Brett K.
    Jan 13, 2021 at 0:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .