N
Star Prestige Review

How to repair grub2 when ubuntu won’t boot

Author

Daniel Johnson

Updated on March 20, 2026

How to repair grub2 when ubuntu won’t boot

Ubuntu and many other Linux distributions use the GRUB2 boot loader. If GRUB2 breaks—for example, if you install Windows after installing Ubuntu, or overwrite your MBR—you won’t be able to boot into Ubuntu.

You can easily restore GRUB2 from a Ubuntu live CD or USB drive. This process is different from restoring the legacy GRUB boot loader on older Linux distributions.

This process should work on all versions of Ubuntu. It’s been tested on Ubuntu 16.04 and Ubuntu 14.04.

The Graphical Method: Boot Repair

Boot Repair is a graphical tool that can repair GRUB2 with a single click. This is the ideal solution to boot problems for most users.

If you have the media you installed Ubuntu from, insert it into your computer, restart, and boot from the removable drive. If you don’t, download a Ubuntu live CD and burn it to a disc or create a bootable USB flash drive.

When Ubuntu boots, click “Try Ubuntu” to get a usable desktop environment.

How to repair grub2 when ubuntu won’t boot

Ensure you have an Internet connection before continuing. You may need to choose a Wi-Fi network and enter its passphrase.

Open a Terminal window from the Dash and run the following commands to install and launch Boot Repair:

How to repair grub2 when ubuntu won’t boot

The Boot Repair window will automatically scan your system after you run the boot-repair command. After it scans your system, click the “Recommended repair” button to repair GRUB2 with a single click.

You can choose to use the advanced options here, but Ubuntu’s wiki recommends you not use the advanced options unless you know what you’re doing. The recommended repair option can fix most problems automatically, and you could mess up your system even more by selecting the wrong advanced options.

How to repair grub2 when ubuntu won’t boot

Boot Repair will begin working. It may ask you to open a Terminal and copy/paste a few commands into it.

Just follow the instructions that appear on your screen. Perform the instructions Boot Repair wants you to and click “Forward” to continue through the wizard. The tool will walk you through everything you need to do.

How to repair grub2 when ubuntu won’t boot

Restart your computer after the Boot Repair tool finishes applying its changes. Ubuntu should boot up normally.

The Terminal Method

If you’d rather get your hands dirty, you can do this yourself from a terminal. You’ll need to boot from a live CD or USB drive, as in the graphical method above. Ensure the version of Ubuntu on the CD is the same as the version of Ubuntu installed on your computer. For example, if you have Ubuntu 14.04 installed, ensure you use a Ubuntu 14.04 live CD.

Open a terminal after booting into the live environment. Identify the partition Ubuntu is installed on using one of the following commands:

Here’s the output of both commands. In the fdisk -l command, the Ubuntu partition is identified by the word Linux in the System column. In the blkid command, the partition is identified by its ext4 file system.

If you have multiple Linux ext4 partitions, you can get an idea of which is which by viewing the size of the partitions and their order on the disk here.

How to repair grub2 when ubuntu won’t boot

Run the following commands to mount the Ubuntu partition at /mnt/ubuntu, replacing /dev/sdX# with the device name of your Ubuntu partition from the above commands:

In the screenshot above, our Ubuntu partition is /dev/sda1. This means the first partition on the first hard disk device.

Important: If you have a separate boot partition, skip the above command and mount the boot partition at /mnt/ubuntu/boot instead. If you don’t know whether you have a separate boot partition, you probably don’t.

Run the following command to reinstall grub from the live CD, replacing /dev/sdX with the device name of the hard disk above. Omit the number. For example, if you used /dev/sda1 above, use /dev/sda here.

Restart your computer and Ubuntu should boot properly.

For more detailed technical information, including how to use the chroot command to gain access to a broken Ubuntu system’s files and restore GRUB2, consult the Ubuntu wiki.

How to repair grub2 when ubuntu won’t boot

Ubuntu and many other Linux distributions use the GRUB2 boot loader. If GRUB2 breaks—for example, if you install Windows after installing Ubuntu, or overwrite your MBR—you won’t be able to boot into Ubuntu.

You can easily restore GRUB2 from a Ubuntu live CD or USB drive. This process is different from restoring the legacy GRUB boot loader on older Linux distributions.

This process should work on all versions of Ubuntu. It’s been tested on Ubuntu 16.04 and Ubuntu 14.04.

The Graphical Method: Boot Repair

Boot Repair is a graphical tool that can repair GRUB2 with a single click. This is the ideal solution to boot problems for most users.

