Startup Error – Fix After Computer Shutdown During Ubuntu 18.04 Update

16.0418.04data-corruptionrebootupdates

I tried to update my laptop to Ubuntu 18.04 (from 16.04) last night, but I had a power outage and I believe it was interrupted in the middle. As I woke up and noticed that the power was out, I panicked, and, yeah, system corrupted as the laptop ran out of power.

Can anyone give some instructions on how to repair the system?

Picture of the error message showing at startup

Full StartupError Message:

[     1.271631 ] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[     1.271695 ] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.15.0-36-generic #39-Ubuntu
[     1.271753 ] Hardware name: ASUSTEeK Computer Inc. G74Sx/G74Sx, BIOS G74Sx.202 08/15/2011
[     1.271820 ] Call Trace: 
[     1.271873 ]    dump_stack+0x63/0x8b
[     1.271924 ]    panic+0xe4/0x244
[     1.271974 ]    mount_block_root+0x1f6/0x2da
[     1.272025 ]    ? set_debug_rodata+0x17/0x17
[     1.272075 ]    mount_root+0x38/0x3a
[     1.272126 ]    prepare_namespace+0x139/0x18e
[     1.272186 ]    kernel_init_freeable+0x224/0x251
[     1.272189 ]    ? rest_init+0xb0/0xb0
[     1.272191 ]    kernel_init+0xe/0x110
[     1.272193 ]    ret_from_fork+0x35/0x40
[     1.272243 ] Kernel Offset: 0x24400000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[     1.272505 ] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Best Answer

I managed to solve the problem.

On startup, choose Advanced options for Ubuntu in the GNU GRUB menu, then enter in recovery mode, such as Ubuntu, with Linux 4.4.0-137-generic (recovery mode). Once it loads, run fsck, reboot after finished, then get in recovery mode again and run dpkg. I had to run each of these a few times, as it kept getting stuck at different points, and I had to cancel it some times... Once done with these, get in recovery mode and on root, and run:

apt-get update
apt-get upgrade
apt-get install -f
grub-update
grub-update2
reboot

Enter on recovery mode once more, and just resume. It worked for me, and I was inside the interface, where I opened a terminal and reran all of the commands above, as well as completed installation through interface windows that showed up as the system started.

Related Question