grub2: Images
1
1 11 GRUB image files
1 *******************
1
1 GRUB consists of several images: a variety of bootstrap images for
1 starting GRUB in various ways, a kernel image, and a set of modules
1 which are combined with the kernel image to form a core image. Here is
1 a short overview of them.
1
1 'boot.img'
1 On PC BIOS systems, this image is the first part of GRUB to start.
1 It is written to a master boot record (MBR) or to the boot sector
1 of a partition. Because a PC boot sector is 512 bytes, the size of
1 this image is exactly 512 bytes.
1
1 The sole function of 'boot.img' is to read the first sector of the
1 core image from a local disk and jump to it. Because of the size
1 restriction, 'boot.img' cannot understand any file system
1 structure, so 'grub2-install' hardcodes the location of the first
1 sector of the core image into 'boot.img' when installing GRUB.
1
1 'diskboot.img'
1 This image is used as the first sector of the core image when
1 booting from a hard disk. It reads the rest of the core image into
1 memory and starts the kernel. Since file system handling is not
1 yet available, it encodes the location of the core image using a
1 block list format.
1
1 'cdboot.img'
1 This image is used as the first sector of the core image when
1 booting from a CD-ROM drive. It performs a similar function to
1 'diskboot.img'.
1
1 'pxeboot.img'
1 This image is used as the start of the core image when booting from
1 the network using PXE. ⇒Network.
1
1 'lnxboot.img'
1 This image may be placed at the start of the core image in order to
1 make GRUB look enough like a Linux kernel that it can be booted by
1 LILO using an 'image=' section.
1
1 'kernel.img'
1 This image contains GRUB's basic run-time facilities: frameworks
1 for device and file handling, environment variables, the rescue
1 mode command-line parser, and so on. It is rarely used directly,
1 but is built into all core images.
1
1 'core.img'
1 This is the core image of GRUB. It is built dynamically from the
1 kernel image and an arbitrary list of modules by the
1 'grub2-mkimage' program. Usually, it contains enough modules to
1 access '/boot/grub', and loads everything else (including menu
1 handling, the ability to load target operating systems, and so on)
1 from the file system at run-time. The modular design allows the
1 core image to be kept small, since the areas of disk where it must
1 be installed are often as small as 32KB.
1
1 ⇒BIOS installation, for details on where the core image can
1 be installed on PC systems.
1
1 '*.mod'
1 Everything else in GRUB resides in dynamically loadable modules.
1 These are often loaded automatically, or built into the core image
1 if they are essential, but may also be loaded manually using the
1 'insmod' command (⇒insmod).
1
1 For GRUB Legacy users
1 =====================
1
1 GRUB 2 has a different design from GRUB Legacy, and so correspondences
1 with the images it used cannot be exact. Nevertheless, GRUB Legacy
1 users often ask questions in the terms they are familiar with, and so
1 here is a brief guide to how GRUB 2's images relate to that.
1
1 'stage1'
1 Stage 1 from GRUB Legacy was very similar to 'boot.img' in GRUB 2,
1 and they serve the same function.
1
1 '*_stage1_5'
1 In GRUB Legacy, Stage 1.5's function was to include enough
1 filesystem code to allow the much larger Stage 2 to be read from an
1 ordinary filesystem. In this respect, its function was similar to
1 'core.img' in GRUB 2. However, 'core.img' is much more capable
1 than Stage 1.5 was; since it offers a rescue shell, it is sometimes
1 possible to recover manually in the event that it is unable to load
1 any other modules, for example if partition numbers have changed.
1 'core.img' is built in a more flexible way, allowing GRUB 2 to
1 support reading modules from advanced disk types such as LVM and
1 RAID.
1
1 GRUB Legacy could run with only Stage 1 and Stage 2 in some limited
1 configurations, while GRUB 2 requires 'core.img' and cannot work
1 without it.
1
1 'stage2'
1 GRUB 2 has no single Stage 2 image. Instead, it loads modules from
1 '/boot/grub' at run-time.
1
1 'stage2_eltorito'
1 In GRUB 2, images for booting from CD-ROM drives are now
1 constructed using 'cdboot.img' and 'core.img', making sure that the
1 core image contains the 'iso9660' module. It is usually best to
1 use the 'grub2-mkrescue' program for this.
1
1 'nbgrub'
1 There is as yet no equivalent for 'nbgrub' in GRUB 2; it was used
1 by Etherboot and some other network boot loaders.
1
1 'pxegrub'
1 In GRUB 2, images for PXE network booting are now constructed using
1 'pxeboot.img' and 'core.img', making sure that the core image
1 contains the 'pxe' and 'pxecmd' modules. ⇒Network.
1