Article Title: fixed the Linux9GRUB boot. 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.
1. Place the first disk to the optical drive, restart the machine, and use the optical drive to guide the system in BOIS.
2. After the installation page is displayed, press F5 and enter linux rescue after boot, and press Enter.
3. A series of keyboards and a few simple preparations, and then [continue... This process is simple.
4. The character sh # appears #
5. Now we can operate GRUB... Haha... As long as you can see this, it will be a little KISS in the future, I just don't say, everyone can understand, everyone on Earth knows .... Sh # grub
The following figure shows the character grub> after which we can add a space after the character grub> root (hdx, y) grub> setup (hd0) if it succeeds, there will be a successful ...... X here, if it is a disk, It is 0. If the root partition of the linux installation is on the second hard disk, X is 1; Y, is the root partition where the linux system is installed. Setup (hd0) is to write GRUB to the hard disk MBR. Let me give you an example. If my hard disk is used as an example. I installed XP on the first hard disk and rh73on the hda9 on the first hard disk. I have two hard disks in total. If I lose GRUB, I can find it in this way. If you do not know the partition to which your linux is installed, that is to say, you do not know the number of Y, it does not matter. First enter root (hdX, and then use [TAB] to view, I understand it now... the operation is as follows: [the previous boot instructions] sh # grub will display the following grub> and then perform this operation. If I know that my linux is installed on the first hard disk, but I don't know which partition to install, so I can enter root (hd0, and then use the [TAB] key to complete it. Then I understand, you can also enter find/boot/grub. conf find/grub. conf to query the location grub> root (hd0, 8) grub> setup (hd0). Of course, there are some exceptions. For example, MagicLinux still cannot guide the system. The solution is as follows: after the Windows XP system is installed, the GRUB system is missing. boot the F5 linux rescue grub find/grub installation disk of the red flag 4.1. conf Get hd0, 6 root (hd0, 6) setup (hd0) and exit. grub is built, but I can only stay in grub>... In grub>, cat (hd0, 6)/grub. conf, press enter to view the command line, copy the long string command logged on to the first LINUX system, press ENTER boot, press enter to enter the system, and then create a menu in/boot/grub. lst file, directly add grub. copy the content in conf to menu. when the lst is restarted, the grub image interface will be back ~~
---------------------------------------- -----------------------
Fixed the GRUB boot menu, and some friends posted such a post asking me to reinstall win to destroy grub and forget the root password solution. I wrote a solution and set it to the top, you can simply read it later.
1. fdisk/mbr is to write the DOS Boot Record into MBR if grub has problems. 1. Start the boot disk with a prepared floppy disk. If the floppy disk is not ready, use the installation disc to select an upgrade. Finally, you can create a boot disk. after starting the boot disk with the prepared floppy disk, enter grub-install/dev/hda in shell to install grub to MBR.
2. Start from the CD. When boot occurs, enter a series of linux rescue keyboards and several simple configurations. Then, [continue... This process is simple. Then there will be such a character sh # grub which will show grub> we can enter grub> root (hdX, Y) grub> setup (hd0) after such a character) if it succeeds, there will be a successful ...... X here, if it is a disk, It is 0. If the root partition of the linux installation is on the second hard disk, X is 1; Y, it is the root partition where the linux system is installed. If you do not know where the root partition is, df will be displayed. Setup (hd0) is to write GRUB to the hard disk MBR.
2. If the ultimate user forgets his or her password, he or she will not be able to access the system or manage or use the system. This is unlikely to happen, but it is easy for some Linux standalone users, especially beginners. The general solution is to format the hard disk and reinstall the system. How to fix the issue? What should I do if my password is forgotten?
I. lilo
1. When lilo: prompt appears, type the linux single screen to display lilo: linux single
2. Press enter to directly access the linux Command Line
3. # vi/etc/passwd Delete the first line, that is, the content of the row starting with root, namely, the content before root and next, and the first line is similar to root: :...... or directly save passwd
4. # restart reboot. the root password is blank.
Ii. grub
1. When the grub screen appears, use the up and down keys to select the one you usually start linux (do not select dos), and then press the e key
2. Use the up and down keys again to select the one you usually start linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root = LABEL =/), and then press the e key
3. Modify the command line you have seen and add single. The result is as follows: kernel/boot/vmlinuz-2.4.18-14 single ro root = LABEL =/or add single to the end.
4. Press enter to return, and then press the B key to start, you can directly enter the linux Command Line
5. # vi/etc/passwd Delete the first line, that is, the content of the row starting with root, namely, the content before root and next, and the first line is similar to root: :...... or directly save passwd
6. # reboot restart. the root password is empty. If it is not a Dual Boot, it will be started with a prepared floppy disk. linux single, linux 1, and linux-s can all enter the single-user mode, and then passwd, if you have not created a floppy disk, install the CD and start it. Select upgrade to create one.
However, passwd can also be used to install a CD. Enter the linux rescue at the beginning, enter the repair mode, and select read-only or skip. Read-only the mounted hard disk and skip the hard disk. Then chroot. /enter the real single-user mode, and then passwd. if the system does not have a soft drive, the optical drive can remove the hard drive, attach it to another computer with linux or unix, mount it, and find the/etc/passwd That mounts your hard drive, you can also clear the root password. However, I have not tried this method.
---------------------------------------- -----------------------
Repair grub Guide (tools)
1. if you install Grub to MBR and reinstall Windows XP/2 K to clear MBR, how can you fix Grub boot records in MBR? The method described here is to use the Grub4DOS tool. The latest Grub4DOS version can be downloaded here, after that, you can use the WinRAR, WinZIP, or tar zxvf command in Windows to unbind the grub.exe file and place it in your fat/fat32 partition (such as D: \ grub4dos ).
2. Restart to DOS. You can use DOS to start a floppy disk or a CD (I think there is usually a win98 or winme CD ). Enter the code: d: \ grub4dos \ grub.exe to enter the Grub environment. You can see a gurb> prompt. The following is how to restore your Grub boot record.
3. type the code at the Grub> prompt: root (hdx, y) kernel (hdx, y)/boot/yourkernelname ro root =/dev/hdxx setup (hd0) the first command specifies the location of your/boot partition. If your/boot partition is not independent, it is your/partition. The second command specifies the kernel location, which is determined based on your actual situation. The third command is to write Grub boot records into MBR. If you are not clear about the location of your Linux partition, you can use the TAB key complementing function to check and determine. After executing the setup command, you will see succeed! . Now you can restart Grub.
4. If you only want to start Linux instead of repairing Grub, you can enter DOS and enter the following command to start your Linux system. Code: d: \ grub4dos \ grub.exe -- config-file = (hdx, y)/boot/grub. conf. The parameters are the same as above.
---------------------------------------- -----------------------
Fixed the Linux Grub boot (vfloppy). Recently, my machine's hard disk was not enough, so I dropped the drive (occupied location) and installed the second hard disk, then, Windows XP is installed on the first hard disk, and RedHat Fedora Core 1 (Red Hat Linux Personal Edition) is installed on the second hard disk, which is guided by Grub in Linux. Considering that Windows systems often need to be reinstalled, how can we fix Grub boot with a Linux emergency boot disk? The following methods are available for your reference:
I. How can I create a boot emergency drive with mkbootdisk in Linux? It doesn't matter. mkbootdisk can make the boot disk into an image file. On my machine, it does this: mkbootdisk -- device/root/fedora. img 2.4.22-1.2115.nptl. The final parameter is your Linux kernel version. If you do not know the available uname-r, check it. Copy the image file of the floppy disk to the Windows system partition.
2. Find a software named vfloppy with a virtual boot floppy disk. After running the software, load fedora. img into it. It is actually started by adding a floppy disk to the boot. ini of Windows XP. In this way, if you select a floppy disk to start Windows XP, it will enter Linux. If Grub is damaged or the MBR (Master Boot Record) is rewritten after Windows system is reinstalled, you can use this method to start it in Linux, then use grub-install/dev/hda to reinstall Grub. Note: You can also use software such as SRCTools to manage MBR.