Why does my root filesystem keep becoming read-only?

10,220

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.

Share:
10,220
Scott Severance
Author by

Scott Severance

My first Linux experience was in 1998 (via telnet into my university's server to read my email with PINE). I've run Linux on my own machines off and on since 1999 and exclusively since 2006. My first distro was Slackware, which I quickly broke. I then went back to Windows 95. After that, my friend helped me install Debian, which I used until I replaced that machine. I found Debian too difficult to install on my own, so I put Red Hat on my newer machine. At that time, yum didn't exist, and Red Hat only offered updates if I logged in to X as root, which I rarely did. So, it quickly became outdated, and OpenOffice 1.1 couldn't handle right-to-left text, which I needed for one of my university classes. So, I started using my Windows XP laptop most of the time. I couldn't install Linux on the laptop because the NTFS tools of the era couldn't resize my partition. After a couple of years, I decided to switch my Red Hat box to something more modern. I wanted to move away from the RPM package format, so I tried installing Debian again and once again found it too complicated to get all the features I needed. Then, I read about an up and coming Debian-based distro called Ubuntu that had just released their latest version. So, I installed 6.06 (Dapper Drake) and have used Ubuntu exclusively as my main OS all my machines since that time. I only boot into Windows a few times a year. I've tried a few other distros' live CDs, but so far have always decided that the benefits of those distros aren't significant enough for me to switch over. For the first many years, I used the command line most of the time, as early Linux GUIs weren't up to many basic tasks. These days, the GUI tools have made leaps and bounds and are quite usable. Nevertheless, I often prefer the command line for many tasks. I'm much more likely to use vim than Gedit. But, I quite appreciate GUI tools for a number of tasks--perhaps most tasks these days. SOreadytohelp

Updated on September 18, 2022

Comments

  • Scott Severance
    Scott Severance over 1 year

    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?

    • Sergey
      Sergey over 11 years
      In my experience, SMART may report disk status as PASSED long after there are regular read failures resulting in system reboots. Try manually scheduling a "long test" using smartctl from smartmontools package, let it finish (may take a few hours) and see what SMART will tell you then.
    • Sergey
      Sergey over 11 years
      Also, this won't fix your problem (and might even be dangerous provided the filesystem was mounted read-only for a reason), but you can remount an already-mounted filesystem without unmounting it first or rebooting, using something like mount -o remount,rw /
    • Scott Severance
      Scott Severance over 11 years
      Actually, when I tried remounting rw, it failed complaining that mtab was on a read-only filesystem.
    • Sergey
      Sergey over 11 years
      man mount: -n, --no-mtab Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem. Although I still wouldn't recommend this
    • Sajesh Kumar
      Sajesh Kumar over 11 years
      Other than disk failure, it might actually be disk failure :P
    • Admin
      Admin about 10 years
      If you're using a journaling filesystem it's possible a bad block or other hiccup was encountered during the writing of the journal. That would force the filesystem to go read-only.
    • frlan
      frlan over 7 years
      If disc is not broken, your RAM might is