Ubuntu

Resolution for Ubuntu Boot Error “No Such Partition”

Many people nowadays install and change their OS (operating system) or go for dual boot as well. So, changing the partition size can corrupt the boot loader installation, and these corrupt files may give an error something like this:

“Error: no such partition entering grub rescue mode….”

Grub is the boot loader for various Linux distros that instruct your system to find the installed OS in one or more hard drives. A system requires this information for booting into your Linux distro correctly. In case grub gets corrupted, then you may face this “error: no such partition.” We can eliminate this error in different ways, so in this guide, we will include and explain all of these ways.

Why Boot Error: No Such Partition Occurs?

Several reasons might trigger this error in your system and they are:

  • System’s GRUB Bootloader is Deleted or Corrupted: You can resolve this error by reconfiguring the utility manually to boot through the appropriate files.
  • The Bootloader May be Corrupted or Misconfigured: You can resolve this error by recreating the boot configuration data by the elevated command prompt.
  • The Boot Configuration is Inconsistent: this issue is caused by inappropriate data fed in the GRUB bootloader. So, you can fix this error by Registry Backup for restoring your system to the correct configuration.

Resolution for Ubuntu Boot Error: No Such Partition

There are some requirements before starting the process to fix this error quickly, and these requirements are:

  • A CD/DVD/USB drive of the exact same operating system version.
  • Appropriate internet connectivity.
  • Dual-booting Windows with Ubuntu OS (there is no Wubi installation).
  • A boot partition is not required.

Now, let’s start the process; so first, open the terminal from the search menu, or you can press CTRL, ALT and T keys. After that, execute the following command, which will provide the information about the problematic partition number and drive name:

$ sudo su
$ fdisk -l

In the above command, we have used “fdisk,” which is called format disk, and used to create and manipulate disk partition tables.

Now you will see the hard drive and partition like this /dev/sda5. However, it is an example that means your system may show different details.

After finding the right information, use the following command for mounting the partition:

$ sudo mkdir /mnt/temp
$ sudo mount /dev/sdAB /mnt/temp

In the above commands, you have to replace AB with the required values as per your system.

After mounting the partition, mount the specific items in the preparation of chroot by executing the below command:

Once you execute the command successfully, the system will show root@ubuntu:/#, which shows that you are in the chroot mode.

Now you can remove the Grub but make sure that you use the purge, so all the Grub conf files are also removed successfully. Besides that, the system will prompt you to confirm that you want to remove the grubby pressing Tab on the keyboard then “Yes” to continue.

$ apt-get update
$ apt-get purge grub grub-pc grub-common

Note: We have already deleted the previous Grub with the problematic settings.

Now we need to install a new Grub, but it is essential to keep things in my before installing Grub:

  • The system will ask you to add some extra kernel options while installing a new Grub. So, you need to press TAB and then Enter button to continue.
  • After that, the system will redirect you to the installation notes, so press the TAB and then Enter button to continue (you need to select Continue, then press Enter to proceed).
  • Now, the system will redirect you to the new options window and select the option in the sdX. Format but don’t select the drive partition in the four-letter format like sda4 etc.
  • Once you select the partition, it will have an asterisk (*), but if it isn’t present, then highlight it using the TAB and press the SPACE button to select it.

Finally, reinstall the Grub by executing the commands given below:

$ apt-get install grub-common grub-pc
$ update-grub

It completes the reinstallation process, so exit chroot and then unmount everything through the following command:

$ exit

You can remove the live media and then reboot your system through the below command:

$ for i in /dev/pts /dev /proc /sys; do sudo umount /mnt/temp$i ; done
$ reboot

Conclusion

It is very simple to fix this boot error from any system using specific commands and procedures. We have included the most possible and simple resolution for Ubuntu boot error: no such partition issue. In case you liked this blog, then make sure you check more articles on our website as we have a massive list of informative articles.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.