Tran Nghi's Site  - Make notes and share experience

[ubuntu] Initramfs boot error

This post is also available in: English

Error output:

fsck from util-linux 2.26.2
/dev/sda2 contains a file system with errors, check forced.
/dev/sda2: Inodes that were part of a corrupted orphan linked list found.
        (i.e., without -a or -p options)
fsck exited with status code 4
The root filesystem on /dev/sda2 requires a manual fsck
Busybox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built in shell (ash)
Enter 'help' for a list of built-in commands.
(initramfs) _

Ways to fix:

From many research over internet, finally I have solved the issue with a single command:

(initramfs) fsck /dev/sda2 -y
(initramfs) reboot

It works, like a charm! Remember to replace /dev/sda2 following the your error output, sometime it could be /dev/mapper/ubuntu--vg-root, or /dev/sda6 or /dev/sdb1

Extra points:

Found that the problem is worse on SSD disks than the regular HDD disks. I have found some steps that may fix the problem temporarily.

fsck -fy /dev/sda2

if sda2 is the right partition – the prompt will tell you exactly which one requires fsck.

After that if the systems boots up you may have another problem with the package management system, so if you open a terminal and type sudo apt-get update you may get an error. Do not worry. Run these commands:

sudo apt-get update
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

My opinion is that there is serious problem in Ubuntu with regard to SSD disks. The community should fix it.
I have found a possible cause of this problem: Probably the system did not shutdown normally.