Previous Next Contents

5. Using Yard -- Instructions in Detail

5.1 Customizing Config.pl and Bootdisk_Contents

If you want to use a previous Config.pl from version 1.0 through 1.4 of Yard, you can run:

        convert_config old_Config.pl > Config.pl
You should look through the new Config.pl and check the variable settings.

If this is the first time you've used Yard, do the following:

  1. Edit the two files Config.pl and Bootdisk_Contents in this directory. Both contain numerous comments which should explain in detail the options you're asked to set and the allowable values.

    Config.pl

    This contains basic information about what devices you'll be using and their capacities. Everything in it has be in Perl syntax, but it's all simple variable assignments so you don't need to know Perl.

    Bootdisk_Contents

    This file specifies what your bootdisk will contain. Review this file carefully, especially the selections of /etc and /sbin files. Comments at the head of the file describe the options. I have included everything necessary for a simple boot sequence, but I don't know how much distributions vary in their structure. I've used Yard with both Slackware and RedHat with little modification.

    You will probably discover that the default Bootdisk_Contents contains more files than you can fit on a rescue disk. I did it this way because it's easier to delete unnecessary files from Bootdisk_Contents than to guess what files should be added to a minimal Bootdisk_Contents. Two other file sets are included for illustration.

    1. Bootdisk_Contents.sample is a reasonable set of rescue files that fits on one disk.
    2. Bootdisk_Contents.minimal is a small set of files.

The Yard scripts will catch many but not all errors. For example, if you change /etc/inittab to use getty_ps instead of getty, check_root_fs will make sure getty_ps is included on the disk, but it won't warn you that the calling syntax is different.

Check the files in the Replacements subtree that comes with the Yard distribution. By default, any file mentioned in Bootdisk_Contents will be copied unchanged from your hard disk. Some things have to be changed, however, since a rescue disk is pared-down and can't access the hard disk during boot. You can specify that a different file be used in place of one mentioned, eg:

/etc/inittab <= ./Replacements/etc/inittab

This causes ./Replacements/etc/inittab (which comes with Yard) to be used for /etc/inittab on the rescue disk. These replacement files are very short so there isn't much to check.

When you ran ``make copies'', the script create_fstab.pl created the file ./Replacements/etc/fstab from your fstab. Two modifications are done:

  1. Every device mentioned is given a noauto option so it won't be mounted automatically when the rescue disk is used.
  2. The mount points are placed under /OLDROOT on the rescue root filesystem. You can mount them manually under /OLDROOT to re-create selectively your disk directory structure. This makes repairing them easier and allows you to chroot /OLDROOT to test the structure.

If you have a /etc/lilo.conf, the make copies will also create a file ./Replacements/etc/lilo.conf. If you intend to use Lilo, check this file.

5.2 Making the Root Filesystem

When you're done customizing these two files, su to root and run:

        make_root_fs

This script constructs an initial, uncompressed root filesystem that the rescue floppy will contain. It works in four passes. First it processes the Bootdisk_Contents file and notes special cases (links and replacements). Next it sets up linked file chains mentioned in the first step but not included. It looks for required library files (eg, libc.so) and the loaders required for them. Finally, it notes any hard-linked files. After that, if the files all fit, it constructs the filesystem.

make_root_fs will produce occasional messages showing what it's doing. Any errors should be prominent. Detailed output will go to make_root_fs.log in case you want to see exactly what the script did. If this is the first time you've run make_root_fs for a bootdisk, you should review the log file. In particular, Yard includes information about the libraries needed by your chosen files, which is worth checking.

When you are satisfied with the output, proceed to the next step. You can also chdir to the mount directory and look at the rescue filesystem as it will exist at boot time.

5.3 Checking the Root Filesystem

At this point, run:

        check_root_fs

This checks the root filesystem for errors and omissions. It knows a few things about the format of inittab, fstab and passwd, etc., and checks them for problems. It also checks scripts for missing interpreters, missing files, etc.

Look over the warnings and go back to step 1 if necessary. The warnings are saved on check_root_fs.log for later inspection.

Note that you may get a lot of warnings like:

              Home directory of userX (...) is missing
              Shell of userX (/mnt/bin/bash) doesn't exist

You can ignore these if you don't intend to login as userX.

5.4 Creating the Complete Rescue Disk

When you're satisfied with the output from check_root_fs, unmount any existing floppy in the drive, insert a new diskette, and run:

        write_rescue_disk

This script takes your kernel and the (compressed) root filesystem and produces a rescue disk from it. write_rescue_disk shouldn't produce any errors at this point unless you've exceeded the floppy capacity after compression. The script's output is copied to write_rescue_disk.log.

If you've selected the disk_set=DOUBLE option, the script will write the kernel onto the first disk, then prompt you to change disks, after which it will write the root disk.

If you've selected the disk_set=SINGLE option and your compressed filesystem is too large to be contained on a single floppy with the kernel, the script will offer to create a double-disk set.

5.5 Benediction

You're done. Shut down your system and try to boot from the floppy(ies).

If the boot fails, see the following section on Troubleshooting.

Note that when you boot the rescue disk, it will not automatically mount any of the devices mentioned in your /etc/fstab. This is intentional: rescue disks are often used when your hard disks are inoperational or in an inconsistent state, so they should not automatically be mounted. If you want to mount your other devices, you'll have to do that manually.

The create_fstab script arranges for your existing hard disk entries to be placed under /OLDROOT so you can mount them manually. So from the rescue disk you can type:

        mount /OLDROOT

and your hard disk partition usually mounted as root will be mounted under OLDROOT. For example, if you want to run a bash shell under your old root filesystem, you may simply do:

        mount /OLDROOT
        chdir /OLDROOT ; chroot /OLDROOT bash


Previous Next Contents