Fix Ubuntu 2 loss caused by Windows installation.

Source: Internet
Author: User
Start the computer with UbuntuLiveCD or UbuntuLiveUsb, select Ubuntu for use, and enable the terminal. # Obtain the root permission sudo-I # view the partition information fdisk-l # mount the root partition (only the Swap and/partition methods are supported) mount/dev/sda5/mnt # mount proc/dev/sys, important mount -- bind/proc/mnt/procmount -- bin

Start the computer with Ubuntu LiveCD or Ubuntu LiveUsb, select Ubuntu for use, and enable the terminal.

# Obtain root permissions

Sudo-I

# Viewing partition information

Fdisk-l

# Mount the root partition (only Swap and/are supported)

Mount/dev/sda5/mnt

# Mount proc/dev/sys, important

Mount -- bind/proc/mnt/proc

Mount -- bind/dev/mnt/dev

Mount -- bind/sys/mnt/sys

# Chroot to/mnt Partition

Chroot/mnt

# Installing grub

Grub-install/dev/sda

# Execute this command if grub. cfg is lost or damaged

Update-grub

# Log out of chroot and restart the computer

Exit

Reboot

# If there are many partitions (especially the/boot partition is a separate partition), run the following command.

# Mount the system partition. This step varies from person to person, and the partition is mounted to the corresponding location.

Mount/dev/sda3/mnt

Mount/dev/sda1/mnt/boot

Mount/dev/sda5/mnt/home

# Mount proc/dev/sys

Mount -- bind/proc/mnt/proc

Mount -- bind/dev/mnt/dev

Mount -- bind/sys/mn/sys

Chroot/mnt/

Grub-install/dev/sda

Update-grub

Exit

Reboot

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.