Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

9.6. Commandes GRUB

GRUB permet un certain nombre de commandes utiles dans son interface ligne de commande. Certaines de ces commandes acceptent une option après leur nom. Pour être acceptées, ces options doivent être séparées de la commande et des autres options présentes par un espace.
Ci-après figure une liste de commandes utiles :
  • boot — Démarre le dernier système d'exploitation ou le chargeur de chaîne qui a été chargé.
  • 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.
    Ce qui suit est un exemple de commande chainloader :
    chainloader +1
  • displaymem — Affiche l'utilisation actuelle de mémoire, sur la base des informations fournies par le BIOS. Cette commande est pratique pour déterminer la quantité de mémoire vive dont le système dispose, avant de le démarrer.
  • initrd </path/to/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.
    Ce qui suit est un exemple de commande initrd :
    initrd /initrd-2.6.8-1.523.img
  • install <stage-1> <install-disk> <stage-2> p config-file — Installs GRUB to the system MBR.
    • <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 the install command to look for the menu configuration file specified by <config-file>, such as (hd0,0)/grub/grub.conf.

    Avertissement

    La commande install écrase toutes les informations déjà présentes sur le 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 as root=/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.
    Ce qui suit est un exemple de commande kernel :
    kernel /vmlinuz-2.6.8-1.523 ro root=/dev/VolGroup00/LogVol00
    L'option de l'exemple précédent indique que le système de fichiers root de Linux se trouve sur la partition hda5.
  • root (<device-type><device-number>,<partition>) — Configures the root partition for GRUB, such as (hd0,0), and mounts the partition.
    Ce qui suit est un exemple de commande root :
    root (hd0,0)
  • rootnoverify (<device-type><device-number>,<partition>) — Configures the root partition for GRUB, just like the root command, but does not mount the partition.
D'autres commandes sont également disponibles ; tapez help --all pour obtenir une liste complète de commandes. Pour une description de toutes les commandes GRUB, reportez-vous à la documentation disponible en ligne à l'adresse suivante : http://www.gnu.org/software/grub/manual/.