How to fix and prevent the /dev/sda1: recovering journal On Ubuntu 16.04 Gnome

As I was booting my computer up one morning I saw this awful error message rather than the Ubuntu Gnome boot logo, it turned out to be a common error and can be fixed easily, let's get to the details!

/dev/sda1: recovering journal

Cause of the issue

The problem occurs when the computer isn't shut off properly or when electrical failure happens, some data on the SSD isn't stored properly and the boot process is halted.
In my case it's the power issues that ruined my laptop battery and is making it's way to my data stored on the SSD

How to fix it

The screen itself suggests a terminal command to fix the drive which was useless in my case, my easy fix was using a live Linux installation from a USB -I used Linux mint- and used Gparted to fix the damaged drive (please note that using Gparted can be very risky and cause data loss). 

Using Gparted from a live distro


We are using Gparted to fix the partition, it depends on how you did your disk but it's the same way.

Entering the password to run Gparted.
Opening Gparted
Opening Gparted


  Viewing a list of disks on your computer.
View disks with Gparted
View disks with Gparted


 Checking the drive for errors with the right click menu.
Checking the disk for errors using Gparted
Checking for errors

We now click Apply changes.
Applying changes using Gparted

After applying changes we can safely reboot, the fix is done!

Making sure damage didn't happen

ِAfter rebooting the computer will open as usual, but we want to make sure that the drive wasn't damaged, to do that we will install a small command line tool called Smartmontools 6.5 and it can be downloaded from this link.

Installing Smartmintools-6.5


Samrtmontools is a terminal uutility to check and monitor disk performance. 
 To install Smartmontools we need to uncompress the tarball and we do this from the terminal
  tar zxvf smartmontools-6.5.tar.gz

The previous step created a directory called smartmontools-6.5 containing the code. Then we go to that directory, build, and install:
 cd smartmontools-6.5
  ./configure
  make
  sudo make install


After running these steps we managed to install Smartmintools-6.5 tarball from the terminal.

Running Smartmintools-6.5

Run the command:  sudo smartctl -a /dev/sda. And if the results are like the the screenshot your drive is safe, as it says clearly: No errors logged.
 


How to make the fix automatic on every boot

Instead of performing the fix every time the issue happens, it's easier to set the config autofsck to run at every boot. 


Edit the file etc/default/rcS and change the FSCKFIX from no to yes by using this terminal command:


gksu gedit /etc/default/rcS


Here it opens a gedit windows, navigate to the last line.
Editing /etc/default/rcS
Change the FSCKFIX from no
Change No to Yes and save to finish.
Editing /etc/default/rcS
 FSCKFIX To yes

This way every time the issue occurs the system will automatically fix it and continue booting normally. 

This is how to fix and prevent the /dev/sda1: recovering journal on Linux Ubuntu Gnome 16.04 and similar distros, it's really easy to fix but it can be scary and ruin a day for you if you don't know what to do.
And I highly advise you to backup whenever possible

Comments