If you have the media you installed Ubuntu from, insert it into your computer, restart, and boot from the removable drive. If you don’t, download a Ubuntu live CD and burn it to a disc or create a bootable USB flash drive.

When Ubuntu boots, click “Try Ubuntu” to get a usable desktop environment.

Ensure you have an Internet connection before continuing. You may need to choose a Wi-Fi network and enter its passphrase.

Open a Terminal window from the Dash and run the following commands to install and launch Boot Repair:

The Boot Repair window will automatically scan your system after you run the boot-repair command. After it scans your system, click the “Recommended repair” button to repair GRUB2 with a single click.

You can choose to use the advanced options here, but Ubuntu’s wiki recommends you not use the advanced options unless you know what you’re doing. The recommended repair option can fix most problems automatically, and you could mess up your system even more by selecting the wrong advanced options.

Boot Repair will begin working. It may ask you to open a Terminal and copy/paste a few commands into it.

Just follow the instructions that appear on your screen. Perform the instructions Boot Repair wants you to and click “Forward” to continue through the wizard. The tool will walk you through everything you need to do.

Restart your computer after the Boot Repair tool finishes applying its changes. Ubuntu should boot up normally.

The Terminal Method

If you’d rather get your hands dirty, you can do this yourself from a terminal. You’ll need to boot from a live CD or USB drive, as in the graphical method above. Ensure the version of Ubuntu on the CD is the same as the version of Ubuntu installed on your computer. For example, if you have Ubuntu 14.04 installed, ensure you use a Ubuntu 14.04 live CD.

Open a terminal after booting into the live environment. Identify the partition Ubuntu is installed on using one of the following commands:

Here’s the output of both commands. In the fdisk -l command, the Ubuntu partition is identified by the word Linux in the System column. In the blkid command, the partition is identified by its ext4 file system.

If you have multiple Linux ext4 partitions, you can get an idea of which is which by viewing the size of the partitions and their order on the disk here.

Run the following commands to mount the Ubuntu partition at /mnt/ubuntu, replacing /dev/sdX# with the device name of your Ubuntu partition from the above commands:

In the screenshot above, our Ubuntu partition is /dev/sda1. This means the first partition on the first hard disk device.

Important: If you have a separate boot partition, skip the above command and mount the boot partition at /mnt/ubuntu/boot instead. If you don’t know whether you have a separate boot partition, you probably don’t.

Run the following command to reinstall grub from the live CD, replacing /dev/sdX with the device name of the hard disk above. Omit the number. For example, if you used /dev/sda1 above, use /dev/sda here.

Restart your computer and Ubuntu should boot properly.

For more detailed technical information, including how to use the chroot command to gain access to a broken Ubuntu system’s files and restore GRUB2, consult the Ubuntu wiki.

yesterday it was working fine, it’s my work laptop so nothing special happened, ubuntu asked for update, I did.

Today’s morning there is boot loop. After grub menu there is a black screen and reboot, there is no end for this.

Tried recovery mode and different kernels (result the same). There is no message at all, tried enabling some boot logs removing that ‘quiet’ flags but no logs at all.

What can I do to NOT reinstall system? Is there a way to connect to console, and maybe try to update again?

6 Answers 6

In your GNU GRUB menu screen (where you select Ubuntu, Advanced options, Memory test, Recovery, etc), you can edit the command line by pressing ‘e’ on the highligted line. Now, you can edit the parameters that are passed to the kernel during boot time. If you replace init with init=/bin/sh, you will escape to a root shell at an early point. From here, you can mount disks, and fix other issues.

To see what goes on during boot you can edit the boot sequence as described above, and get rid of the ‘quiet splash’ section as well (or press ESC during boot when you see the splash screen or everything is black).

I would pay attention to the boot sequence as the text flies by, it might hang at a certain point. That’s your clue. 😉

How to repair grub2 when ubuntu won’t boot

To try debugging the issue, and given you already tried editing grub , you could try booting from a Live CD/USB, mount your partition, and check the contents of

which would belong to your last boot attempt.

If this does not help, you could try reinstalling (check also this), which can bring your system back to life with a not-so-heavy effort.

How to repair grub2 when ubuntu won’t boot

The way that I have solved issues like this in the past is by creating an ubuntu installation drive and booting from that. When it comes up with the choose your installation type screen, select keep files and reinstall ubuntu. Hope this helps!

I got this problem when I tried to upgrade from Ubuntu 16.04 to 18.04. I did as the suggestion in from this link in the tty1 by press: Ctrl + Alt + F1 after start and execute these commands one by one. Please check the first 3 file before remove:

