LinuxBasics.org

The community that helps people to run Linux

rss

GRUB Command Line

This is how to use GRUB to find information that will allow you to boot. Grub From the Ground Up by Steve Litt has this and more information. Use either a GRUB floppy or GRUB on your MBR. Prior to the default boot taking place, type ‘c’ for ‘command line’. This will give you the prompt for GRUB ‘grub>’

     grub> find /sbin/init
     (hd0,6)
     (hd0,10)

Two partitions have been found which are most likely /dev/hda6 and /dev/hda11. hd0 is not necessarily /dev/hda. That depends on how the system is mapped and whether your drives are IDE or SCSI.

    grub> find (hd0,10)/vml
    grub> find (hd0,10)/boot/vml

Hit the TAB key after typing ‘vml’ and you will get an autocompletion along with a listing of the files beginning with ‘vml’. I used (hd0,10) here, because I am pretty sure that what I’m interested in is the second partition listed. I had 3 kernels listed when I did the second command. There was nothing listed with the first command. Some systems will have the kernel in / rather than /boot; so the first command will produce results. Among my results was vmlinuz-2.6.8.

    grub> find (hd0,10)/boot/init

Again use TAB to complete and you will get a listing of files beginning with init. Among the results was initrd.img-2.6.8.

  grub> cat (hd0,10)/etc/fstab
  grub> cat (hd0,10)/boot/grub/device.map
  grub> root (hd0,10)
  grub> kernel /boot/vmlinuz-2.6.8  root=/dev/hda11
  grub> initrd /boot/initrd.img-2.6.8
  grub> boot

You may or may not need initrd, but if you find it in /boot, use it. You may need to look at device.map to see what the device is that is mapped to hd0 (hd1 or whatever turns up as the place where Linux is located). That will determine what you put for root=/dev/… in the kernel command. Simply add 1 to the second number to get the partition: (hd0,10) becomes /dev/hda11, etc.


Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/advanced/grub_command_line.txt · Last modified: 2008/07/20 19:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig