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>’
- First find partitions that are likely to have Linux on them:
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.
- Try to find a kernel on these drives:
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.
- Look at files if you need to with ‘cat’. For example to see /etc/fstab or /boot/grub/device.map:
grub> cat (hd0,10)/etc/fstab
grub> cat (hd0,10)/boot/grub/device.map
- Boot using the info you have gathered:
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.
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our mailing-list is for any Linux-related question.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the mailing-list, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan