Fix Linux boot after Windows is reinstalled

Source: Internet
Author: User

Fix Linux boot after Windows is reinstalled

Installed dual-system (Windows and Linux) after Windows is re-installed, Linux boot will be lost and you will not be able to enter the original Linux system [the reason is that Windows will overwrite the Linux BootLoader-GRUB in the original MBR]. In this case, you can recover the Linux system by fixing the boot.

Take Ubuntu14.04 as an example. First, find a Linux installation disk, put it into the optical drive, and restart the computer. Enter the BIOS, enable the computer to start from the CD, and then enter the Live CD mode (for example, after the computer is started from the Ubuntu installation disk, click "Try Ubuntu". If it is slow to enter the graphic interface at this time or it cannot enter the graphic interface at all, you can press <Ctrl + Alt> + [F1 ~ F7] enter the command line mode ).

Then open the terminal, enter the root mode (for example, enter sudo-I), and then enter the mount command to view the various partitions of the system (some people say that the fdisk-l command is used on the Internet, however, the disk unit shown in this command is Block, which requires conversion and is not intuitive. We recommend that you use the mount command ), record the partition where Linux is installed ("/" or "/boot" [if you have separately partitioned "/boot, take/dev/sda11 as an example );

Create a directory (mkdir/mnt/tmpdir) and run the mount/dev/sda11/mnt/tmpdir command to mount/dev/sda11 to/mnt/tmpdir;

It is worth noting that, when installing Linux,/boot occupies a single partition (take/dev/sda10 as an example), you also need to enter mount/dev/sda0/mnt/boot.

Finally, enter grub-install -- root-directory =/mnt/dev/sda.

Restart the computer, and then you will find that the original system boot selection directory re-appears, the Linux system boot will be successful repair.

But if the Windows system can not enter, you need to enter the Linux system, then enter the sudo update-grub2 in the terminal, and then restart the computer.

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.