Article Title: solve the problem that Linux cannot be guided after Windows is reinstalled. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Some people may have installed Linux and dual systems, but in the age when XP is always about to be reinstalled, the following situation occurs:
A friend of the hongmantang student network community installed an XP first, and then installed Ubuntu to guide the dual system to normal. But not many days later, he reinstalled it. Sadly, his Linux cannot be guided into the system.
The reason is that XP won't provide us with system boot programs during installation. Linux has system boot programs, such as GRUB. It is usually installed in the first hard disk (hd0), the first partition (hd, 0) the first sector, so if we install XP on the first partition, then reinstall XP, GRUB is damaged and the system cannot be guided any more.
If this happens, you have to reinstall GRUB. Don't worry, Linux won't be so easy to reinstall. The following describes how to install GRUB:
Method 1
Use Live CD (Desktop, graphical interface) to enter the installation interface, without installing the system, directly open a terminal (Ctrl + Alt + F1 or F2, F3 ...... Enter the following command:
# Su
# Grub:
Grub> root (hdX, Y) X is the first hard disk in Linux, and Y is/boot is in the first partition, all starting from scratch.
Grub> setup (hdX) is generally 0.
Grub> quit
# Reboot
This completes.
Method 2
Use Alternative CD (text mode)
Enter the CD and restart the computer. when entering the first page, set the boot parameters.
Boot: rescue
After the system file is loaded, enter the command line mode
# Grub-install/dev/sda
1. Start with Live CD
2. Open a terminal and run the $ sudo grub command (this may take a while). You will see a prompt like 'grub> '.
3. enter find/grub/stage1 after the prompt 'grub> '. You will get a running result. For example, the result on my machine is (hd0, 5) (This command is actually used to find the partition where/boot is located)
4. Run grub> root (hd0, 5) (enter the running result on your machine)
5. Run grub> setup (hd0) and several lines of text are displayed. The last line is "...". Succeeded "fixed successfully!
6. Run quit
8. restart the computer and retrieve the live CD.
Manual guide to Linux
Grub> root (sd0, 7)
Grub & gt; kernel (sd0, 7)/boot/vmlinuz-2.6.16 ro root =/dev/sda8 -- typelinux = ext3
Grub> initrd (sd0, 8)/boot/initrd. img-2.6.16
Grub> boot
// The above are the parameters in my machine. You can modify them as needed.