Linux – File system keeps becoming read-only

ext4filesystemslinuxlinuxmint

After working for a while, my filesystem (EXT4) becomes read-only. I then use my live USB to boot into live mode and I run fsck on the corrupted partition (and others too, to be safe). I run fsck -y and it does fix all errors on the problematic partition. When I run fsck, again, all partitions are reported as clean.

Then I reboot normally (not live USB) into my system; I run a few touch abc commands at different locations, to test and it is able to write to disk. After a while however, it again becomes read-only.

I've repeated this entire process 4-5 times (fsck-from-live-usb –> boot-normally –> becomes-read-only –> fsck-from-live-usb), and I don't know the cause of this problem.

dmesg shows the following kind of errors:

blk_update_request: I/O error, dev sdb, sector 2521582056

tag#28 FAILED Result: hostbyte=DID_SOFT_ERROR driverbyte=DRIVER_OK

Is there a way to fix this? I'm unable to work on my system. It doesn't look like a hardware problem, since fsck fixes everything and smartctl also reports the drive to be okay, no errors.

Thanks.

Best Answer

While SMART reports all OK, the disk may be bad anyway, you should try to:

  • perform a SMART test with smartctl -t long /dev/sdb, see for example the Arch wiki
  • check the disk for badblocks with badblocks -s, for other ways to do it (some destructive) see (again) the Arch wiki

It may also be a problem with the SATA controller or with the bus, but first you should check the disk (maybe from another machine if you are not sure about the controller).