Ubuntu – Why does the root filesystem keep becoming read-only

diskfilesystemfsckhard driveread-only

I've lately been having an issue with my root filesystem becoming readonly. It happens some amount of time after boot. I don't know exactly when it happens, as I don't usually notice it until something such as suspending the computer or printing fails. It seems to be fairly random. Since most of my system is on that partition, I can't re-mount it without rebooting.

After this happens, the system runs a fsck. Sometimes it prompts to fix problems; other times it apparently finds none.

  • To troubleshoot, I've searched through the logs but found nothing relevant. This might be due in part to not knowing when the actual errors took place.

  • The filesystem is apparently good to begin with, as when fsck runs its fixes it doesn't report any errors.

  • I've scanned the disk with SpinRite. A while ago, SpinRite found and recovered from some bad sectors on the hard drive. I ran a level 4 scan (a thorough scan) after this probem appeared, but SpinRite found nothing.

  • The SMART data reports that the disk is OK with 63 bad sectors. The number of bad sectors hasn't changed recently.

I realize that the disk isn't in the best of conditions, and I have complete backups in case of catastrophic failure. Yet the lack of errors in the logs, combined with SpinRite's test results and the unchanged SMART data makes me think that this problem has some cause other than disk failure.

Other than disk failure, what could cause my symptoms?

Best Answer

In my experience if he system automatically decides to remount a medium read-only that either means that

  • the medium is broken
  • or the file-system on the medium is broken.

In the latter case a fsck run could help. But if a bad block has broken the file system chances are high that it won't be long before another bad block appears - possibly breaking something more vital.