Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1853105
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: LINUX

2006-11-14 11:24:31

转载:
                            GRUB Commands

GRUB allows a number of useful commands in its command line interface. Some of the commands accept options after their name; these options should be separated from the command and other options on that line by space characters.

The following is a list of useful commands:

  • boot — Boots the operating system or chain loader that was last loaded.

  • chainloader — Loads the specified file as a chain loader. If the file is located on the first sector of the specified partition, use the blocklist notation, +1, instead of the file name.

    The following is an example chainloader command:

    chainloader +1
  • displaymem — Displays the current use of memory, based on information from the BIOS. This is useful to determine how much RAM a system has prior to booting it.

  • initrd — Enables users to specify an initial RAM disk to use when booting. An initrd is necessary when the kernel needs certain modules in order to boot properly, such as when the root partition is formatted with the ext3 file system.

    The following is an example initrd command:

    initrd /initrd-2.6.8-1.523.img
  • install p config-file — Installs GRUB to the system MBR.

    • — Signifies a device, partition, and file where the first boot loader image can be found, such as (hd0,0)/grub/stage1.

    • — Specifies the disk where the stage 1 boot loader should be installed, such as (hd0).

    • — Passes the stage 2 boot loader location to the stage 1 boot loader, such as (hd0,0)/grub/stage2.

    • p — This option tells the install command to look for the menu configuration file specified by , such as (hd0,0)/grub/grub.conf.

    Warning Warning
     

    The install command overwrites any information already located on the MBR.

  • kernel ... — Specifies the kernel file to load when booting the operating system. Replace with an absolute path from the partition specified by the root command. Replace with options for the Linux kernel, such as root=/dev/hda5 to specify the device on which the root partition for the system is located. Multiple options can be passed to the kernel in a space separated list.

    The following is an example kernel command:

    kernel /vmlinuz-2.4.21 root=/dev/hda5

    The option in the previous example specifies that the root file system for Linux is located on the hda5 partition.

  • root (,) — Configures the root partition for GRUB, such as (hd0,0), and mounts the partition.

    The following is an example root command:

    root (hd0,0)
  • rootnoverify (,) — Configures the root partition for GRUB, just like the root command, but does not mount the partition.

Other commands are also available; type help --all for a full list of commands. For a description of all GRUB commands, refer to the documentation available online at

阅读(2778) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~