How to restore Ubuntu if it doesn't start anymore (CD or USB)

It is not impossible that through an update or some wrong installation Ubuntu does not start anymore, but fortunately there is the solution and the only requirement is to have the live CD (or USB key) to start a test section and repair the start.

If you don't know how to create a live Ubuntu CD / USB, you can read the our guide

So all that remains is to start the live and proceed with restoring Ubuntu

Restore Ubuntu from Live

The first thing to do is find the partition (sda) in which Ubuntu was installed. Usually this is sda1, but for example in a dualboot with Windows (where obviously the latter was installed first) the partition will no longer be sda1. Then type in the terminal

sudo fdisk-l

to understand what the partition is'/', or Ubuntu startup

fdisk-l-re-ubuntu

In my case the Ubuntu related partitions are sda5 sda6 and sda7, but what is the boot partition? We immediately exclude sda6 which, as we clearly see, is the swap area and we verify the other two, which are '/' and '/ home'. To do this, we need to mount them and use the file manager to find the partition. We therefore give from the terminal

$ sudo mount PARTITION / Mnt

where PARTZIONE stands for (always in my case) sda5 or sda7. In the terminal it must be inserted entirely, that is

$ sudo mount / dev / sda5 / mnt

at this point we open the file manager and go to the folder / Mnt and as you can see I mounted the / home partition

mount-ubuntu

I then try to mount sda 7, which by exclusion must be the root and, in fact, here is the contents of the folder

mount-root

now we can proceed with recovery. I continue with the commands, considering that your partition is already mounted

$ for i in / sys / proc / run / dev; do sudo mount --bind "$ i" "/ mnt $ i"; done
$ sudo cp /etc/resolv.conf / mnt / etc /
$ sudo chroot / mnt
$ apt-get update
$ apt-get upgrade

After this procedure, the system will work again. However, if the problem was caused by the proposed repositories (those for developers, not recommended for normal daily use of Ubuntu) it is necessary to downgrade the packages, in this case read the guide to downgrading packages to a stable version.






by

Receive the latest posts by email

Enter the email and choose the inscriptions on the new page

InTheBit.it
Added devices
  • Compare Smartphone (0)
  • Compare Notebook (0)
Compare