Sunday, January 8, 2012

GRUB - COMMAND LIST

What is Grub?


Grub is a Bootloader( first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system) Package For GNU Project.


It Stands For Grand Unified Bootloader.Grub is developed to support multiple operating systems and allow the user to select among them during boot-up.Grub is Mostly Used in Unix Like Operating Systems.Most Of The Linux Distributions Available in The Industry Uses Grub as its Default Bootloader.


So,When You Do MultiBoot,I.e Dual Booting With a Linux Os On Windows, Grub Replaces Your Default Windows Bootmanager Allowing You To Flexibily Choose Between Windows And Other OS.


Here Are The GRUB Commands.


Command                         Description
blocklistblocklist FILE
Print the blocklist notation of the file FILE.
bootBoot the OS/chain-loader which has been loaded.
catcat FILE
Print the contents of the file FILE.
chainloaderchainloader [--force] FILE
Load the chain-loader FILE. If --force is specified, then load it forcibly, whether the boot loader signature is present or not.
colorcolor NORMAL [HIGHLIGHT]
Change the menu colors. The color NORMAL is used for most lines in the menu, and the color HIGHLIGHT is used to highlight the line where the cursor points. If you omit HIGHLIGHT, then the inverted color of NORMAL is used for the highlighted line. The format of a color is "FG/BG". FG and BG are symbolic color names. symbolic color name must be one of these: black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white. But only the first eight names can be used for BG. You can prefix "blink-" to FG if you want a blinking foreground color.
configfileconfigfile FILE
Load FILE as the configuration file.
debugTurn on/off the debug mode.
devicedevice DRIVE DEVICE
Specify DEVICE as the actual drive for a BIOS drive DRIVE. This command can be used only in the grub shell.
displaymemDisplay what GRUB thinks the system address space map of the machine is, including all regions of physical RAM installed.
embedembed STAGE1_5 DEVICE
Embed the Stage 1.5 STAGE1_5 in the sectors after MBR if DEVICE is a drive, or in the "bootloader" area if DEVICE is a FFS partition. Print the number of sectors which STAGE1_5 occupies if successful.
findfind FILENAME
Search for the filename FILENAME in all of partitions and print the list of the devices which contain the file.
fstestToggle filesystem test mode.
geometrygeometry DRIVE [CYLINDER HEAD SECTOR [TOTAL_SECTOR]]
Print the information for a drive DRIVE. In the grub shell, you canset the geometry of the drive arbitrarily. The number of the cylinders, the one of the heads, the one of the sectors and the
one of the total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR, respectively. If you omit TOTAL_SECTOR, then it will be calculated based on the C/H/S values automatically.
helphelp [PATTERN ...]
Display helpful information about builtin commands.
hidehide PARTITION
Hide PARTITION by setting the "hidden" bit in its partition type code.
impsprobeProbe the Intel Multiprocessor Specification 1.1 or 1.4 configuration table and boot the various CPUs which are found into a tight loop.
initrdinitrd FILE [ARG ...]
Load an initial ramdisk FILE for a Linux format boot image and set the appropriate parameters in the Linux setup area in memory.
installinstall STAGE1 [d] DEVICE STAGE2 [ADDR] [p] [CONFIG_FILE] REAL_CONFIG_FILE]
Install STAGE1 on DEVICE, and install a blocklist for loading STAGE2 as a Stage 2. If the option `d' is present, the Stage 1 will always look for the disk where STAGE2 was installed, rather
than using the booting drive. The Stage 2 will be loaded at address ADDR, which will be determined automatically if you don't specify it. If the option `p' or CONFIG_FILE is present, then the first block of Stage 2 is patched with new values of the partition and name of the configuration file used by the true Stage 2 (for a Stage 1.5, this is the name of the true Stage 2) at boot time. If STAGE2 is a Stage 1.5 and REAL_CONFIG_FILE is present, then the Stage 2 CONFIG_FILE is patched with the configuration filename REAL_CONFIG_FILE.
ioprobeioprobe DRIVE
Probe I/O ports used for the drive DRIVE.
kernelkernel FILE [ARG ...]
Attempt to load the primary boot image from FILE. The rest of the line is passed verbatim as the "kernel command line". Any modules must be reloaded after using this command.
makeactiveSet the active partition on the root disk to GRUB's root device. This command is limited to _primary_ PC partitions on a hard disk.
mapmap TO_DRIVE FROM_DRIVE
Map the drive FROM_DRIVE to the drive TO_DRIVE. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive.
modulemodule FILE [ARG ...]
Load a boot module FILE for a Multiboot format boot image (no interpretation of the file contents is made, so users of this command must know what the kernel in question expects). The rest
of the line is passed as the "module command line", like the `kernel' command.
modulenounzipmodulenounzip FILE [ARG ...]
The same as `module', except that automatic decompression is disabled.
pausepause [MESSAGE ...]
Print MESSAGE, then wait until a key is pressed.
quitExit from the GRUB shell.
readread ADDR
Read a 32-bit value from memory at address ADDR and display it in hex format.
rootroot [DEVICE [HDBIAS]]
Set the current "root device" to the device DEVICE, then attempt to mount it to get the partition size (for passing the partition descriptor in `ES:ESI', used by some chain-loaded bootloaders),
the BSD drive-type (for booting BSD kernels using their native boot format), and correctly determine the PC partition where a BSD sub-partition is located. The optional HDBIAS parameter is a number to tell a BSD kernel how many BIOS drive numbers are on controllers before the current one. For example, if there is an IDE disk and a SCSI disk, and your FreeBSD root partition is on the SCSI disk, then use a `1' for HDBIAS.
rootnoverifyrootnoverify [DEVICE [HDBIAS]]
Similar to `root', but don't attempt to mount the partition. This is useful for when an OS is outside of the area of the disk that GRUB can read, but setting the correct root device is still desired. Note that the items mentioned in `root' which derived from attempting the mount will NOT work correctly
setkeysetkey TO_KEY FROM_KEY
Change the keyboard map. The key FROM_KEY is mapped to the key TO_KEY. A key must be an alphabet, a digit, or one of these: escape, exclam, at, numbersign, dollar, percent, caret,
ampersand, asterisk, parenleft, parenright, minus, underscore, equal, plus, backspace, tab, bracketleft, braceleft, bracketright, braceright, enter, control, semicolon, colon, quote, doublequote, backquote, tilde, shift, backslash, bar, comma, less, period, greater, slash, question, alt, space, capslock, FX (X is a digit), and delete.
setupsetup INSTALL_DEVICE [IMAGE_DEVICE]
Set up the installation of GRUB automatically. This command uses the more flexible command "install" in the backend and installs GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified, then find the GRUB images in the device IMAGE_DEVICE,
otherwise use the current "root device", which can be set by the command "root".
splashscreensplashscreen FILE
Load file as splashscreen hook and call it each time the screen is to be cleared
testloadtestload FILE
Read the entire contents of FILE in several different ways and compares them, to test the filesystem code. The output is somewhat cryptic, but if no errors are reported and the final `i=X, filepos=Y' reading has X and Y equal, then it is definitely consistent, and very likely works correctly subject to a consistent offset error. If this test succeeds, then a good next step is to try loading a kernel.
unhideunhide PARTITION
Unhide PARTITION by clearing the "hidden" bit in its partition type code.
uppermemuppermem KBYTES
Force GRUB to assume that only KBYTES kilobytes of upper memory are installed. Any system address range maps are discarded.

No comments:

Post a Comment