Page 1 of 1

Linux GRUB and grub.conf troubleshooting - part2

PostPosted: Mon Jan 04, 2010 6:04 pm
by debuser
Coming in contact for the first time with a server that fails to boot (from grub configuration errors) can be difficult, if you don't have a copy of the grub.conf at hand.

List available disks at grub prompt
Code: Select all
grub> find (hd        -->TAB key
  Possible disks are:   hd0 hd1


List available disk partition at grub prompt
Code: Select all
grub> find (hd0,        -->TAB key
  Partition num: 0, Filesystem type is ext2fs, partition type is 0x83
  ...
  Partition num: 2, Filesystem type is ext2fs, partition type is 0x83


The above is the INcomplete grub find command. You can also use it to find a grub.conf on the available partitions on each disk.

An example of find command that will find a grub.conf file:
Code: Select all
grub> find (hd0,0)/boot/grub/grub.conf
   (hd0,0)
   (hd0,1)
   (hd0,2)


An example of find command that will NOT find a grub.conf file:
Code: Select all
grub> find (hd0,0)/boot/grub/grub.conf
   Error 15: File not found


Once I know on which disk and partition the grub.conf file resides, I can cat it to have an idea of the GRUB boot configuration:
Code: Select all
grub> cat (hd0,0)/boot/grub/grub.conf
   (hd0,0)
   (hd0,1)
   (hd0,2)


The above command works mostly as the Linux cat command and it will display the contents of the /boot/grub/grub.conf file on the fist partition from the first disk.

Re: Linux GRUB and grub.conf troubleshooting - part2

PostPosted: Mon Jan 04, 2010 7:20 pm
by debuser
To manage to boot the system from GRUB command line, issue the root/kernel/initrd commands in this sequence, as in the grub.conf file in the stanza that interests you (usually, previous running kernel).