Files rarely get damaged by themselves. Usually, damage in the filesystem is the result of an underlying hardware error. The message
mount: cannot remount block device /dev/sda3 read-write, is write-protected
indicates that the kernel detected a hardware error, and to prevent further data corruption, it marked the underlying device read-only. Making the filesystem read-only was a side effect of this.
You can't switch the filesystem back to being read-write because the block device is still read-only. You can make the block device read-write with blockdev --setrw /dev/sda3
, and then remount the filesystem read-write. However this is a bad idea, as is rebooting and continuing to use the disk. Don't ignore this error: your hardware is failing and your data is going to get more and more corrupted.
Check the kernel logs for some clues about the error. You should be seeing a flurry of log messages. Kernel logs are often stored in /var/log/kern.log
but the location depends on the distribution and on the system configuration, so check your distribution's documentation. You can call the command dmesg
to print the kernel logs, but only for the current session, you'll need to view the log files for messages from before the latest reboot.
Common causes for disk failure include failure of the actual disk, a loose cable, or a RAM failure. Run smartctl -a /dev/sda
to view disk diagnostics. If that doesn't indicate that anything is failing, run memtest86+ to check your RAM.