You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

How to restore a read-only file system

  • Log into the instance as root
  • run fsck
  • reboot the instance

Why does it happen?

The default behavior or many Linux operating systems is to set a file system to read-only if critical information can't be written to disk. If this happens the file system is corrupt and fsck has to be run to fix it. The default behavior can be changed but it is not advisable. If it is changed to "continue" errors can accumulate and corrupt the file system. If it is changed to "panic" the system will halt and fsck will need to be run on the file system before it can be restarted (true?).

How can I detect when the file system has been changed to read-only?

The following command can be run to touch a file in each file system in your instance. When run as root it will detect any file systems that are currently read-only:

grep "\sro[\s,]" /proc/mounts

  • No labels