From your grub menu, advanced options for Ubuntu submenu you can select recovery option and get this screen from How to Fix an Ubuntu System When It Won’t Boot:

How to repair grub2 when ubuntu won’t boot

Read the full article above for detailed instructions on recovering your system when it won’t boot properly. To summarize:

  • clean: Attempts to make free space on your file system. If your storage is full and this is causing some sort of problem, this can help free up space.
  • dpkg: Repairs broken software packages. If a package failed to install properly and your system doesn’t work because of it, this may help.
  • failsafeX: Boots your computer in a failsafe graphic mode. If there’s a problem with your Xorg graphical server configuration or graphics drivers and that’s causing your Ubuntu system to boot to a black screen or preventing the graphical desktop from loading properly, this can get you back to that graphical desktop.
  • fsck: Performs a file system check, which scans the computer’s file systems for errors and automatically fixes them. It’s a bit like chkdsk on Windows.
  • grub: Updates the GRUB boot loader. If you could use the GRUB boot loader to get to this menu, this option probably won’t help.
  • network: Enable networking, which is disabled by default in recovery mode.
  • root: Leaves the menu and goes to a root shell prompt. From here, you can mount the file system in write-mode and run commands that may help fix problems with the system. You should only do this if you know what you’re doing — it’s a way to fix the problem by hand if you know how.

yesterday it was working fine, it’s my work laptop so nothing special happened, ubuntu asked for update, I did.

Today’s morning there is boot loop. After grub menu there is a black screen and reboot, there is no end for this.

Tried recovery mode and different kernels (result the same). There is no message at all, tried enabling some boot logs removing that ‘quiet’ flags but no logs at all.

What can I do to NOT reinstall system? Is there a way to connect to console, and maybe try to update again?

6 Answers 6

In your GNU GRUB menu screen (where you select Ubuntu, Advanced options, Memory test, Recovery, etc), you can edit the command line by pressing ‘e’ on the highligted line. Now, you can edit the parameters that are passed to the kernel during boot time. If you replace init with init=/bin/sh, you will escape to a root shell at an early point. From here, you can mount disks, and fix other issues.

To see what goes on during boot you can edit the boot sequence as described above, and get rid of the ‘quiet splash’ section as well (or press ESC during boot when you see the splash screen or everything is black).

I would pay attention to the boot sequence as the text flies by, it might hang at a certain point. That’s your clue. 😉

How to repair grub2 when ubuntu won’t boot

To try debugging the issue, and given you already tried editing grub , you could try booting from a Live CD/USB, mount your partition, and check the contents of

which would belong to your last boot attempt.

If this does not help, you could try reinstalling (check also this), which can bring your system back to life with a not-so-heavy effort.

How to repair grub2 when ubuntu won’t boot

The way that I have solved issues like this in the past is by creating an ubuntu installation drive and booting from that. When it comes up with the choose your installation type screen, select keep files and reinstall ubuntu. Hope this helps!

I got this problem when I tried to upgrade from Ubuntu 16.04 to 18.04. I did as the suggestion in from this link in the tty1 by press: Ctrl + Alt + F1 after start and execute these commands one by one. Please check the first 3 file before remove:

From your grub menu, advanced options for Ubuntu submenu you can select recovery option and get this screen from How to Fix an Ubuntu System When It Won’t Boot:

How to repair grub2 when ubuntu won’t boot

Read the full article above for detailed instructions on recovering your system when it won’t boot properly. To summarize:

  • clean: Attempts to make free space on your file system. If your storage is full and this is causing some sort of problem, this can help free up space.
  • dpkg: Repairs broken software packages. If a package failed to install properly and your system doesn’t work because of it, this may help.
  • failsafeX: Boots your computer in a failsafe graphic mode. If there’s a problem with your Xorg graphical server configuration or graphics drivers and that’s causing your Ubuntu system to boot to a black screen or preventing the graphical desktop from loading properly, this can get you back to that graphical desktop.
  • fsck: Performs a file system check, which scans the computer’s file systems for errors and automatically fixes them. It’s a bit like chkdsk on Windows.
  • grub: Updates the GRUB boot loader. If you could use the GRUB boot loader to get to this menu, this option probably won’t help.
  • network: Enable networking, which is disabled by default in recovery mode.
  • root: Leaves the menu and goes to a root shell prompt. From here, you can mount the file system in write-mode and run commands that may help fix problems with the system. You should only do this if you know what you’re doing — it’s a way to fix the problem by hand if you know how.

