Tuesday, March 11, 2014

Using Grub From the Command Line in CentOS

This post will go over some basic commands you can use in the Grub CLI to try to boot a system that is having trouble.

When the system is coming up, be sure to press a key at the initial grub screen so the system does not try to boot automatically.  Once at the OS selection screen, press "c" to enter the grub cli.

In the grub cli, you can issue "help" for a list of commands.


To see what hard disks are available, you can use auto completion.  Start by typing in "root (hd" then tab to get a list of hard disks and partitions.  In this case, there is only one hard disk, and two partitions.


You can now do the same thing to view a list of files on the ext2 boot partition.  Type in "kernel (hd0,0)/" then tab to see a list of files.  In this case, vmlinuz-2.6.32-431.el6.i686 looks like a usable kernel.


If necessary, you can also add in the initial ramdisk.



You can now try booting the system with the "boot" command.

No comments:

Post a Comment