Rebooting Ubuntu After It Goes Read-Only

Sometimes my Ubuntu laptop malfunctions and the file system goes into read-only mode.

This might mean it’s time to upgrade to a new laptop. Which I will probably do in a few months.

But I want to note how I can get back to normal.

The obvious way is just to reboot. But sometimes the system goes into a initramfs prompt.

To solve the issue, I need the location of my drive in the /dev file system, which I can get by running df -h:

Filesystem                   Size  Used Avail Use% Mounted on
udev                         2.9G     0  2.9G   0% /dev
tmpfs                        588M  8.9M  579M   2% /run
/dev/mapper/ubuntu--vg-root  453G  407G   23G  95% /
tmpfs                        2.9G  344K  2.9G   1% /dev/shm
tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
tmpfs                        2.9G     0  2.9G   0% /sys/fs/cgroup
/dev/sda1                    236M  119M  105M  54% /boot
cgmfs                        100K     0  100K   0% /run/cgmanager/fs
tmpfs                        588M   52K  588M   1% /run/user/1000
/home/ericm/.Private         453G  407G   23G  95% /home/ericm

The one I want is “/dev/mapper/ubuntu–vg-root”.

So in the initramfs prompt, I run this:

fsck /dev/mapper/ubuntu--vg-root -y

I got this answer from the Ask Ubuntu site (see another answer here). As long as I can access my site from another machine, I should be able to solve this.

I may need to get a new laptop soon because sometimes my laptop does not detect the power chord is plugged in, so it starts using the battery.

You’re welcome.