Rate this page del.icio.us  Digg slashdot StumbleUpon

Using GRUB to overcome boot problems

by George Hacker

Troubleshooting boot problems can be a very frustrating and challenging process. Sometimes their repair requires the Linux rescue environment, but what can be done if rescue media is not handy? If the system gets past BIOS and loads the GRUB boot loader, often there is much that can be done to get it up and running again.

Basic GRUB usage

Each time a Linux system boots, GRUB flashes by on the screen while it performs a brief countdown. The default countdown on many systems is five seconds but the actual countdown period can be adjusted. GRUB loads the Linux kernel and initial RAM disk image into system memory then fires the system up. When everything goes well and GRUB is finished with its task, the system successfully boots into Linux.

Press any key to enter the menu


Booting Fedora Core (2.6.19-1.2911.fc6) in 5 seconds...
Typical GRUB countdown sequence

Occasionally, GRUB requires some simple intervention. Perhaps a new kernel isn’t working correctly with your system or maybe you want to bring the system into a different runlevel than the default. Hit the ESCAPE key to interrupt the GRUB countdown and bring up GRUB’s main menu.

   GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 +---------------------------------------------------------------------+
 | Fedora Core (2.6.19-1.2911.fc6)                                     |
 | Fedora Core (2.6.19-1.2895.fc6)                                     |
 | Other                                                               |
 |                                                                     |
 |                                                                     |
 |                                                                     |
 |                                                                     |
 |                                                                     |
 +---------------------------------------------------------------------+
     Use the ^ and v keys to select which entry is highlighted.
     Press enter to boot the selected OS, 'e' to edit the
     commands before booting, 'a' to modify the kernel arguments
     before booting, or 'c' for a command-line.
GRUB main menu

At the GRUB main menu a different boot menu item can be selected using the up arrow and down arrow keys. Once the desired menu item has been highlighted, its existing kernel parameters can be changed or additional parameters can be passed to the kernel using the ‘a’ command.

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the
   possible completions of a device/filename.  ESC at any time cancels.
   ENTER at any time accepts your changes.]

grub append> ro root=LABEL=/ rhgb quiet 1
Using ‘a’ to append a run level

Using the ‘e’ command to edit a GRUB menu item

Although the ‘a’ command meets most GRUB editing needs, sometimes more extensive changes are required to get a system up and running. This is where the ‘e’ command comes in handy.

At the GRUB main menu, select the menu option you want to correct then boot from. When you use the ‘e’ command, a simple editing menu will appear allowing you to select the line you wish to edit.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 +---------------------------------------------------------------------+
 | root (hd0,2)                                                        |
 | kernel /vmlinuz-2.6.19-1.2911.fc6 ro root=LABEL=/ rhgb quiet        |
 | initrd /initrd-2.6.19-1.2911.fc6.img                                |
 |                                                                     |
 |                                                                     |
 |                                                                     |
 +---------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press 'b' to boot, 'e' to edit the selected command in the
      boot sequence, 'c' for a command-line, 'o' to open a new line
      after ('O' for before) the selected line, 'd' to remove the
      selected line, or escape to go back to the main menu.
Editing a menu option with the ‘e’ GRUB command

Use the arrow keys to select the particular line you want to modify, then type ‘e’ again to edit that line with the arrow keys, BACKSPACE, INSERT, or DELETE key. Changes are accepted by hitting ENTER or they can be thrown away by hitting ESCAPE. Once the correction has been accepted, typing ‘b’ will cause GRUB to start the boot sequence using the newly-made adjustments.

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the
   possible completions of a device/filename.  ESC at any time cancels.
   ENTER at any time accepts your changes.]

grub edit> initrd /initrd-2.6.19-1.2895.fc6.img
Adjusting the initrd line of a GRUB menu item

Note – All editing changes at boot time are temporary. As smart as GRUB is, it isn’t an operating system so it won’t update the hard drive and fix its configuration file – /boot/grub/grub.conf. That task must be done using a text editor once the system has successfully booted.

For example, let’s suppose an old IDE disk drive has been replaced with a shiny new SATA drive. The new drive has been partitioned, file systems have been formatted, and all of the old data has been copied to the new drive. An initial RAM disk image has been created, but someone forgot to update the /boot/grub/grub.conf configuration file to point to the new RAM disk.

