Fix grub2 boot after Windows is reinstalled

Source: Internet
Author: User

When you reinstall windows with the installed version, the MBR will be rewritten, causing grub loss. You can use livecd to fix grub after it is started.


Start with ubuntu9.10 livecd and then open the terminal

If your Ubuntu/partition is sda7 and the/boot partition is sda6, start it with livecd and enter
Sudo-I
Mount/dev/sda7/mnt
Mount/dev/sda6/mnt/boot (skip this step if no/boot partition is available)
Grub-install-root-directory =/mnt/dev/SDA

As before, replace SDA with SDB if you want to mount the second hard disk.

If grub. cfg has been lost or grub. cfg has an error, You need to recreate it and continue with the following operations:

Mount-bind/proc/mnt/proc
Mount-bind/dev/mnt/dev
Mount-bind/sys/mnt/sys
Chroot/mnt Update-grub
Umount/mnt/sys
Umount/mnt/dev
Umount/mnt/proc

Exit

Related Article

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.