Ubuntu is a world popular computer operating system just like Windows. However, the two systems are pretty different from each other. No matter if you are an Ubuntu user or not, let us tell you that Ubuntu doesn’t have certain Windows-like features such as Safe Mode or Auto Repair Tools. Therefore, if you are about to use Ubuntu or already are into it, fixing problems has to be your own responsibility if it doesn’t reboot. So, in this article, we will guide you through repairing Ubuntu yourself and save you from a major computer disaster.

How to repair grub2 when ubuntu won’t boot

The latest version of Ubuntu, 16.04, requires a minimum of 2 GHz dual-core processor, 25 GB free space in Hard Disk Drive and minimum of 2GB memory on RAM. If you are still using any of the older versions of Ubuntu like the Ubuntu 14.04, just don’t worry as the guidelines here will still work.

There is a Recovery Menu along with the Reinstall option provided by Ubuntu and you can use them to facilitate an Ubuntu re-installation without causing damage to any of your important files.

NOTE: If your PC is not able to boot anything, or you are not able to initiate booting with the help of USB or CD, then you’ll have to check the PC’s boot order for its configuration. If it isn’t any better, then analyse your hardware before proceeding.

How To Repair GRUB2 (The GRand Unified Bootloader Version 2) When Ubuntu Won’t Boot?

Majority of the Linux distribution including Ubuntu 16.04 LTS, uses the GRUB2 boot loader. So, the reason you are probably not able to boot Ubuntu is that of an error in the GRUB2 boot loader. You may follow the steps to know how to fix Ubuntu if it won’t boot by checking and repairing the GRUB2 boot loader.

To know if you have an access to the GURB2 boot loader, re-start your computer and continuously keep pressing the SHIFT Key to load the main menu of your machine’s operating system. You have just sought access to the GRUB2 boot loader if you are able to witness the menu.

How To Repair Ubuntu If It Won’t Boot?

If you are unable to see a window with the menu of boot options, then the GRUB2 bootloader isn’t probably running and is also hampering Ubuntu’s booting system. Installing Windows operating system over Ubuntu can overwrite the GRUB2 boot loader instantly. WindowsOS installs its own boot loader in the boot sector, so you will have to work on Windows instead of Ubuntu unless you repair the GRUB2 Bootloader.

If you prefer to use both the operating systems even after getting GRUB2 bootloader fixed, then rest assured GRUB also supports dual-boot environment on your computer. All you have to do is install all Linux distribution only after installing Windows. You can now have dual-boot setup through the GRUB 2 boot loader.

If there is a problem with your GRUB2 bootloader, the following are the instructions to fix it:

Get your Ubuntu Installation USB or CD to repair the GRUB2 as you’ll have to boot into the Linux System. You may either install through simple terminal commands or through the graphical installer. It is possible that you may have to download Linux distribution files and burn them onto a CD or copy to a USB device (learn the same in the steps hereafter). So, having a dedicated boot repair disc inserted into the computer will directly execute the graphical boot repair tool which will make the process much easier.

As soon as the GRUB boot loader is repaired, you may restart the computer and Ubuntu should load without fail. (You will have to continuously keep pressing the SHIFT key to access the hidden GRUB2 boot loader). If Ubuntu fails to load even after fixing the GRUB there must be something more severe.

Here is what you can do: Once you have access to the GRUB boot menu, you would see options to repair the operating system. Choose the ‘Advanced Options for Ubuntu” option using the arrow keys and press ENTER. Further, there will be a sub-menu and you will have to choose ‘Ubuntu (Recovery mode) and press ENTER. The GRUB will boot Ubuntu operating system in the recovery mode and you can access all your files in read-only mode. There would be a buffet of options from which you have to choose one and move ahead.

CLEAN: This will try to clean up some space on your file system and will be helpful only if Ubuntu isn’t booting because of full-storage.

dpkg: This option repairs the broken software packages to assist in booting Ubuntu.

failsafeX: This options repairs and fixes all problems caused by graphics driver or any problem in the graphical server configuration.

Fsck: It will scan the entire file system and automatically fix any errors causing trouble in Ubuntu to boot.

Network: Since networking is turned off in recovery mode, this option will enable Networking on your computer.

Root: This initiates the root shell prompt and further you can provide commands to repair problems related to Ubuntu installation. Most of us know this option and how to use it but still, it is advanced and requires a lot of time as you have to repair the problem manually.

Re-Install Ubuntu While Keeping Files and Programs

