My method for re-installing debian's grub

Source: Internet
Author: User
My method for re-installing debian's grub-Linux Release Technology-Debian information. The following is a detailed description. Use ubuntu live cd to reinstall grub that is lost due to re-installation of xp.

1. Start the system with the live cd. Press ctrl + alt + f4 (f4 can be changed to another one) to switch to the terminal.

2. Enter sudo fdisk-l and you will see that sda7 sda8 sda9 is the debian partition, and sda8 is the swap partition.

3. Enter the following parameters:
Sudo-s-H
Sudo mkdir-p/mnt/sda6 somehow, it must be talented.
Sudo mount-t ext2/dev/sda6/mnt/sda6
Sudo mount-t proc none/mnt/sda6/proc
Sudo chroot/mnt/sda6/bin/bash
Source/etc/profile
Grub
Root (hd0, 6) Note that hd is followed by zero, not an English mother.
Setup (hd0) is zero here


4. restart the system and then go to the grub system boot. At this time, you also need to modify the following system boot Project

Title Debian GNU/Linux, kernel BRL. 8-2-386
Root (hd0, 8)
Kernel/boot/vmlinuz-2.6.8-2-386 root =/dev/sda9 ro
Initrd/boot/initrd. img-2.6.8-2-386
Savedefault
Boot

Title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
Root (hd0, 8)
Kernel/boot/vmlinuz-2.6.8-2-386 root =/dev/sda9 ro single
Initrd/boot/initrd. img-2.6.8-2-386
Savedefault
Boot

To:
Title Debian GNU/Linux, kernel BRL. 8-2-386
Root (hd0, 6)
Kernel/boot/vmlinuz-2.6.8-2-386 root =/dev/sda7 ro
Initrd/boot/initrd. img-2.6.8-2-386
Savedefault
Boot

Title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
Root (hd0, 6)
Kernel/boot/vmlinuz-2.6.8-2-386 root =/dev/sda7 ro single
Initrd/boot/initrd. img-2.6.8-2-386
Savedefault
Boot

Actually, only four numbers are changed. After the modification is completed, the system will be guided by B. During debian startup, the system stops and requires you to enter the root password or press ctrl + D. Do not enter the password and press ctrl + D to start the system.
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.