How to restore Double boot with the original Linux after reloading Windows

zhaozj2021-02-11  195

How to restore Double boot with the original Linux after reloading Windows

LILO is a very small program that allows users to choose which operating system when the system is started. By default, LILO is installed on the MBR (main boot sector) of the main hard disk, but when reinstalling Windows, Windows will change the MBR of the main hard disk, rush down the Lilo program that is stored on the MBR. This article will introduce some ways to let you enter Linux after reinstalling Windows. Reinstalling Windows before reinstalling Windows, it is important to have a Linux boot disk that can be used normally. Typically, the startup disk is the only way to enter Linux after installation of Windows. Most Linux issues will prompt the user to make a boot disk during the installation process. After making a boot disk, we should test it to ensure that this floppy disk can correctly guide the Linux system (note that the floppy is not a very reliable storage medium). The test process is: Insert the boot disk into the floppy drive, then log in with the root user, enter the command shutdown -r now and enter the bus. If the Linux system can start from the floppy disk, then you have prepared to install Windows, you can skip the following, directly to "reinstall LILO". Method for making a boot disk If your boot disk is faulty, or if you don't make a boot disk at all, then you must make up this step before you install Windows. In addition, whenever you change the kernel of the Linux system, you also need to re-create a label. The simplest way to make a boot disk is to use the mkbootdisk command. However, before using this command, you need to understand the current Linux kernel version. The lilo.conf file can be obtained by kernel version information, which contains LILO configuration information and storage location of the kernel file. Before viewing the lilo.conf file, you should make sure that you do not log in with root (this can prevent you accidentally damage the system file), then enter the command Pico /etc/lilo.conf, open the file in the Pico text editor. In the lilo.conf file, each section describes an operating system installed on your computer, starting with image =, at least three lines of text. In addition, some section is to describe from a floppy disk or start in a fault recovery mode. Find the section containing label = Linux, check the core version information described in the relevant image = row, then enter Ctrl-x exit Pico. In the Red Hat 6.0 test system we use, lilo.conf uses VMLinuz-2.2.5-15 to represent the name and location of the Linux kernel image file, which means that the kernel version we use is 2.2.5-15. Then we can use the mkbootdisk command. However, in some systems, the lilo.conf file does not provide kernel version information, but simply contains image = / boot / vmlinuz. If no version information is provided after VMLinuz, this means that the lilo.conf file may use a symbolic link (a bit similar to shortcuts in Windows). In order to find the real kernel image file, enter the command ls -l / boot and enter. This command will display details of the files in the boot directory. Check out the rows that contain VMLinuz, you can see the true kernel image file points to the arrow, and the latter usually contains the appropriate version information. In the test system we use, although the name and location of the kernel file is already included in the lilo.conf file, there is a symbolic link to the name of VMLinuz in the boot directory.

转载请注明原文地址:https://www.9cbs.com/read-3641.html

New Post(0)