If the problem of booting your Ubuntu still persists then you have only one option left – Initiate the installation using USB or CD and the Ubuntu setup will possibly find the pre-existing installation to prompt a ‘Reinstall Ubuntu’ option.

Select that option and re-installation will begin. It will ensure utmost safety in keeping your files and settings intact along with saving your personal data and other software packages. It will basically bring down the system settings to default so that you can correct all problems and bugs created by system setting configuration. If you proceed with the option of reinstalling Ubuntu, then you will also have GRUB re-installed by fixing all configuration errors. This can fix the problems in Ubuntu as it is like installing Ubuntu for the first time without any history of problems.

If any of these instructions are not able to help you boot Ubuntu on your computer, then probably you need to check the hardware of your computer, Hard Disk Drive or take help from a professional. It is always advised to use the latest edition of Ubuntu which happens to be Ubuntu 16.04 at present. If your computer hardware doesn’t support the same then you may need to opt for Ubuntu LTS versions which are custom made for long-term support.

Ubuntu is preloaded with several applications like VLC, GIMP etc, which are absent in Windows. And, making that shift from Windows to Ubuntu is tough. So, you are the best judge yourself for taking such a decision on your machine!

How to repair grub2 when ubuntu won’t boot

If you are familiar with both Windows and Ubuntu, you’ll notice that Ubuntu does not have any Safe Mode or Auto repair tools, as Windows has.

Ubuntu’s latest version 16.04 requires at least 2 GHz dual-core processor, 2GB ram, and 25 GB space in HDD. However, even if you are using an older version such as 14.04 workarounds described in this guide will work similarly to the latest version of Ubuntu.

Ubuntu does provide a Recovery menu as well as reinstall option using that you can fix a Ubuntu installation without getting affected your programs and files. This guide is dedicated on How to repair Ubuntu if it won’t boot and you’ll find ways to give life to your existing Ubuntu installation.

NOTE: If you notice that your PC is not booting anything, or you are not able to boot up via a USB and Live CD, you need to check the configuration of your Pc’s boot order. However, if this does not help you might like it, but you probably need a hardware update.

How to Repair GRUB2 When Ubuntu won’t Boot

Ubuntu 16.04 LTS and other Linux distribution make use of the GRUB2 boot loader, which means if there is a problem with your GRUB2 boot loader, maybe that is why you are not able to boot Ubuntu. However, it can be solved by repairing the GRUB2 boot loader. Follow the steps and you’ll learn How to repair Ubuntu if it won’t boot by fixing the GRUB boot loader.

To check if you have access to GURB2 boot loader, start your computer while holding the SHIFT button. It should open a menu which contains the list of installed Operating systems. If you see the menu, means you just accessed the Grub boot loader.

How to repair grub2 when ubuntu won’t boot

Another side of the coin, if you did not see a menu with boot options. Possibilities are that your GRUB boot loader is not functioning and preventing Ubuntu from boot. GRUB boot loader can be overwritten if you install Windows OS after Ubuntu Installation. Installing windows make it is own boot loader to the boot sector, so unless you fix GRUB boot loader, you will not be able to boot into Ubuntu.

If you worried that if you repair the GRUB boot loader maybe it will prevent Windows to boot and make only Ubuntu boot. GRUB can also be used to set a Dual-boot environment on your PC. basically, you should install any Linux distribution after installing Windows, it will result a dual-boot setup through GRUB.

However, of course, something goes wrong with your GRUB boot loader, and here is how to fix it. How to Repair GRUB2 When Ubuntu will not Boot:

To repair the GRUB, you need a Ubuntu Installation USB or Disc. Because you need to boot into the Linux system in order to repair GRUB. In this section, we could help you reinstalling GRUB2 boot loader on Ubuntu. You can use either the graphical installer or simple terminal commands. But for that, you may need to download a Linux distribution and burn into a USB or disc, but read next to find a simple method.

To make this easier, you can just use this dedicated Boot repair disc and your Pc will be booted directly to the graphical boot repair tool.

How to repair grub2 when ubuntu won’t boot

Once this tool did repair the GRUB Bootloader, you can restart your computer and this time Ubuntu should load fine. (The GRUB2 is hidden, you need to press and hold SHIFT button during the boot process.)

If this did not help in your case, you might be a more serious problem. In such case you need to repair Ubuntu installation using the GRUB.

How to Repair Ubuntu If It Won’t Boot

Once you see the GRUB boot menu, you’ll find options to repair your system. You need to choose the ‘Advanced options for Ubuntu’ option with the help of arrow keys and press enter. A submenu will be open, on that choose ‘Ubuntu .. (recovery mode) and press enter.

