How to find cause of main file system going to read only mode
[26729.124569] Write(10): 2a 00 03 96 5a b0 00 00 08 00
[26729.124576] end_request: I/O error, dev sda, sector 60185264
[26729.125298] Buffer I/O error on device sda2, logical block 4593494
[26729.125986] lost page write due to I/O error on sda2
For me, that's pretty strong evidence that your /dev/sda
is on its way out. You could run a smartctl test on it for confirmation (smartctl -t long /dev/sda
), but I'd be inclined to replace it as soon as possible.
Edit: the smartctl
command I gave is correct as written. Thanks for showing the failure mode in your question; this looks like either you have very old hardware, or there's some kind of translation layer in the way: either virtualisation, or a hardware RAID controller. Can you clarify?
May I repeat my assertion that your HDD is on its way out? Testing's all very well, but getting the hardware replaced before your system packs up and your data are lost should be your priority now. Please, at the very least make sure that your backups are completely up-to-date before wasting any more time on smartctl
.
Edit 2: it's certainly worth trying what they've suggested - fscking the file system - but I have little hope that that will fix the problem because your FS isn't dropping to ro mode because of FS inconsistencies, it's dropping to ro mode because of problems talking to the underlying hardware.
If they have confidence that the underlying hardware is fine, then it's an issue between the kernel and the hardware, ie, the virtualisation layer. You should probably get your VPS provider to confirm that the distro, and the exact kernel version, that you're running are fully supported on their VPS system.
More perfect way to find the exact error may be during the read only period and run the command dmesg
for any bugs/issues. You may also try running the fsck
in dry mode to figure out what is the issue. (sorry due to access restriction I am unable to view your attachment. If its during the issue period, I will check it later)