How to restore the Ubuntu boot item after Windows is reinstalled

Source: Internet
Author: User

Ubuntu + Windows multi-system boot is completed by grub of ubuntu by default. If we reinstall Windows, Windows will change the Master Boot Record to its own, at this time, the startup Item of Ubuntu cannot be found, and we need to manually restore the grub boot. Next I will introduce how to restore the Ubuntu boot item after Windows is reinstalled:

Use ubuntu live USB or livd cd to enter the ubuntu live environment, and enter sudo fdisk-l in the terminal to view your ubuntu Partition Number, it is usually/dev/sdax (X is a number, whichever is your own)

Run sudo mkdir/media/ubuntu.
Mount partition: sudo/dev/sdaX mount/media/ubuntu
Restore grub: sudo grub-install-root-directory =/media/ubuntu // dev/sda (note that there is no X)

If the execution is complete and there is no error, grub will be installed again. After the restart, go to ubuntu through grub and run sudo update-grub to update the startup list. Then, go to Win.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.