How to repair grub2 when ubuntu won’t boot

The GRUB should boot your Ubuntu system in recovery mode menu, and your files will also load in a read-only mode. You’ll see a bunch of different options, here are the details of the options.

Select an option and press enter.

Clean: This command will try to free up space on your file system. This is only helpful if your storage is full and because of that Ubuntu is not booting.

dpkg: It is helpful, and it does repair broken software-packages.

failsafeX: Corrects any problem due to a graphics driver or graphical server configuration.

fsck: It will scan the filesystem and fix any errors.

grub: Ths will update the GRUB bootloader. This will not help if you can access the grub boot loader.

Network: Turns on networking, because it is disabled in the recovery mode.

root: Starts the root shell prompt and from here you can give commands and can fix problems with your Ubuntu installation. Us this if you know how to use it and what you are doing. Because it is advanced and why to fix the problem on your own.

Reinstall Ubuntu While Keeping Files and Programs.

If there is still a problem booting your Ubuntu installation you are left with one last option. You are still able to boot up Ubuntu with a USB or Live CD. Boot up using the installation media, the Ubuntu setup should be able to fund the existing installation and offer a ‘reinstall Ubuntu’ option.

How to repair grub2 when ubuntu won’t boot

Choose the option, and a reinstall will be performed. It will keep your files and personal settings. It can also keep software packages and your other personal data. The reinstall feature will vanish the system related settings and will make the default. So that should correct all the gimmicks and errors by any system setting configuration.

If you select that option and go through the process to reinstall Ubuntu, the GRUB2 will also be reinstalled; it’ll fix any configuration error. This method will fix your Ubuntu if didn’t boot. Because theoretically you did installed the Ubuntu like you installed the Ubuntu first time.

However, if you are still not able to boot Ubuntu, I think there is a problem with your PC’s hardware or maybe with hard disk drive.
Use Another Ubuntu version.

Alternative by any mean you may always want to use the latest version of Ubuntu, which is 16.04 right now. It is also advisable that according to your Computer requirement you may need a lower version, you can find all the Ubuntu LTS versions here (where LTS stands for long-term support).

Final words.

Unlike Windows, Ubuntu comes preloaded with such VLC, GIMP and other apps. So moving from Windows to Ubuntu should be very hard. If you have any query concerns in How to repair Ubuntu if it doesn’t boot, the comment section is just a scroll away.

Ubuntu is a world popular computer operating system just like Windows. However, the two systems are pretty different from each other. No matter if you are an Ubuntu user or not, let us tell you that Ubuntu doesn’t have certain Windows-like features such as Safe Mode or Auto Repair Tools. Therefore, if you are about to use Ubuntu or already are into it, fixing problems has to be your own responsibility if it doesn’t reboot. So, in this article, we will guide you through repairing Ubuntu yourself and save you from a major computer disaster.

How to repair grub2 when ubuntu won’t boot

The latest version of Ubuntu, 16.04, requires a minimum of 2 GHz dual-core processor, 25 GB free space in Hard Disk Drive and minimum of 2GB memory on RAM. If you are still using any of the older versions of Ubuntu like the Ubuntu 14.04, just don’t worry as the guidelines here will still work.

There is a Recovery Menu along with the Reinstall option provided by Ubuntu and you can use them to facilitate an Ubuntu re-installation without causing damage to any of your important files.

NOTE: If your PC is not able to boot anything, or you are not able to initiate booting with the help of USB or CD, then you’ll have to check the PC’s boot order for its configuration. If it isn’t any better, then analyse your hardware before proceeding.

How To Repair GRUB2 (The GRand Unified Bootloader Version 2) When Ubuntu Won’t Boot?

Majority of the Linux distribution including Ubuntu 16.04 LTS, uses the GRUB2 boot loader. So, the reason you are probably not able to boot Ubuntu is that of an error in the GRUB2 boot loader. You may follow the steps to know how to fix Ubuntu if it won’t boot by checking and repairing the GRUB2 boot loader.

To know if you have an access to the GURB2 boot loader, re-start your computer and continuously keep pressing the SHIFT Key to load the main menu of your machine’s operating system. You have just sought access to the GRUB2 boot loader if you are able to witness the menu.

How To Repair Ubuntu If It Won’t Boot?

If you are unable to see a window with the menu of boot options, then the GRUB2 bootloader isn’t probably running and is also hampering Ubuntu’s booting system. Installing Windows operating system over Ubuntu can overwrite the GRUB2 boot loader instantly. WindowsOS installs its own boot loader in the boot sector, so you will have to work on Windows instead of Ubuntu unless you repair the GRUB2 Bootloader.

