MTD 248-645A Manual de usuario Pagina 245

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 347
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 244
Linux From Scratch - Version 7.0
225
8.4. Using GRUB to Set Up the Boot Process
8.4.1. Introduction
Warning
Configuring GRUB incorrectly can render your system inoperable without an alternate boot device such
as a CD-ROM. This section is not required to boot your LFS system. You may just want to modify your
current boot loader, e.g. Grub-Legacy, GRUB2, or LILO.
Ensure that an emergency boot disk is ready to “rescue” the computer if the computer becomes unusable (un-bootable).
If you do not already have a boot device, you can create one. In order for the procedure below to work, you need
to jump ahead to BLFS and install xorriso.
cd /tmp &&
grub-mkrescue --output=grub-img.iso &&
xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso
8.4.2. GRUB Naming Conventions
GRUB uses its own naming structure for drives and partitions in the form of (hdn,m), where n is the hard drive number
and m is the partition number. The hard drive number starts from zero, but the partition number starts from one for
normal partitions and five for extended partitions. Note that this is different from earlier versions where both numbers
started from zero. For example, partition sda1 is (hd0,1) to GRUB and sdb3 is (hd1,3). In contrast to Linux, GRUB
does not consider CD-ROM drives to be hard drives. For example, if using a CD on hdb and a second hard drive
on hdc, that second hard drive would still be (hd1).
You can determine what GRUB thinks your disk devices are by running:
grub-mkdevicemap --device-map=device.map
cat device.map
8.4.3. Setting Up the Configuration
GRUB works by writing data to the first physical track of the hard disk. This area is not part of any file system. The
programs there access GRUB modules in the boot partition. The default location is /boot/grub/.
The location of the boot partition is a choice of the user that affects the configuration. One recommendation is to
have a separate small (suggested size is 100 MB) partition just for boot information. That way each build, whether
LFS or some commercial distro, can access the same boot files and access can be made from any booted system. If
you choose to do this, you will need to mount the separate partition, move all files in the current /boot directory
(e.g. the linux kernel you just built in the previous section) to the new partition. You will then need to unmount the
partition and remount it as /boot. If you do this, be sure to update /etc/fstab.
Using the current lfs partition will also work, but configuration for multiple systems is more difficult.
Using the above information, determine the appropriate designator for the root partition (or boot partition, if a separate
one is used). For the following example, it is assumed that the root (or separate boot) partition is sda2.
Install the GRUB files into /boot/grub and set up the boot track:
Vista de pagina 244
1 2 ... 240 241 242 243 244 245 246 247 248 249 250 ... 346 347

Comentarios a estos manuales

Sin comentarios