No need for the rescue CD–interrupt the boot sequence and use the ‘e’ command to edit the initrd line in the current GRUB menu item. Point it to the new and improved RAM disk image. Once the system is up and running, the original, obsolete file that got us into this mess in the first place, /boot/grub/grub.conf, can be edited and corrected permanently.

Ultimate GRUB control – the ‘c’ command

The majority of boot problems can be solved with the ‘a’ and ‘e’ GRUB commands, but these two modes of GRUB are just the beginning of what GRUB can do. At boot time, the ‘c’ command accesses the GRUB command line, or shell. Thankfully, rebooting is not necessary to get to the GRUB shell. Log into Linux as root and execute /sbin/grub from the BASH prompt.

    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the
   possible completions of a device/filename.]

grub>
The GRUB shell

Many boot-time GRUB command questions can be answered by using the ‘help’ command. Used by itself, ‘help’ displays a list of the most useful GRUB commands. When used with an argument, it displays a brief synopsis and description of the command specified.

grub> help
blocklist FILE                         boot
cat FILE                               chainloader [--force] FILE
clear                                  color NORMAL [HIGHLIGHT]
configfile FILE                        device DRIVE DEVICE
displayapm                             displaymem
find FILENAME                          geometry DRIVE [CYLINDER HEAD SECTOR [
halt [--no-apm]                        help [--all] [PATTERN ...]
hide PARTITION                         initrd FILE [ARG ...]
kernel [--no-mem-option] [--type=TYPE] makeactive
map TO_DRIVE FROM_DRIVE                md5crypt
module FILE [ARG ...]                  modulenounzip FILE [ARG ...]
pager [FLAG]                           partnew PART TYPE START LEN
parttype PART TYPE                     quit
reboot                                 root [DEVICE [HDBIAS]]
rootnoverify [DEVICE [HDBIAS]]         serial [--unit=UNIT] [--port=PORT] [--
setkey [TO_KEY FROM_KEY]               setup [--prefix=DIR] [--stage2=STAGE2_
terminal [--dumb] [--no-echo] [--no-ed terminfo [--name=NAME --cursor-address
testvbe MODE                           unhide PARTITION
uppermem KBYTES                        vbeprobe [MODE]

grub> help help
help: help [--all] [PATTERN ...]
    Display helpful information about builtin commands. Not all
    commands aren't shown without the option `--all'.

grub>
Asking GRUB for help

As you can see, many GRUB commands take file names as arguments. The full syntax for GRUB file names is (DEVICE,PARTITION)/PATH/NAME. DEVICE can use ‘fd0′ to specify the floppy disk. In this case PARTITION isn’t used because floppies usually contain a single file system on the entire media. Most GRUB scenarios involve access to a hard drive. Hard drives have GRUB names such as ‘hd0′ or ‘hd1′ regardless of their type–IDE vs. SCSI vs. SATA. Most of the time hard drive path names require the PARTITION number to be specified. GRUB counts partitions starting at zero so the Linux partition /dev/sda1 would be represented in GRUB as (hd0,0), /dev/sda2 would be (hd0,1) and so on.

Let’s see if we can put this new GRUB pathname knowledge to good use. The ‘cat’ GRUB command is similar to its Linux counterpart–it displays the contents of text files to the screen. When used with large files, the GRUB ‘cat’ command displays the file one screen at a time much like the Linux command ‘less’.

grub> cat (hd0,2)/sample-file
Here is a small sample file of text located at
/boot/sample-file.  It is not very interesting.

grub>
Viewing a small file with the GRUB ‘cat’ command

Typing full GRUB pathnames gets old fast–especially if you need to view many files while looking for useful information. The ‘root’ GRUB command instructs GRUB to search a single drive or partition when the (DEVICE,PARTITION) portion of file pathnames is omitted.

grub> root (hd0,2)
 Filesystem type is ext2fs, partition type 0x83

grub> cat /sample-file
Here is a small sample file of text located at
/boot/sample-file.  It is not very interesting.

grub>
Using the ‘root’ command to shorten pathnames

Like the BASH shell, GRUB has command and filename completion that is invoked by using the TAB key. The filename in the above example could have been specified using /sa[TAB]. If more than one file starts with “sa” the TAB key will complete the filename as much as it can then display a list of all filenames that start with the given string. GRUB is smart enough to put a trailing slash at the end of directories when using filename completion.

Let’s put what we know together and use GRUB to help us determine which partition contains the root filesystem:

        grub> root (hd0,1)
	 Filesystem type is ext2fs, partition type 0x83

	grub> cat /etc/passwd

	Error 15: File not found

	grub> root (hd0,2)
	 Filesystem type is ext2fs, partition type 0x83

	grub> cat /etc/passwd
	root:x:0:0:root:/root:/bin/bash
	bin:x:1:1:bin:/bin:/sbin/nologin
	daemon:x:2:2:daemon:/sbin:/sbin/nologin
	adm:x:3:4:adm:/var/adm:/sbin/nologin
	lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
	...

	grub>

If hd0 in the example is an IDE drive, Linux refers to the root partition as /dev/hda3. This information can be passed as to the kernel as the ‘root=/dev/hda3′ parameter when we boot our system.

GRUB has a command that makes finding pathnames in partitions even easier. Amazingly enough, it’s called ‘find’. Although this command is easier to use, it can often take a very long time to execute. It will display all of the partitions that contain the filename specified.

grub> find /etc/passwd
 (hd0,2)

grub>
Using the ‘find’ command to locate a file

GRUB will automatically invoke its shell at boot time if it cannot locate its configuration file. This happens when the configuration file is accidentally renamed or deleted. The ‘configfile’ command can be used to load an alternate configuration file that conforms to the /boot/grub/grub.conf GRUB syntax and commands. For example, the following sequence of commands will locate a backup copy of the grub.conf configuration file, assuming we have a backup copy. Before the backup configuration file can be used, its name and location must be determined:

	grub> find /grub/grub.conf

	Error 15: File not found

	grub> find /grub/grub.conf.bak
	 (hd0,2)

	grub> configfile (hd0,2)/grub/grub.conf.bak

Conclusion

We’ve explored the three basic modes of the GRUB boot loader: a – append mode, e – edit mode, and c – command mode. Also, we’ve examined some of the more useful GRUB shell commands. Don’t wait for a boot-time mishap to practice using these commands. Experiment with them when you have some spare time. Try some of the GRUB commands that weren’t discussed in this article–on a non-production server of course. Don’t fear the GRUB boot loader; embrace it and harness its power for good. Someday your system’s health may depend on it.

44 responses to “Using GRUB to overcome boot problems”

  1. ajay says:

    How to use GRub in linux?

  2. ntk says:

    Hello
    How to deal with situation when grub-install script does not recognize software raid devices /dev/md? . It says something like “…/dev/md0 does not have corresponding bios drive”
    Regards
    Nikolay Kabaivanov.

  3. Jan Kozanek says:

    With sw RAID devices you have to instruct grub specifically on the BIOS harddisk position and partition location as with a normal ext3 partition. Thus in case of RAID1, you would manually install grub on both 1st disk [ root (hd0,0), setup (hd0) ] and immediately also on the second disk [ root (hd1,0), setup(hd1) ].

  4. Noushad says:

    Hi,

    Can you please explain how we can reinstall grub from grub command prompt.

    Thanks
    Noushad.

  5. George Hacker says:

    Noushad,

    It depends what you mean by “reinstall.” If you need to repair GRUB you will probably have to boot into the rescue environment using a rescue CD. To reinstall GRUB and its various components, you will have to use a command like the following:

    rpm -ivh /path/to/grub-0.95-3.5.i386.rpm –root /mnt/sysimage –force

    (assuming you have access to a current copy of the grub RPM in the rescue environment). Next we need to reinstall GRUB into the master boot record of the hard drive. In the following example, I’m going to assume the /boot partition is the first partition of the first disk drive:

    bash# grub
    GNU GRUB version 0.95 (640K lower / 3072K upper memory)

    [welcome banner snipped]

    grub> root (hd0,0)
    Filesystem type is ext2fs, partition type 0x83

    grub> setup (hd0)
    Checking if “/boot/grub/stage1″ exists… no
    Checking if “/grub/stage1″ exists… yes
    Checking if “/grub/stage2″ exists… yes
    Checking if “/grub/e2fs_stage1_5″ exists… yes
    Running “embed /grub/e2fs_stage1_5 (hd0)”… 15 sectors are embedded.
    succeeded
    Running “install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/grub
    .conf”… succeeded
    Done.

    grub> quit

    Now you have grub reinstalled into the master boot record of your machine.

    George

  6. Pete says:

    Your coverage of grub is welcome.

    My preference is a bootable CD with grub on it … boots in seconds to the grub> prompt and can be used to re-install grub along with a myriad of other little tasks. On my list of “want to do’s” is putting grub onto a bootable flash for the same reason. Documented in the grub manual and there are other informal howto’s on line as well.

  7. arvind says:

    Does anyone know if it is possible check the system time using grub and boot a particular OS depending on the time of day?

    Arvind

  8. George Hacker says:

    Arvind,

    GRUB won’t do that kind of thing automatically. It doesn’t have any commands which will read the system clock. GRUB is pretty smart, but it’s not as smart as an operating system.

    One possibility is to have an operating system detect the current time, modify the GRUB config file to boot the other OS, and then reboot.

    Perhaps if we take a step back and look at the BIG picture you may want to use virtualization to accomplish what you need.

    George

  9. jubrits says:

    Hello

    How do i choose the Command Line insted of GUI(or vice versa) when i reboot my fedora 6?

    thanks

  10. AgarTurbo says:

    I have software-based RAID1 device (/dev/md0) and allowed up2date to update my kernel. Now the /boot folder on (hd1,0) has the updated kernel files while /boot on (hd0,0) does not. How do I get grub to update the /boot folder on (hd0,0) with the new kernel files and grub.conf (this partition is not available after boot-up – it is buried by /dev/md0).

    Thanks.

  11. George Hacker says:

    Jubrits,

    To go in to command line vs. GUI mode when you reboot, when GRUB starts the countdown, hit [escape] then use the ‘a’ command to add a runlevel at the end of the kernel line. If you type a 3, you will go into a text based login. A 5 at the end of the kernel line will take you into GUI mode. A better approach would be to copy a stanza in your grub.conf file and make the original stanza GUI and your copy go into text mode.

    AgarTurbo,

    I’m not sure how your disk is layed out exactly. If (hd1,0) and (hd0,0) are RAID1 devices, they should both have copies of the same kernels and other files.

    George

  12. arvind says:

    Hi George,

    Thanks for your response. I thought of letting the OS boot, check the system time and then modify GRUB accordingly and then re-boot. If the default OS is Linux then this is fine, but what happens when it makes Windows the default. The next time the machine boots, I don’t think Windows can modify the grub config file to make the machine boot back into Linux.

    I know (based on experience with Mandrake 9), that LILO can be set up so that on rebooting, the computer boots into a particular OS WITHOUT necessarily permanently setting that OS as the default. Can GRUB do something similar?

    If I can get GRUB to do that then I can set Linux as the default OS, and then have Linux check the system time and re-boot into the desired OS according to the time of day.

    What do you think?

  13. George Hacker says:

    Arvind,

    The /boot partition doesn’t have to be ext3 for GRUB to work. So why not format /boot as vfat/fat32, that way both linux and Windows could access it. If the /boot partition is located past the C: drive, you would access it as D:. You would need to write a Windows script that could modify D:\grub\grub.conf properly (line endings should be LF, not CR-LF like Windows prefers).

    George

  14. pohmel says:

    …but anyway, what problems can rise the GRUB? i don’t know why my Linux don’t want to starting up. Is GRUB can help me to know it?

  15. sunny says:

    hi,
    I have linux insatlled on a IBM A Pro the problem is after booting it just flashes the nvidia screen continuously. like the nvidia screen with logo comes and then there is a blank. than again nvidia logo screen comes and there is a blank. can any one suggest what to do. Can GRUB solve this problem

  16. George Hacker says:

    GRUB can’t solve your problem, but it can help you get control of your system so you can.

    The problem you are having is your system is trying to come up in runlevel 5 (X graphical login) and somehow X is misconfigured. When you boot, interrupt GRUB and use the “append” command to add a 3 to the end of the kernel line. This will cause you to enter runlevel 3 (non-graphical multiuser mode). At this point you can login as root and try to get your graphics problem corrected.

  17. satish malik says:

    my pc is not shutdown properly due to fluctuation in light.so it causes problem in booting.when it boots it shows no logical drive found message and swap space ok then hangs up

  18. Wayne Sweatt says:

    George,

    This is more of a “GRUB related” question concerning the GRUB specified kernel/initrd images running and then encountering problems mounting the disk.
    If there is a filesystem related module loading problem or mismatch in partition-labels, that causes the kernel to panic during mount time…
    How do I navigate the apparently frozen screen up, or, how would I configure GRUB to log kernel/ramdisk errors as it tries to mount the disk? Sometimes important errors run off the screen during this critical period between GRUB-ramdisk and init. It *would* be great to boot back up in rescue mode and see what the boot messages that ran off the screen were.
    Thanks!
    -wayne

  19. George Hacker says:

    Satish,

    Your problem will probably require you to use the rescue environment to find out what is happening to your disks. GRUB successfully loads the kernel and ramdisk image and it sounds like init is getting started, but your disk subsystems are probably having issues. You may need to run fsck from the rescue environment to fix the problems that cause your disks not to be mounted.

    Wayne,

    GRUB will not log to disk. It loads the kernel into memory then has the processor execute the kernel. So when your messages stream by off of the screen, it is the kernel doing that, not GRUB. Also GRUB is not an O/S, so you can’t get it to write or log to disk (not enough stuff running yet).

    I think you can type [ctl]S and [ctl]Q to get the kernel to pause/resume when it boots up. Give that a try. Also try [shift]PgUp to see if you can go back to earlier pages. I’m sure this won’t work once you get the kernel panic.

    George

  20. Sean says:

    I have a seperate problem when I run setup (hd0)

    this is what I get:

    grub> root (hd0,0)
    Filesystem type is ext2fs, partition type 0×83

    grub> setup (hd0)
    Checking if “/boot/grub/stage1″ exists… no
    Checking if “/grub/stage1″ exists… yes
    Checking if “/grub/stage2″ exists… yes
    Checking if “/grub/e2fs_stage1_5″ exists… yes
    Running “embed /grub/e2fs_stage1_5 (hd0)”… 15 sectors are embedded.
    succeeded
    Running “install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/grub
    .conf”… failed

    Error 22: Not such partition

    How can I fix this?

  21. George Hacker says:

    I need some more background. How did you get to that point, Sean?

  22. Australia says:

    Your problem will probably require you to use the rescue environment to find out what is happening to your disks.

  23. Satish says:

    i have purcgased a new laptop which consists of a 160gb hdd, configured with linux as primary and the other has w95.
    by mistake i have deleted both the partition.
    now when i boot up i get only
    grub>
    on the screen.
    i dont have a linux cd nor a recovery cd. I only have a W-xP cd, which i want to install in this machine.
    what do i do., how do i go about it

  24. Vivek says:

    I have a problem,I install linux enterprise edition -4 & I was having windows xp also on my laptop ,after a few days I formatted the drive which was containing the Linux.After this when I restarted the laptop again it is not allowing me to boot windows,only a grub comamand prompt is coming .How can I solve this problem.Please someone help me .Thanks!

  25. George Hacker says:

    Vivek,

    The first stage of GRUB lives in the MBR (first sector) of your hard drive and it is still intact. When your system boots, the first stage of GRUB looks for the second stage of GRUB which lives in the /boot/grub directory in Fedora/RHEL. Since you reformatted your disk with Linux, GRUB can’t find the second stage (therefore your system won’t boot properly).

    One way you can solve your problem is to reinstall Linux.

    Another option is to boot into Windoze and use the FIXMBR command to reinstall ntloader into the MBR.

    Another way is to boot into the rescue environment and use it to install GRUB onto a memory stick. You will need to configure grub to boot from the Windoze partition (look at the rootnoverify and chainloader commands for more info).

  26. Arun says:

    Hi,
    I have used follwin grub command to recover my overwriten MBR

    grub>partnew (hd0,0) 0x0b 63 1112399
    grub>partnew (hd0,0) 0x0b 1112462 1112399

    when I restarted the comp i am unable to come out of bios prompt

    Enter setup….
    press F12 to select nework boot….

    please help.

  27. Diganth says:

    hi,
    I have few Linux ISOs on hard disk. pls tell me how to install
    from hard disk.I have GRUB too.

  28. arun says:

    Hi,
    I have used follwing grub command to recover my overwriten MBR
    i.e.

    grub>partnew (hd0,0) 0×0b 63 1112399
    grub>partnew (hd0,1) 0×0b 1112462 1112399

    when I restarted the comp I am unable to come out of bios prompt

    It got struc at follwing Messge.

    “Enter setup….”
    “press F12 to select nework boot….”

    please help.

  29. arun says:

    Hi,

    I have used follwing grub command to recover my overwriten MBR
    i.e.
    grub>partnew (hd0,0) 0×0b 63 1112399
    grub>partnew (hd0,1) 0×0b 1112462 1112399

    when I restarted the comp, I see that its unable to come out of bios prompt
    It got struc at follwing Messge.

    “Enter setup….”
    “press F12 to select nework boot….”

    1)Plese let me whats wrong int the usage of PARTNEW command
    as i mentioned above.
    2) How To Recover my harddisk from here now..

    Please guide me

    Thanks,
    Arun

  30. Sayantani says:

    hi,

    I have Windows XP and Linux installed on my machine. Today suddenly, when I booted my PC, the grub> command prompt is being shown instead of the list of the OS’s.
    I don’t have a recovery CD.

    What do i do?

    P.S. When I tried “find /grub/grub.conf” command, nothing is returned and it shows back the grub> command line.

  31. faith says:

    Would you tell me command to log onto windoze partition? Have 3 partitions hdo,o) hdo ,1 and then windoze for xp pro, which – cannot lopg on due to cd w/o sp1 2
    Thank you

  32. George Hacker says:

    Arun,

    How did you determine the sector addresses of your partitions? Also if both partitions you are creating are 0x0b (W95 FAT32) why are you using GRUB to try to recover Windows?

    Diganth,

    To install from the ISO’s, you need to first extract the anaconda kernel and initial RAM disk from the DVD. Mount the DVD using a loop interface and extract the /images/pxeboot directory. That directory contains a vmlinuz file (kernel) and an initrd.img. Put these in a directory GRUB can access (/boot?) and boot the anaconda kernel with the RAM disk using grub. The commands you will need to use are ROOT, KERNEL, and INITRD.

    Sayantani,

    What did you recently do to your PC since your last successful boot? At least GRUB is able to find stage2 and display the GRUB> prompt. It cannot find the GRUB config file so it cannot display a menu.

    Not knowing how your machine is partitioned, there are a couple of reasons why the find command fails. The first is you deleted the grub.conf file so there is nothing to find. The second cause would be that you don’t have a separate /boot partition. If this is the case, try ‘find /boot/grub/grub.conf’ and see if that works.

    Faith,

    Assuming the third partition has Windows, you may want to try the following:

    rootnoverify (hd0,2)
    chainloader +1

    To all readers,

    Each system is a little different and there can be a variety of reasons why it no longer is bootable. I hope you have found my article to be useful and informative. I will not respond to any additional responses to this article asking for troubleshooting tips for a particular system boot problem.

    Best wishes,

    George

  33. jun says:

    IF the computer which installed redhat is frozen, what should I do? Eg. with windows, press Ctrl+Alt+Delete, in windows task manager, I can either stop the program running or shutdown. What about with linux?

  34. vijay says:

    use #ps -a or pstree to identify the process
    then use #kill (process id)

  35. Jimmi says:

    Hi,

    I’m having a Redhat 7.2 boot problem, the symptom is shown below:

    >>EXT3-fs error (device ide0(3,2)): ext3_check_descriptors: Block bitmap for group 1 not in group (block 0)!
    >>mount: error 22 mounting ext3
    >>pivotroot: pivot_root(/sysroot,/sysroot/initrd) failed: 2
    >>Freeing unused kernel memory: 220k freed
    >>Kernel panic: No init found. Try passing init= option to kernel.
    ———-

    Can I recover this from GRUB?
    Someone says that “/initrd” is missing, but how can I make that?

    Thank you…

  36. abhijeet says:

    Am having same problem as Sayantani mentioned above. I want to remove red hat linux and want to continue using my windows.

  37. RAVI GOSAIN says:

    I am using RHEL 5

    When i have add one more hdd to the existing hdd the following error came after system reboot and now syste is not booting with linux and generates the following error

    GNU GRUB version 0.97 (572K lower / 1020992K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ]

    I have tried the following commonds for the resolution but failed to recover please help me

    grub> root (hd0,0)
    Filesystem type is unknown, partition type 0×83

    grub> setup (hd0)
    can not mount selected partition

    thanks,

    Ravi gosain

  38. alok raj says:

    hi i m alok raj i have a problam
    if in /boot/vmlinuz-2.6.18-92 is missing and i am try to install this but problam is agian …..in linux rescue
    /etc/mnt/Server dirctory is not show what i do ….?

  39. Andres says:

    Hello,
    Very interesting article and thread, thanks!
    I have a problem with grub that I fail to understand. AFter an installation of Linux (rhel as 4) I got the red screen of death (illegal opcode).
    I supposed that it was a problem with grub, and after several attempts of unsuccessfully fixing it using the rescue option, I was able to boot the system using a CD with an image of GRUB on it.
    I can’t make the hardisk to boot by itself but it works perfectly when I use grub from the CD and point it to the kernel image on the hard disk.

    According to the Grub manual the failure is related to stage 1 (GRUB Hard Disk Error).

    Any help will be greatly appreciated, I need to install our Production Database in this system as soon as posible.
    Thanks a million,
    andres

  40. Punit says:

    Hello all,

    Can I use GRUB to boot using blockdevices(and virtual harddisks like vdi which can be easily mounted as Blockdevice in linux using mount command)?

    I tried it using chainloader, but it says
    ‘Invalid Executable Format…’.
    I don’t remember it exactly.

    To be more precise,
    I had a vdi(Virtual disk for VirtualBox) that was in my Home folder. I created a HardLink of it in /boot folder. But trying to boot using chainloader(I know the offset where partition starts), gives me Error as mentioned above.

    Please help me.

    Thanks in advance.

  41. jagan says:

    hai friends.

    i got installed two operating systems on my pc. but i formatted the linux partition. so now im unable to enter into windows xp. Now it is showing the msg as below

    GNU GRUB version 0.97 (640K lower / 3072K upper memory)

    [ Minimal BASH-like line editing is supported. For the first word, TAB
    lists possible command completions. Anywhere else TAB lists the
    possible completions of a device/filename.]

    so, help me i dont have linux software thats the problem.
    please give me steps to enter into windows xp.and send me a mail please. jaggumec@gmail.com
    Thanks in advance.
    jagan

  42. Eno Compton says:

    George,

    Could you be available to help me solve a problem with rc.sysinit that I believe has to do with my misunderstanding of bash script syntax.

    I have an immediate and urgent need.

    Eno

  43. Raghuvendra says:

    Hi,

    I have a lenovo laptop with windows vista installed over it.Few days back also i installed ubuntu over it. Till then it was booting properly for both vista and ubuntu.Somehow i didnt like ubuntu so i replaced it with RedHat ES-4. But to my suprise, vista was lost . At the time of booting it only shows linux boot option. I believe that by making some appropiate changes in the grub we can fix it.

    My target is to make the laptop both vista and redhat ready.

    Please help me to resolve this problem.

    Raghuvendra Kumar

  44. sachin bamane says:

    Hi
    I am using GRUB as a boot loader and trying to compile new kernel with RHEL4 2.6.9-5.EL. I have compiled the kernel saved the copy as /boot/mynewkernel along with System.map file. But still unable to boot the new kernel with prompt

    VFS: Cannot open root device “VolGroup00/LogVol00″ OR unknown-block(0,0)
    please append a correct “root=” boot option
    Kernel panic – not syncing: VFS: unable to mount root fs on unknown-block(0,0)

    the grub.conf file contents are as :
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Red Hat Linux AS (2.6.9-5.EL)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-5.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    initrd-2.6.9-5.EL.img

    title My New Kernel

    please help

    a.sachin2003@gmail.com