If you prefer to use both the operating systems even after getting GRUB2 bootloader fixed, then rest assured GRUB also supports dual-boot environment on your computer. All you have to do is install all Linux distribution only after installing Windows. You can now have dual-boot setup through the GRUB 2 boot loader.

If there is a problem with your GRUB2 bootloader, the following are the instructions to fix it:

Get your Ubuntu Installation USB or CD to repair the GRUB2 as you’ll have to boot into the Linux System. You may either install through simple terminal commands or through the graphical installer. It is possible that you may have to download Linux distribution files and burn them onto a CD or copy to a USB device (learn the same in the steps hereafter). So, having a dedicated boot repair disc inserted into the computer will directly execute the graphical boot repair tool which will make the process much easier.

As soon as the GRUB boot loader is repaired, you may restart the computer and Ubuntu should load without fail. (You will have to continuously keep pressing the SHIFT key to access the hidden GRUB2 boot loader). If Ubuntu fails to load even after fixing the GRUB there must be something more severe.

Here is what you can do: Once you have access to the GRUB boot menu, you would see options to repair the operating system. Choose the ‘Advanced Options for Ubuntu” option using the arrow keys and press ENTER. Further, there will be a sub-menu and you will have to choose ‘Ubuntu (Recovery mode) and press ENTER. The GRUB will boot Ubuntu operating system in the recovery mode and you can access all your files in read-only mode. There would be a buffet of options from which you have to choose one and move ahead.

CLEAN: This will try to clean up some space on your file system and will be helpful only if Ubuntu isn’t booting because of full-storage.

dpkg: This option repairs the broken software packages to assist in booting Ubuntu.

failsafeX: This options repairs and fixes all problems caused by graphics driver or any problem in the graphical server configuration.

Fsck: It will scan the entire file system and automatically fix any errors causing trouble in Ubuntu to boot.

Network: Since networking is turned off in recovery mode, this option will enable Networking on your computer.

Root: This initiates the root shell prompt and further you can provide commands to repair problems related to Ubuntu installation. Most of us know this option and how to use it but still, it is advanced and requires a lot of time as you have to repair the problem manually.

Re-Install Ubuntu While Keeping Files and Programs

If the problem of booting your Ubuntu still persists then you have only one option left – Initiate the installation using USB or CD and the Ubuntu setup will possibly find the pre-existing installation to prompt a ‘Reinstall Ubuntu’ option.

Select that option and re-installation will begin. It will ensure utmost safety in keeping your files and settings intact along with saving your personal data and other software packages. It will basically bring down the system settings to default so that you can correct all problems and bugs created by system setting configuration. If you proceed with the option of reinstalling Ubuntu, then you will also have GRUB re-installed by fixing all configuration errors. This can fix the problems in Ubuntu as it is like installing Ubuntu for the first time without any history of problems.

If any of these instructions are not able to help you boot Ubuntu on your computer, then probably you need to check the hardware of your computer, Hard Disk Drive or take help from a professional. It is always advised to use the latest edition of Ubuntu which happens to be Ubuntu 16.04 at present. If your computer hardware doesn’t support the same then you may need to opt for Ubuntu LTS versions which are custom made for long-term support.

Ubuntu is preloaded with several applications like VLC, GIMP etc, which are absent in Windows. And, making that shift from Windows to Ubuntu is tough. So, you are the best judge yourself for taking such a decision on your machine!

How to repair grub2 when ubuntu won’t boot

As for many systems, you can use it every day but it can happen that for some reason, your Linux won’t boot and you need to know how you can do in these situations. Some Linux distributions don’t offer a safe mode and automatic repair tools but you can see recovery mode which provides some options that keep your files and can repair the problem. There is also another possibility by using a Linux live CD or USB which will help to use tools or commands.

In this tutorial, I will show you how to fix some common booting issues you may encounter in Linux.

1) Repair Grub2

Ubuntu and many other Linux distributions use the GRUB2 boot loader. If GRUB2 breaks for example if you have installed Windows after installing your Ubuntu or overwrite your MBR, you won’t be able to boot into your Linux system.

GRUB 2’s ability to fix boot problems has greatly improved over the original GRUB bootloader. When grub2 has booting failure it comes up with a screen showing grub> or grub rescue prompt, which allows a number of commands to run from there.

But here I will show you a simple method to repair your GRUB 2 boot issues.

You should use a LiveCD. When you will boot in the live mode, then open the terminal and type the command below:

