In case you are stuck with read only file system or just you cannot reboot your machine to do fsck (which may fix a disk issue) due to Input/output errors, you can use the following commands.
The SysRq key provides a way to send commands directly to the kernel through the /proc filesystem. It is enabled via a kernel compile time option, CONFIG_MAGIC_SYSRQ.
- Activate the SysRq option:
echo 1 > /proc/sys/kernel/sysrq
- Now when you want to reboot the machine type the following:
echo b > /proc/sysrq-trigger