After Windows is reinstalled, Linux boot and Windows Linux are restored.

Source: Internet
Author: User

After Windows is reinstalled, Linux boot and Windows Linux are restored.

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 and enter the root mode (for example, enter sudo-I ),

Then enter the mount command to view the various partitions of the system (the fdisk-l command is used on the Internet, but the disk unit displayed by this command is Block, which is not intuitive and needs to be converted, we recommend that you use the mount command) to 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.


How to restore linux after windows is reinstalled

Download grub_for_dos, decompress the package, copy the grldr file to the drive C root, and open boot. ini, add the following line at the end: c: \ grldr = "grub" to save and restart. The Select menu is displayed. Select grub and it will automatically search for the menu. lst. Generally, you can go to the grub menu and start linux. If it cannot be found, enter the command line, enter root (hd0, *) (the partition where your linux is located), press enter, and enter configfile/boot/grub. conf. If your/boot is partitioned separately, enter configflie/grub. conf, press enter to enter the grub startup selection menu.
After entering linux, run grub, enter root (hd0, *) (your linux zone), press enter, and enter setup (hd, 0) to install grub to mbr, go to the grub system selection menu directly after the instance is started. If you do not have windows in the grub menu, you can edit/boot/grub. conf and add the following sentence to it:
Title windows
Rootnoverify (hd0, 0)
Chainloader + 1
In this way, you can use grub to guide the dual system.

Windows linux cannot be reinstalled.

Can I boot to windows? If yes, choose "manage"> "disk management" in the mail on my computer icon, find the Linux partition, delete it, and then re-create the partition.

If you encounter an error where grub cannot be booted, you can open dos and enter fdisk/mbr to repair the Boot Record. The partition magician can do the same.

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.