Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
9.6. Команды GRUB
GRUB разрешает запуск команд в интерфейсе командной строки. Некоторые команды используют аргументы. Аргументы должны разделяться пробелом.
Наиболее распространенные команды:
boot
— загружает операционную систему или последний загруженный последовательный загрузчик.chainloader </path/to/file>
— 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.Пример использования командыchainloader
:chainloader +1
displaymem
— отображает статус занятой памяти на основе полученной из BIOS информации. Может пригодиться при определении доступной в системе памяти до начала загрузки.initrd </path/to/initrd>
— Enables users to specify an initial RAM disk to use when booting. Aninitrd
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.Пример использования командыinitrd
:initrd /initrd-2.6.8-1.523.img
install <stage-1> <install-disk> <stage-2>
— Installs GRUB to the system MBR.p
config-file<stage-1>
— Signifies a device, partition, and file where the first boot loader image can be found, such as(hd0,0)/grub/stage1
.<install-disk>
— Specifies the disk where the stage 1 boot loader should be installed, such as(hd0)
.<stage-2>
— Passes the stage 2 boot loader location to the stage 1 boot loader, such as(hd0,0)/grub/stage2
.p
<config-file>
— This option tells theinstall
command to look for the menu configuration file specified by<config-file>
, such as(hd0,0)/grub/grub.conf
.
Предупреждение
Командаinstall
перезаписывает все существующие данные в MBR.kernel </path/to/kernel> <option-1> <option-N>
... — Specifies the kernel file to load when booting the operating system. Replace </path/to/kernel> with an absolute path from the partition specified by the root command. Replace <option-1> with options for the Linux kernel, such asroot=/dev/VolGroup00/LogVol00
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.Пример командыkernel
:kernel /vmlinuz-2.6.8-1.523 ro root=/dev/VolGroup00/LogVol00
Параметр в этом примере определяет, что корневая файловая система Linux расположена в разделеhda5
.root (<device-type><device-number>,<partition>)
— Configures the root partition for GRUB, such as(hd0,0)
, and mounts the partition.Пример командыroot
:root (hd0,0)
rootnoverify (<device-type><device-number>,<partition>)
— Configures the root partition for GRUB, just like theroot
command, but does not mount the partition.
Существуют и другие команды. Выполните
help --all
для их просмотра. Описание команд GRUB может быть найдено по адресу http://www.gnu.org/software/grub/manual/.