How to Use the Grub command to start a corrupted Linux System
Source: Internet
Author: User
Article Title: How to Use the Grub command to start a corrupted Linux system. Linux is a technology channel of the IT lab in China. Some basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source may cause damage to your computer and cannot be automatically started. Of course, there are many reasons, and there are also many possible phenomena.
Here we will talk about the processing method in this case, that is, the screen prompts "grub>", but the data on your hard disk is not lost, and each partition is good.
In this case, your grub information is damaged, but the system cannot be started.
Of course, you can press the c key to enter the "grub>" status when selecting the grub startup item on the screen under normal startup. At this time, we need to use the grub command to manually start the system.
Only four commands are required: boot, kernel, initrd, and boot.
However, grub itself has many commands. For example, you can enter help to view cat in the file content.
First, enter "root (hd)" and press the TAB twice./* This will list possible disk devices on your computer. The hard disk is hd0/hd1 or sd0/sd1 */
Then, select the hard disk you want to install Linux, such as hd0, enter "root (hd0," and press the TAB key twice; /* This will list the partitions on your first hard disk. You will know which one is swap partition, 0x82, and which one is Linux partition 0x83 */
Select the partition of the/boot directory you think is possible, and enter "root (hd0, 1)" and press ENTER;
Next, enter "cat/boot/vm" and press the TAB key twice. If some files starting with the vm appear, such as the vmlinuz-2.6.15-26-386, it indicates the partition where/boot is located.
Delete the last input, enter "cat/boot/initrd", and press the TAB key twice. If some files starting with initrd appear, such as initrd. the img-2.6.15-26-386 indicates that the partition of this/boot is initrd, that is, the ramdisk image;
Delete the last input, enter "cat/sbin/init", and press the TAB key twice. If there are files starting with init, for example,/sbin/init indicates that the partition is;
If the/sbin/init file does not appear, the (hd0, 1) partition is only a/boot partition, not a/partition. Enter the "root (hd0, N)" command again. Here N is a Linux partition, And then try "cat/sbin/init" until/sbin/init appears on the screen, it indicates that you have found the/partition. Strictly speaking, it should be the partition where the/sbin directory is located;
Run the following commands in sequence:
Root (hd0, 1)/* assume/dev/hda2 is the partition where your/boot is located */
Kernel/boot/vmlinuz-2.6.15-26-386 ro dev =/dev/hda3/* suppose/dev/hda3 is your/partition */
Initrd/boot/initrd. img-2.6.15-26-386
Boot
To start the system.
The key issue here is how to determine the system's partitions:/boot // sbin
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