How to use the Ubuntu installation CD to restore Grub

Source: Internet
Author: User
Keywords Ubuntu installation CD
Tags advanced aliyun bios boot loader check computer disk exit

This section explains how to use the http://www.aliyun.com/zixun/aggregation/13835.html >ubuntu installation CD to restore GRUB (the Grand Unified Boot Loader)

(1) Press del key or F2, enter the BIOS, check "Advanced bios Features", set the boot device to the CD drive, exit and save the BIOS settings. Put the CD in the optical drive. (2) When the Ubuntu boot interface appears boot: prompt, enter rescue and press ENTER. (3) Select the language, Region (country), and keyboard layout, just as you would for a new installation. (4) Enter the hostname, or use the default value (Ubuntu). (5) Select the root partition (a list of the partitions on your hard disk appears on the screen, so you need to know which partition the Ubuntu is installed on). Should be shaped like Dev/discs/disc0/partx, where x is the area code. (6) Then you will enter the command line (a hash). (7) Enter $ GRUB-INSTALL/DEV/HDAX x is the partition of your Ubuntu root directory.

Use LiveCD while preserving Windows Bootloader

Keep in mind that this method installs grub on the MBR of the hard disk (the master boot record of the primary startup records) rather than on the root partition. This is fine for most people unless you already have another startup manager.

In other words, if you use Boot manager such as Boot Magic or system Commander, the commands you see above will overwrite your original boot management.

If you have installed grub to the root partition, the commands will be different. Here's what I use in my system.

How to recover the Grub menu after you use Ghost to restore Windows:

Boot from a Live CD (such as Ubuntu Live,knoppix,mepis or similar). Open the terminal. Switch to Superuser (Superuser). (enter "Sudo-i" in Ubuntu and enter "Su" in a release other than Ubuntu). Enter the root user password. Enter grub and a grub command prompt appears. Enter "Find/boot/grub/stage1". will appear like "(hd0)" Kind of result, on my Computer is "(hd0,3)". Use the results from your computer in the following command. Enter root (hd0,3). Enter Setup (hd0,3). Here is the key. Using "(hd0)" In some other guidelines, "(hd0)" is fine if you want to write grub to the MBR. If you want to write grub to your Linux root partition, you need to add a number after the comma, like "(hd0,3)." Enter "Quit". Remove the live CD and restart the computer.

Use live CD while overwriting windows bootloader

Boot into the desktop from the Live CD. Open the terminal or switch to a TTY (CTRL+ALT+F1). Enter "Grub" to enter "root (hd0,6)", which is the number of your hard disk and boot partition. (My boot partition (boot) is located in/dev/sda7, and converting to Grub is hd0,6). Enter "hd0", or your hard drive number. Enter "Quit" to exit grub. 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.