Filesystem – How to Fix Read-Only File-System on Ubuntu 18.04

18.04filesystemfsckhard drivemount

Today, after several uninterrupted weeks of happily using my Ubuntu machine again, I ran into another error, this time just after okaying a typical software update. Instead of giving me a successful package installation message, it gave me some sort of notification that "the daemon that allows installation is not working". I can't remember if that was exactly it or not, but I hit "ok" and the box went away. Strange I thought.

Suspecting something was up, I immediately hooked up my external drive to make a backup — but my drive wouldn't mount. It was visible in Nautilus, but when I clicked on it, it said: enter image description here

So apparently my file system has up and decided to go read-only. Is there a way to fix this, or must I purchase a new hard drive and start over? Is there a way to somehow mount my external drive and backup my data first? Can this somehow be fixed using fsck, a command I don't know about?

My system is set up with my / Ubuntu partition on a 250GB SSD, and my /home on a separate 500GB HDD. I believe the problem must be with my / drive, since I can still edit and save anything in my home directory as normal.
I seem to be unable to edit anything on the / drive though, like install software or mount drives.
Here is a screenshot of the errors I got when trying to make a backup using Aptik: enter image description here

I'm still new to computers so am rather clueless here. Any help would be really appreciated.

Best Answer

I know there's a good answer out there, but I'm having trouble finding it right at the moment.

Your system has by default, a line in /etc/fstab which indicates that if there is an error in the file system, that it should go into read-only mode, to prevent further corruption or dataloss.

The way to fix this, is to boot from a live USB, open a terminal window and use the command

sudo fsck -f /dev/sdxx

where "sdxx" is the partition of the hard drive that Linux resides on. You could use lsblk to determine the partition name, if you don't know it.

You could also copy your data to a backup hard drive before performing the disk check - the live USB should allow you to mount both your USB backup disk, and the partition that is having the problem (in read-only mode).

Related Question