The GRUB Shell

In addition to using the command line from within the GRUB menu interface (or booting directly to the command line), you can run a GRUB shell directly from the Linux command line with the grub command. For the most part, using the grub shell is the same as running in the native command-line environment. The major difference is that the shell uses operating system calls to emulate the BIOS calls that the native environment uses. That can lead to some differences in behavior.

The syntax of the grub command is:

grub [options]

For example:

$ grub --no-floppy

The grub command-line options are:

--batch

Turn on batch mode for noninteractive use. Equivalent to grub --no-config-file --no-curses --no-pager.

--boot-drive=drive

Use drive as the Stage 2 boot drive, specified as a decimal, hexadecimal, or octal integer. The default is hexadecimal 0x0.

--config-file=file

Use file as the GRUB configuration file. The default is /boot/grub/menu.lst.

--device-map=file

Use file for the device map. The value of file is usually /boot/grub/device.map.

--help

Display a help message to standard output and exit.

--hold

Wait for a debugger to attach before starting grub.

--install-partition=partition

Use partition as the Stage 2 installation partition, specified as a decimal, hexadecimal, or octal number. The default is hexadecimal 0x20000.

--no-config-file

Run without reading the configuration file.

--no-curses

Don’t use the curses interface for managing the cursor on the screen.

--no-floppy

Don’t probe for a floppy ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.