Now you can restart your system. If the operation is not resolved, boot in liveCD mode and install ‘boot-repair’ packages as below

When the boot repair will start, you will follow to use the “recommended repair”. The operation can take several minutes so be patient. After this, you can restart your system.

2) Reset a login password forgotten

It can happen that after the boot process, you can’t log into your system because you have forgotten your password or maybe you have changed your keyboard language and the input doesn’t match the characters you know. The only possibility is to reset your password.

To reset your password, boot in recovery mode and access to the terminal. Enter the command below:

The command above mounts the root partition in read/write mode. Now change your password

If you have SELinux, enter the command below to update its parameters

Now you can normally reboot your system and enter the new password

3) Unable to log in: fail to start session

It can happen on the reboot that the screen of your system goes black and soon after that the login screen comes back. This problem can appear because your graphic environment encountered some problems during a package installation or an upgrade. Or it is probably because there is little space on your machine or an issue with LightDM or Xauthority.

To resolve the issue, type the Ctl-Alt-F1 and go t0 the terminal login. Now enter the command below:

4) View logs system boot messages

Let’s discuss a few places where you should look for boot problems.

Journal logs

The journal is implemented with the jourlnad daemon, which handles all of the messages produced by the kernel, initrd, services, etc. It can help you to see all the errors messages related to the system boot and you can try to resolve it. To see boot-related messages from the current boot, use the -b switch:

To see the journal from the previous boot, use the -1 relative pointer with the -b flag

You can have some issues due to applications. Journald makes easy to take advantage of the advanced features of the journal and to do extensive analysis and relational debugging of different application components.

Dmesg – buffer logs

Most of the boot messages are stored in the ring buffer, you can use Dmesg command to print this data. This data is also sent to syslogd or klogd (if it is running). As ring buffer size is fixed it can’t hold much data, dmesg shows only the recent kernel messages.

The Data from dmesg are dumped to /var/log/message, so it is also a place to check any boot errors.

Use the following command to read the content of dmesg:

5) Boot Error on Console

Sometimes it happens on reboot the system gets panic or some error message like “init not found” is displayed, preventing from proper booting, then as a first step you can try pass init=/bin/bash (Grub boot loader) or Linux init=/bin/bash (if Lilo boot loader). This will launch you straight into a Bash shell prompt. Then you can remount “/” file system and check /var/log/messages for any error. You can use the below command to remount “/” as read/write. Kernel panic could be because of a bad cpu or motherboard or bad memory.

If the above steps does not work, then next option is to

1) Boot from the Linux First CD (boot CD).

2) Type “boot rescue” at Linux boot prompt.

3) After the bash shell prompt show up, type “chroot /mnt/sysimage”.

a) Check for any disk error

Check “fdisk -l /dev/hda” to check how many partitions you have

b) If you use Grub boot loader, type “/sbin/grub-install –root-directory=/boot”. If you use Lilo bootloader, type “cd /etc; lilo”.

Conclusion

LiveCDs such as Ubuntu or Knoppix do the job of rescue booting just fine, but there are smaller, faster rescue boot disks out there. In such situations, knowing how to edit individual GRUB stanzas, use the GRUB command line but you need to be able to identify the problem. By using these techniques, you can recover from various boot problems and boot into your normal installation.

Yazılıma dair

Ubuntu and many other Linux distributions use the GRUB2 boot loader. If GRUB2 breaks—for example, if you install Windows after installing Ubuntu, or overwrite your MBR—you won’t be able to boot into Ubuntu.

You can easily restore GRUB2 from a Ubuntu live CD or USB drive. This process is different from restoring the legacy GRUB boot loader on older Linux distributions.

This process should work on all versions of Ubuntu. It’s been tested on Ubuntu 16.04 and Ubuntu 14.04.

Open a Terminal window from the Dash and run the following commands to install and launch Boot Repair:

If you get “add-apt-repository command not found” error, please read this article.

The Boot Repair window will automatically scan your system after you run the boot-repair command. After it scans your system, click the “Recommended repair” button to repair GRUB2 with a single click.

You can choose to use the advanced options here, but Ubuntu’s wiki recommends you not use the advanced options unless you know what you’re doing. The recommended repair option can fix most problems automatically, and you could mess up your system even more by selecting the wrong advanced options.

Just follow the instructions that appear on your screen. Perform the instructions Boot Repair wants you to and click “Forward” to continue through the wizard. The tool will walk you through everything you need to do.

Restart your computer after the Boot Repair tool finishes applying its changes. Ubuntu should boot up normally.