• Tidak ada hasil yang ditemukan

PDF The Linux Bootdisk HOWTO

N/A
N/A
Protected

Academic year: 2024

Membagikan "PDF The Linux Bootdisk HOWTO"

Copied!
52
0
0

Teks penuh

If the date on the title page is more than six months ago, please check the. Although this document should be readable in its text form, it looks much better in Postscript, PDF or HTML forms due to the typographic conventions used.

Preface

  • Version notes
  • To do list
  • Feedback and credits
  • Distribution policy

This document may be distributed under the terms set forth in the Linux Documentation Project License. You should know that most of the commands in this HOWTO must be run as root.

Introduction

All PC systems begin the boot process by executing code in the ROM (specifically, the BIOS) to load the sector from sector 0, cylinder 0 of the boot drive. This first sector will continue the boot process by loading the rest of the kernel from the boot device.

Bootdisks and the boot process

The boot process

The boot drive is usually the first floppy drive (labeled A: in DOS and /dev/fd0 in Linux). The kernel must be told where to look for the root file system; if it doesn't find an image to load there, it stops.

Disk types

You can then run fsck on the original root drive while it is not mounted. To build such a root file system, you need a spare device large enough to hold all the files before compression.

Building a root filesystem

  • Overview
  • Creating the filesystem
  • Populating the filesystem
  • Providing for PAM and NSS
    • PAM (Pluggable Authentication Modules)
    • NSS (Name Service Switch)
  • Modules
  • Some final details
  • Wrapping it up

If you have a modular kernel, you should consider which modules you might want to load from the boot disk after boot. If you're having trouble building a kernel, probably don't try to build bootable/rooted systems anyway.

Choosing a kernel

If you build a single boot/root disk, the kernel will be one of the largest files on the disk, so you will need to reduce the size of the kernel as much as possible. The procedure for actually building the kernel is described in the documentation that comes with the kernel. The alternative is to copy the kernel directly to the diskette and start without LILO.

You will need to set up a small separate file system, which we will call the kernel file system, where you transfer the kernel and a few other files that LILO needs. If you are going to use LILO, read on; if you are transferring the kernel directly, continue with Section 6.2. If you create a set of two drives, you might as well overestimate the space, since the first drive is only used for the kernel anyway.

Putting them together: Making the diskette(s)

  • Transferring the kernel with LILO
  • Transferring the kernel without LILO
  • Setting the ramdisk word
  • Transferring the root filesystem

If you are making a two-disk boot and root set, check the root file system to make sure it will fit on one disk. Everything LILO needs is now in the kernel filesystem, so you're ready to go. In this case, dd wrote 353 full records + 1 partial record, so the core occupies the first 354 blocks of the diskette.

Inside the kernel image is the ramdisk word that specifies where to find the root file system, along with other options. If you build a two-disk set, the root filesystem will start at block zero of the second disk, so the offset will be zero. This is an I/O error from the ramdisk driver, usually because the kernel is trying to write beyond the end of the device.

Troubleshooting, or The Agony of Defeat

It's easy to copy at the wrong level so you end up with something like /rootdisk/bin instead of /bin on your root diskette. Check if there is a /lib/libc.so with the same link appearing in the /lib folder on your hard drive. Verify that any symbolic links in your /dev folder on your existing system also exist on the file system of your root diskette, where these links point to devices you included on your root diskette.

Check the /etc/inittab on your bootdisk filesystem for the calls to getty (or some getty-like program, such as agetty, mgetty, or getty_ps). Check the man pages of the program you're using to make sure it makes sense. As with init, run ldd on your getty to see what it needs, and make sure the necessary library files and loaders are included in your root filesystem.

Reducing root filesystem size

  • Increase the diskette density
  • Replace common utilities with BusyBox
  • Use an alternate shell
  • Strip libraries and binaries
  • Move files to a utility disk

If you use LILO, do not use the linear option (or else LILO would assume the drive is the default 18 sectors/market and the drive will fail to boot even if supported by the BIOS). If some of your binaries are not immediately needed to boot or log in, you can move them to a utility disk. If you are building a single boot/root disk, you must put all the blocks for the kernel plus all the blocks for the root filesystem on one disk.

Building a utility disk is relatively easy - just create a file system on a formatted disk and copy the files to it. In the instructions above, we mentioned that the utilities drive can be mounted as /usr. This means that if you have a cassette diskette, you will not be able to access it while your utility disk is mounted.

Miscellaneous topics

Non−ramdisk root filesystems

Such filesystems are actually easier to build than compressed root filesystems because they can be built on a floppy instead of some other device and do not need to be compressed. If you decide to do this, remember that you will have much less space available. When finished, unmount the file system and transfer it to a disk file, but do not compress it.

When calculating the ramdisk word, set bit 14 to zero, to indicate that the root file system should not be loaded to ramdisk. If you build a two-disk set, you can build the complete root file system directly on the second disk and you don't have to transfer it to a hard disk file and then back. Also, if you build a single boot/root disk and use LILO, you can build a single filesystem on the entire disk, containing the kernel, LILO files, and root files, and simply run LILO as the last step.

Building a utility disk

First, they must be able to work with a wide variety of hardware, so they must be able to communicate with the user and load various device drivers. When the kernel first boots, it loads an initial ramdisk image from the boot disk. This initial ramdisk is a root filesystem that contains a program that runs before the real root fs is loaded.

This program usually inspects the environment and/or prompts the user to select various boot options, such as the device from which to boot the real root disk. Instead of using a modular kernel, Slackware offers many different kernels and it's up to the user to choose the one that matches his or her hardware requirements. It uses the SYSLINUX loader to adjust various boot options, then uses an initrd image to guide the user through the installation.

How the pros do it

Simply put, El Torito is a specification that tells how a cdrom should be formatted so that you can directly boot from it. The "El Torito" spec says that any cdrom drive should work (SCSI or EIDE) if the BIOS supports El Torito. So far this has only been tested with EIDE drives because none of the SCSI controllers tested so far seem to support El Torito.

The El Torito standard works by making the CD drive, via BIOS calls, resemble a normal floppy disk drive. The BIOS then takes this image from the CD and for all intents and purposes it behaves as if it were booting from the floppy drive. Roughly speaking, the first 1.44 (or 2.88 if supported) Mbytes of the CD-ROM contains a floppy disk image you supply.

Creating bootable CD−ROMs

  • What is El Torito?
  • How it Works
  • How to make it work
  • Create Win9x Bootable CD−Roms

Place this image somewhere in the hierarchy that will be the source for the iso9660 file system. The patch work done by the author of mkisofs will cause it to automatically create the boot catalog, but you need to specify where the boot catalog will go in the iso9660 file system. Usually it's a good idea to put it in the same location as the boot image, and a name like boot.catalog seems appropriate.

So we have our boot image in the file boot.img and we will place it in the boot/ directory under the root of the iso9660 filesystem. We will have the boot catalog go in the same directory as boot.catalog. If you are using LILO, you can use a kernel option like ramdisk=8192K in the lilo.conf file.

Frequently Asked Question (FAQ) list

For example, the kernel I tried was set to /dev/sda2, but my SCSI root partition is /dev/sda8. You shouldn't have to redownload the kernel or recalculate the ramdisk word if you don't change the starting position of the new root filesystem. You can also use the dd command to copy the backup saved by LILO to the boot sector.

The kernel you receive may not have the root device set to the type and partition of the disk you want. You can still change the root device and ramdisk settings in the kernel, even if all you have is a kernel and another operating system, like DOS. Note also that in order to act on the parameter string, the kernel must contain the driver for that type of disk.

Resources and pointers

  • Pre−made Bootdisks
  • Rescue packages
  • LILO −− the Linux loader
  • Ramdisk usage
  • The Linux boot process

RIP is available from http://www.tux.org/pub/people/kent−robotti/looplinux/rip/index.html. L The first stage bootloader is loaded and started but cannot load the second stage bootloader. LI The first-stage bootloader was able to load the second-stage bootloader, but did not execute it.

LIL The second-stage bootloader has been started, but it cannot load the descriptor table from the map file. This is typically caused by a subtle geometry mismatch or by moving /boot/boot.b without running the card installer. This can either be caused by a geometry mismatch or by moving /boot/map without running the map installer.

LILO boot error codes

Questions about these codes are asked so frequently on Usenet that we include them here as a public service. If LILO fails at some point, the letters printed so far can be used to identify the problem. nothing). If the BIOS indicates an error when LILO tries to load a boot image, the respective error code is displayed.

Sample root filesystem listings

Sample utility disk directory listing

Referensi

Dokumen terkait

When getting this book Understanding APEX 4.2 Application Development By Edward Sciore as reference to check out, you can obtain not only motivation yet additionally

After you installed Linux, here are answers to some questions that Linux newbie users/administrators may have when trying to perform every-day tasks: how to run a program, shut down

For example, when you open a file using the Linux open(2) call, you are returned a file descriptor if the open(2) function is successful.. Similarly, a socket, when it is created,

• By Rust’s Rule 3 (“You can only modify a value when you have exclusive access to it”), if we’re modifying the value, we can’t share it with other threads. If we share it

It's not something that you have to think about in-depth every time you write a piece of code, but it can help us analyze and understand a program – particularly when we're

➟ Linking, which connects an Access table to an Excel worksheet so that you can view and edit the data in both the original program and in the Access file.. Linking is useful when

How to check your grades *If you don’t do the course evaluation, you can’t check the grades.. *You can change your grade ONLY during the grade correction

To check the received document, click the Pending for Release link on the main menu on the left side of the webpage.. NOTE: You can only receive documents that are assigned to be