Installing or Updating MCC Interim Linux **************************************** This chapter assumes that you have already obtained all the necessary files and packages, and prepared or obtained suitable MCC boot and root disks. See README.ftp, where the preparation of boot and root disks is described. Overview of an MCC installation or upgrade ========================================== In this section I summarise what you should do to install or upgrade Linux using the MCC Interim distribution. Exceptions, qualifications, and alternatives are omitted to keep the picture as simple as possible. - Read this document carefully, so that you know what the process of installing Linux involves. Think about how you will partition your hard disk. See README.prepare. - Back up your hard disk. - Get the boot and root images, packages, and DOS programs by using anonymous ftp in binary mode. See README.ftp. - Format some high density floppies, and copy the packages you select to them, leaving two floppies for the boot and root images. Have a spare formatted floppy which you will use to test your LILO installation before overwriting your master boot record. - Unpack `GZIPxxx.EXE'. - Use the new `GZIP.EXE' to unpack the boot and root images. - Use `RAWRITE' to copy the boot and root images to high density floppies. See README.ftp. - Boot from the MCC boot disk. Give the `ro' command at the LILO prompt to boot in read-only mode. At the prompt, place the MCC root disk in the drive and press . - Use `fdisk' to edit your partition table. See README.fdisk. - Use `mkswap' to set up a swap partition. - Use `mkfs' to create file system partitions. - Install the base1 package from the MCC boot disk. - After installing base1, reboot by answering `y'. Write down the instruction `ro root=xxx' which is printed at this point, then press . - Reboot from the MCC boot disk, answering the LILO prompt with the command `ro root=xxx', according to the instructions you noted during the previous step. Leave the boot disk in the drive while the base2 package is installed. - Change your default keyboard map from uk.map to your national keyboard when you are asked to do so, unless you have a UK keyboard. - Install and configure networking software when you are asked to do so. - Remove the boot disk from the floppy drive, and use LILO to install boot code on a floppy by answering the questions which appear at this time. - Install the packages you select from floppy disks. - Reboot from your new boot floppy. - Log in as root, and use the `lilo' command to install boot code on your hard disk. The following sections explain this process in greater detail and consider some of the alternatives you may wish to choose. Booting from the MCC boot disk ============================== Put the MCC boot disk in the 0 drive (the A: drive for DOS) of the machine on which you want to install Linux. Then reboot by pressing the `RESET' button, or `CTRL-ALT-DEL'. After the system boots, you should see something like this: LILO Press to load the floppy into ram as '/'. This is the first step in doing a normal installation or upgrade. Type 'ro ' to boot with the floppy as root. This is the first step in installing or upgrading a machine with < 4mb of memory. Type 'ro root=xxx ' to mount a hard disk partition as '/'. The value 'xxx' is printed for you during the installation or upgrade. This is the second boot on machines with < 4mb of memory, and on other machines unless you install LILO on your hard disk. Typical values for root: /dev/hda1: 301 /dev/hda2: 302 /dev/hdb1: 341 /dev/hdb3: 343 /dev/sda1: 801 /dev/sdb4: 814 boot: _ To install or update MCC Interim Linux, you will need to boot from this floppy at least once, and possibly twice or three times: 1. You may need to run `fdisk' to edit the partition tables. After doing this, if `fdisk' reports that the kernel has not re-read the partition table successfully, you should reboot. 2. You need to set up and mount the hard disk partitions and install basic files from the boot and root disks. If you do not use the `ramdisk' option, you will need to reboot after installing packages from the root disk. 3. If you use the `ramdisk' option, you must reboot before writing a boot floppy or before installing the MCC packages from floppies in drive 0. One important decision that you must make is this: will you use the `ro' option at your first boot, or will you use `ramdisk'? The `ramdisk' option has some advantages and some disadvantages: - The ramdisk takes up 1.2 Mb of memory. This is impossible on machines with less than 4 Mb of memory, and it slows down the installation noticeably even on machines with as much as 8 Mb of memory. - The `ramdisk' option may save you some fiddling, particulary if you are willing to use LILO to install the boot code directly onto your hard disk. - The `ramdisk' option does not allow you to create a test boot floppy without an additional reboot. - The `ramdisk' option does not allow you to install MCC packages from drive 0 until after you reboot without a ramdisk. Considering these reasons, I prefer to think of the simpler `ro' option as the `normal' way of installing MCC Interim Linux, and of the `ramdisk' option as the exception. The following discussion therefore treats the `ramdisk' procedure only as an alternative. To boot from the boot disk without using a ramdisk, simply type `ro' and press after the above boot message appears. Wait until you receive this prompt: VFS: Insert root floppy and press ENTER Then remove the boot floppy, put the root floppy in its place, and press . You should shortly see the message `Loading /etc/kbmap', which is described below. If you wish to use a ramdisk, boot from the boot disk and press after the LILO boot message. Eventually you will see these messages: RAMDISK: Loading 1200 blocks into RAM disk............................. Now remove the boot disk from the floppy drive, place the root disk in the drive, and press . After this the procedure is the same as for booting with the `ro' option, at least until partway through the installation process. Whether you use the ramdisk or not, at some point you will wish to boot with your installed hard disk partition as root. If you have not installed boot code on your hard disk, and if you have not made a special boot floppy using LILO or some other method, you can still do this using the MCC boot disk. Indeed, if you have not used the `ramdisk' option, you must reboot in this fashion at least once. To do so, boot from the floppy. At the LILO prompt, you need to give a command such as this: ro root=302 where the number `302' varies depending on which root partition you intend to use. If you follow the `normal' MCC installation procedure, this command is printed for you just before the first reboot when you need to use it. Rebooting in this way uses the kernel on the boot disk, but mounts one of the partitions on your hard disk as `/', and it mounts that partition in read-only mode. This is now the normal way to boot, since it allows the system to check and repair the root file system before any programs try to write to it. When the kernel boots, you should see a message like this: Linux version 1.0.4 (root@linux) #1 Wed Mar 30 23:49:33 GMT 1994 Partition check: hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 > The partition check should tell you what device you need to use when you run `fdisk'; for example, `/dev/hda' in the above case. Other possibilities are `/dev/sda', `/dev/hdb', `/dev/sdb', `/dev/xda', and so forth. Whenever the kernel boots, it tries to explore your hardware, and messages will appear describing what it finds. If you have only one IDE disk, you will see this message: hard disk I/O error dev 0340, sector 0 unable to read partition table of device 0340 This can be ignored; it means that the kernel cannot access a second hard disk; of course, this is because it does not exist. You may see similar messages which report that you do not have SCSI devices, or that certain Ethernet hardware cannot be found. You can give the kernel certain information which avoids the need to probe for equipment; for more information, see README.adapt. At some point in your initial boot from the MCC boot disk, you should see the following messages: Loading /etc/kbmap f Run fdisk to manage the partition table. s Set up a new swap partition. a Activate an existing swap partition. m Make a new file system on a partition. i Install basic binaries. c Check (and repair) an existing file system. e Execute /bin/sh on an existing file system. r Run a customise script. q Quit. ? _ The message `Loading /etc/kbmap' means that the kernel is loading the default (UK) keyboard configuration file from the root disk. Then instead of getting a shell prompt `#', you see a small menu. The choices in the menu help you execute several commands. These commands will prepare your machine to hold Linux, and will begin the installation process when you are ready to do so. The commands appear on the menu more or less in the order in which you need to select them. To select a command, type the letter which appears next to it, and then press . This procedure differs from that in most other distributions of Linux. *Note*: It is not possible to get a shell prompt using the MCC boot and root disks until *after* you have installed Linux on your hard disk. The MCC `init' program can then execute the `/bin/sh' on your hard disk. Editing the partition tables ============================ To run `fdisk' from the MCC root floppy, select `f' from the menu. See README.fdisk for more information about the `fdisk' command. First you need to specify the disk whose partition tables you will edit. The menu utility asks: Run fdisk on (block device; default = /dev/hda): _ At this point, press to accept the default. `/dev/hda' is the first hard disk, `/dev/hdb' the second, `/dev/sda' the first SCSI disk, `/dev/sdb' the second, `/dev/xda' the first XT disk, and `/dev/xdb' the second. To select one of these, simply type it after the prompt. If you decide not to, the `block device' prompts always accept `q' as an answer, though sometimes the message `That is not a legitimate device' appears before quitting. At this point the `fdisk' prompt appears: Command (m for help): _ If you type `m', you will see the main menu for `fdisk': Command action a toggle a bootable flag d delete a partition l list known partition types m print this menu n add a new partition p print the partition table q quit without saving changes t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): _ We can give the command `p' to print the partition table. Here is a sample of the output printed on one of the machines I use: Disk /dev/hda: 14 heads, 35 sectors, 978 cylinders Units = cylinders of 490 * 512 bytes Device Boot Begin Start End Blocks Id System /dev/hda1 * 1 1 98 23992+ 4 DOS 16-bit <32M /dev/hda3 * 263 263 426 40180 83 Linux native /dev/hda4 427 427 977 134995 5 Extended /dev/hda5 427 427 491 15924+ 82 Linux swap We can create a primary partition in slot 2, or another logical partition after the swap space: Command (m for help): *n* Command action l logical (5 or over) p primary partition (1-4) *p* Partition number (1-4): *2* First cylinder (99-978): *99* Last cylinder or +size or +sizeM or +sizeK (99-262): *262* Command (m for help): _ The partition type (by default 83 for Linux native file systems) is actually ignored in practice (unless you are using DR-DOS), but I like to see things clearly when I look at partition tables; I want sensible information to appear. If I have a Linux/MINIX file system, I can change the partition type as follows: Command (m for help): *t* Partition number (1-8): *3* Hex code (type L to list codes): *81* Changed system type of partition 2 to 81 (Linux/MINIX) Next we make the new partition active. In most cases this has no practical effect, at least if you install LILO in your master boot record. If you use the DOS master boot record, you must have exactly one active partition, while other programs (such as the OS/2 boot manager) have their own rules. See README.fdisk. I like to be able to see which partitions are bootable when the partition table is printed: Command (m for help): *a* Partition number (1-8): *2* Command (m for help): *p* Disk /dev/hda: 14 heads, 35 sectors, 978 cylinders Units = cylinders of 490 * 512 bytes Device Boot Begin Start End Blocks Id System /dev/hda1 * 1 1 98 23992+ 4 DOS 16-bit <32M /dev/hda2 * 99 99 262 40180 83 Linux native /dev/hda3 * 263 263 426 40180 83 Linux native /dev/hda4 427 427 977 134995 5 Extended /dev/hda5 427 427 491 15924+ 82 Linux swap Being satisfied with this, we decide to save it. Command (m for help): *v* 238664 unallocated sectors. Command (m for help): *w* The partition table has been altered! Calling ioctl() to re-read partition table. hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 > Syncing disks. Remember that it is a good idea to use the `verify' command before saving the tables. The `unallocated sectors' message is just a warning; after all, we have no partitions in the area from cylinder 492 to cylinder 977. If everything works properly, you should see a list of available partitions after the line `Calling ioctl()' and before the line `Syncing disks', just as in the above example. But sometimes you will see a message like this one: Re-read table failed with error 16: Device or resource busy. Reboot your system to ensure the partition table is updated. This means that, if you have changed the partition tables, the kernel has not read them. In this case you may run `fdisk' again without rebooting the system, but you *must* reboot before running `mkswap', `mkfs', or installing Linux. To reboot at this stage, give the answer `q' at the menu prompt. If the warning message does not appear, it is perfectly safe to continue the installation without rebooting. Preparing swap and file system partitions ========================================= Once partitions have been created, they need to be initialised before they can be used for swapping or as file system partitions. Previously initialised swap partitions should be activated during installation, so that you don't run out of memory. It is a good idea to check existing file systems so that any inconsistencies that may have arisen are corrected before you copy new files onto them. You can select any one of these functions from the menu which appears after you boot the system in read-only mode. Initialising a swap partition ----------------------------- Before you can use a swap partition, you must initialise it. Once Linux is installed, you can do this with the `mkswap' command. To run `mkswap' from the MCC root floppy, select `s' from the menu. Here is a typical example: WARNING: This will destroy any files on this partition. Do you want to continue (Y or N): *y* Run mkswap on (block device; default = /dev/hda5): Setting up swapspace, size = 16302080 bytes Adding Swap: 15920k swap-space I find warnings of the type `Are you sure?' irritating, but I print one here to remind you that this command overwrites an entire partition. The default swap device is `/dev/hda5' because this is the first logical partition, and it seems sensible not to put a swap partition in one of the slots of the primary partition table, unless you have a very small disk. If you are using a different partition for swap, type its name before pressing ; for example, type `/dev/hda2' in response to the `block device' query. The maximum usable size of a swap partition is 16 Mb, or 16384 blocks of 1024 bytes each. If you try to initialise a partition larger than this for swap, you are warned that some of this space will be wasted, and you can choose to give up before doing so. If you wish, you can use `fdisk' to reduce the size of the partition slightly, and you can add the extra cylinders to another partition. If you need more than 16 Mb of swap space, you may have up to 16 swap partitions and swap files, each up to 16 Mb in size. After the new swap partition is initialised successfully, the boot utility activates it for you. Activating a swap partition --------------------------- If you install Linux on a disk which already contains an initialised swap partition, you should activate it before doing anything else. On small systems, the installation may fail if you do not, and on any system, this may make the installation a little faster. Once Linux is installed, you can activate swap space with the `swapon' command, or put an entry in `/etc/fstab' to activate it automatically at boot time. To run `swapon' from the MCC root floppy, select `a' from the menu. Here is a typical example: Activate swapping on parition (block device; default = /dev/hda5): Setting up swapspace, size = 16302080 bytes Adding Swap: 15920k swap-space Here again, the default swap partition is `/dev/hda5'. Creating a file system ---------------------- Creating a file system under Linux is like running the `FORMAT' utility under DOS. Once Linux is installed, you can do this with the `mkfs' command. To run `mkfs' from the MCC root floppy, select `m' from the menu. Here is a typical example: WARNING: This will destroy any files on this partition. Do you want to continue (Y or N): *y* Run mkfs on (block device; default = /dev/hda1): */dev/hda2* Create an ext2 file system (Y or N): *y* mke2fs 0.5 ALPHA, 15-Mar-94 for EXT2 FS 0.5, 94/03/10 MCC Interim Linux currently supports two kinds of file system: the minix file system and the ext2 file system. The "minix" file system is named after the MINIX operating system. It comes in two slightly different versions: one in which file names cannot be more than 14 characters long, and one in which file names cannot be more than 30 characters long. Partitions with the 14 character limit are actually compatible with MINIX and can be mounted under that system. The 30 character limit is not compatible with MINIX, but Linux treats the two versions as identical in most respects. The minix file system is older and less subject to change, and perhaps slightly more reliable. A minix file system cannot have more than 64 Mb, or 65536 blocks of 1024 bytes, on a single partition. *Note*: As of version 1.0+, MCC Interim Linux will not install properly on a minix file system unless the maximum length of filenames is 30 characters. If you have an older minix file system, back it up and run `mkfs' before installing. In any case, we do not recommend using the 14 character version unless you need to maintain compatibility with the MINIX operating system. The "ext2" file system was developed for Linux and will eventually become the normal Linux file system. An older version of this system, the "ext" file system, is now quite stable, but we do not recommend its use, and MCC Interim Linux does not support it any longer. File names in the ext2 file system may be up to 255 characters long, and a single partition may contain up to 4 terabytes (4 million megabytes). If you tell the MCC installation utility that a file system is not an ext2 file system, it assumes that it is a minix file system with 30 character filenames. Checking and repairing an existing file system ---------------------------------------------- It is a good idea to check file systems once in a while, particularly before you install a new version of Linux on a file system which already exists. Once Linux is installed, you can do this with the `fsck' command. This is the Unix equivalent of the DOS command `CHKDSK'. To run `fsck' from the MCC root floppy, select `c' from the menu. Here is a typical example: Run fsck on (block device; default = /dev/hda1): */dev/hda3* Does this device contain an ext2 file system (Y or N): *y* Check for bad blocks (Y or N): *y* Do you want automatic fixing (Y or N): *y* Running command: badblocks -s /dev/hda3 40180 Peak memory: Memory used: 143360, elapsed time: 9.341/ 0.660/ 2.020 The check for bad blocks is not strictly necessary, but it is a good idea to check older disks once in a while. This check is not available for minix file systems. Just as when you create a file system, the root floppy assumes that a Linux file system is either a minix file system or an ext2 file system. The `fsck' program reads through a file system, which is usually described in some detail and with a considerable amount of redundant information. If the information is inconsistent, `fsck' does one of two things: 1. In "automatic" mode, it tries to fix all problems as well as it can. 2. In "interactive" mode, it asks you before doing anything. If you answer `y' to the query about automatic fixing, `fsck' runs in automatic mode and fixes everything it can. This may be dangerous if the file system is badly corrupted, since the program might delete a file you wish to keep. In my view, this is very unlikely, and I nearly always run `fsck' in automatic mode. If you answer `n' to the query about automatic fixing, `fsck' runs in interactive mode; otherwise, it runs in automatic mode. File systems usually become corrupt when a system is shut down or rebooted improperly; for example, while a file or directory is being created or deleted. Chances are that if a file is being written when you reboot, you will lose all or part of the file irrevocably. Installing basic files from the MCC disks ========================================= The description of a basic installation or upgrade can be simplified if we consider the read-only and ramdisk procedures separately. Installing base packages using the `ro' option ---------------------------------------------- When you have set up the swap and file system partitions, you can select the `install' option from the menu with the `i' command. The following dialogue shows how to specify partitions to be mounted: Which device contains the file system you wish to be mounted on '/'? Give a name in the form '/dev/hda1', or type 'q' to quit. This file system is on (block device; default = /dev/hda1): */dev/hda2* Does this device contain an ext2 file system (Y or N): *n* Is there another partition you wish to mount? If so, give the pathname it will have in the installed system, such as '/usr/src' with a slash at the front and no slash at the end. (Upper case is not allowed.) If not, type 'n': *n* You must always give directories moving away from the root of the tree: in other words, if you intend to mount `/dev/hda8' on `/', `/dev/hda7' on `/usr', and `/dev/hda6' on `/usr/src', then you must give `/' first, then `/usr', and then `/usr/src'. If you specify another directory here, for example, `/usr/src', then you are asked for the block device where it lives, and the type of file system it contains. After you type `n' to the request for another directory, you should see some messages as the Base package gets installed: 654 blocks Installing Base.tgz Base (part 1) contains basic binaries and text files for Linux. .................................................................... 2701 blocks Making holes in lib/ld.so... There are 4096 byte holes out of 17412 bytes in `lib/ld.so'. Making holes in lib/libc.so.4.5.21... There are 349184 byte holes out of 623620 bytes in `lib/libc.so.4.5.21'. Making holes in libm.so.4.5.21... There are 94208 byte holes out of 107524 bytes in `libm.so.4.5.21'. HOSTNAME: "linux" Verifying Base.crc. The `blocks' messages refer to 512-byte blocks, half the size of the file system blocks. The `Making holes' messages come from the `makehole' program, which allows us to save nearly half a megabyte of disk space by converting the shared libraries to `sparse files'. `Verifying' refers to the cyclical redundancy check by the `brik' program. After checking, the crc file is moved to `/tmp', so that you can check later to see whether anything has changed. There is no verification for most man pages, or for files (like `/etc/fstab', for example) which are edited by the installation programs. If a file has a bad checksum, a message appears like this one: BAD sbin/init This warns you that something is wrong. If there is a small error (caused perhaps by a bad spot on your floppy?), you might have only one bad file, but usually there are several. The `df' listing (which includes all mounted disks) tells you how full your file systems are getting. This can be useful if you have insufficient space to install further packages. Usually you will reboot the system at this point during an installation or upgrade. If you choose not to do so, you can start a shell, and you can explore the half-installed system. If you do this, you will see this message: Please type CTRL-D to reboot, not 'reboot' or 'shutdown'. This is because the system is set up in an odd way. The root partition (the booted floppy) is mounted in read-only mode, and the usual `mount' and `umount' programs will not work properly. Similarly, the `reboot', `halt', and `shutdown' utilities are not able to unmount file systems, which consequently are likely to become corrupt during the shutdown. If you type CTRL-D or `exit', you will again see the prompt Reboot the system now (Y or N): _ If you answer `y', you should see a message like this: Unmounted /dev/hda3 Unmounted /dev/hda2 Type 'rw root=302' at the LILO prompt. If you have just installed LILO on your hard disk, then remove any disk from the floppy drive. Otherwise, place the boot floppy in the drive. Then press . If the system doesn't reboot, press the RESET button. The message `rw root=302' is important, since you need to type it after the system has rebooted and printed the LILO prompt. The message printed at that time will jog your memory if you forget this, or if you did not write it down before pressing . The most important part of the message is the number `302', which varies depending on the partition you wish to be mounted as `/', the root of the new file system. Sometimes the reboot at this point fails, especially if you remove the floppy disk from the drive as instructed. I have left the instructions as they are, simply because most people would find it a bit tricky during their first installation to fumble the root disk out of the drive, and the boot disk into the drive. If the reboot fails on its own, simply press the RESET button, or power off and then power on again. After you reboot and type the `rw root=xxx' command at the LILO prompt, leave the boot disk in the floppy drive so that installation can continue. You should see the following messages: 140 blocks Installing base.tgz Base (part 2) contains basic text and binary files. ................................................................. 2665 blocks Verifying base.crc. At this time the kernel and its `psdatabase' are installed, followed by part 2 of the base package. Then you are asked this question: Do you wish to change the default keyboard map (Y or N): _ The default keyboard map is the one on the root disk, which is for the UK keyboard unless you have changed it. If you have access to a Linux system, you can take any keyboard map acceptable to the kbd-0.85 utilities and copy it onto the root disk before installation, replacing the etc/kbmap file which is already there. This will make your national keyboard available during all stages of the installation process. I expect various ftp sites in countries with keyboards quite different from the UK keyboard will be willing to make a local version of the root disk available. If you do not wish to keep the default keyboard map, or if you are uncertain, answer the question with `y', and you will see this message: 1 be-latin1 8 es 15 gr-latin1 22 sf 2 defkeymap 9 es2 16 no 23 sf-latin1 3 dk 10 fi 17 no-latin1 24 sg 4 dk-latin1 11 fi-latin1 18 no-latin1+ 25 sg-latin1 5 dvorak 12 fr 19 pl 26 uk 6 dvuk 13 fr-latin1 20 ru 27 us 7 emacs 14 gr 21 russian Select the default keytable for this machine (0 to quit): 26 Loading etc/kbmap These list the keyboard map files installed in part 2 of the base package. The file corresponding to the number you select is copied to `/etc/kbmap', where it is loaded each time your system boots. Next you are able to install the tcpip package: Do you wish to install networking software (Y or N): y Installing tcpip.tgz Tcpip contains networking programs, daemons, and configuration files. These will not work unless your kernel was compiled with tcpip. ..................................................................... 1470 blocks Compressing formatted man pages Verifying tcpip.crc. The networking software should work even if you do not have Ethernet hardware, as long as networking is configured into your kernel. In any case you must configure the networking software before it can run. You may do this at any time by giving the `install.net' command, but the installation procedure will configure it now if you wish. You may configure networking even if you have no Ethernet card by selecting the default IP address 127.0.0.1. If you have a supported Ethernet card, you need to know your real IP address, and you should know the address of your gateway machine and of a domain name server before you configure it. If there is no gateway or name server machine, you may use 127.0.0.1 for it. Configure networking now (Y or N): _ If you answer `y', then the software is configured exactly as described in README.adapt. If you answer `n', the following message appears: The 'install.net' command will configure networking for you. The installation continues by giving you the opportunity to install LILO boot code either on a floppy or on your hard disk. If you do not wish to do this, you may create a conventional boot floppy instead. If you do not create a boot floppy or install LILO boot code on your hard disk, you will not be able to boot your newly installed system, unless, of course, you use some boot loader which is not included in the MCC Interim distribution. You may, of course, continue to use the MCC boot disk with the command `rw root=xxx' at the LILO prompt. At this point in the installation you may install other MCC packages if you wish. Installing base packages using the `ramdisk' option --------------------------------------------------- If you have used the `ramdisk' option at boot time, you must take the same initial steps that you take when you use the `ro' option: set up partitions, make swap space, make file systems, and select the menu option to install with the `i' command. This section explains the differences between the subsequent stages of an installation or upgrade using the `ramdisk' option, and the subsequent stages using the `ro' option, as explained above. After part 1 of the base package has been installed, part 2 is installed automatically, without rebooting. You may install and configure the tcpip package as well. If you install the networking software without configuring it at this time, you should not give the command `install.net' until after you have rebooted, and a message warns you of this during the installation process. After you have installed or omitted the tcpip package, you may wish to configure LILO. You should not remove the root disk from drive 0; therefore you cannot store the LILO boot code on a floppy at this time. If you wish to make a floppy to test the LILO installation before writing the boot code to your hard disk, reboot first, log in as root, and give the command `install.lilo'. If you wish to install the LILO boot code on a test floppy, you may do so now. If you are confident that it will work, you may install it directly on your hard disk, without creating a test floppy. At the end of the basic installation, you are allowed to install MCC Interim packages, just as at the end of the installation which follows the `ro' procedure. Because you are not allowed to remove the root floppy from drive 0 at this time, you may not use that drive to install the packages. If you wish to install packages from floppy disks in drive 0, or from a directory which you will mount using NFS, reboot the system, log in as root, perhaps mount a remote file system using NFS, and give the command `/tmp/bootinstall'. You may install packages at this point from a floppy in drive 1, from a directory already mounted during the `install' procedure, or from a directory in an unmounted MS-DOS, minix, or ext2 file system on the same machine. If you do not wish to reboot immediately after installation, you may start a shell on the newly installed partition and browse. You should bear in mind that many commands will not work properly, since the root disk is not mounted as `/', but as `/root'. When you have browsed, leave the shell with the `CTRL-D' or `exit' command, and answer `y' to the question about rebooting. You will see a message Type 'rw root=xxx' at the LILO prompt. in case you have not installed the LILO boot code on your hard disk. As with the `ro' procedure, the reboot may fail at this point. If it does, press the RESET button or, if necessary, switch the power off and on again. Installing the MCC Interim packages =================================== After you have installed the packages on the boot and root disks, you probably wish to install other MCC Interim packages. You can do this in one of three ways: - The MCC installation allows you to install packages immediately after installing the basic packages. Certain restrictions apply at this point if you chose the `ramdisk' option at boot time. - The MCC distribution installs the command `/tmp/bootinstall', which allows you to install many packages from floppies or from a single directory. This is most useful for installations using NFS, or when you wish to test installed LILO boot code before installing packages. - The MCC distribution installs the command `mccinstall', which allows you to install one package at a time. In the present section we discuss the first and second of these ways of installing packages. Whether you give the `/tmp/bootinstall' command explicitly, or have the installation process give it, you should see the following message: Which drive will you use to install Linux packages: 1 drive A: 5.25 inch HD floppies 2 drive A: 3.5 inch HD floppies 3 drive B: 5.25 inch HD floppies 4 drive B: 3.5 inch HD floppies 5 A directory on an unmounted partition on this machine 6 A directory already mounted at this time 7 No installation at this time ? _ (If you are in the middle of a `ramdisk' installation, options 1 and 2 do not appear.) If you are installing from floppies, give one of the answers 1 - 4, whichever is appropriate. If you are installing from a directory, and if that directory is currently mounted, answer `6'. If you copied the packages to a directory on a DOS partition, or on a Linux partition which is not currently mounted, answer `5'. If you answer `5', you must give the name of the unmounted partition which contains the directory which contains the packages. The partition must be a DOS partition or contain a minix or ext2 file system. You are prompted for the name of the partition: What is the block device on which this partition lives? To this you should answer, for example, `/dev/hda1'. If you are going to mount a partition using NFS, then you must have networking software installed, configured, and running before you can mount the remote file system. Normally the networking software is not running during the MCC installation, and you should not start it if you have a ramdisk mounted as `/'. If you did not configure networking software during the basic MCC installation, give the command `install.net' and run `/etc/rc.net' before trying to mount a file system from another machine. Whichever method you use to make packages accessible, you must then answer this question: Do you wish to have a prompt before each package (Y or N): _ I recommend answering `y', which allows you to omit packages which you do not wish to install. On the other hand, when I install Linux on several machines at once, I make certain the disks contain only packages which I wish to install on all machines, and I answer `n' at this point. If you are confident that only desirable packages will be installed, and that you have enough disk space to hold them, answer `y', then drink some tea while the packages are installed. At this juncture you may see all, some, or none of the following dialogue, depending on the options you chose previously: If you wish, you may install other parts of MCC Interim Linux from a directory on another machine, remotely mounted using NFS, or from a currently available directory mounted in some other way. This will only work if you have mounted the remote directory If the directory is not accessible now, do you wish to quit? (Y or N): *n* Do you wish to install from a currently mounted directory? (Y or N): *y* /dev/hda1 is mounted on /mnt. In which directory are the packages found? */mnt/mcc* After you reach this point, packages are installed from the specified directory or floppy drive. The messages which appear are similar to those for the basic packages on the root and boot floppies, and include the following information: Baseman contains formatted man pages for the base package. Bison contains the GNU yacc-compatible parser generator. Elisp contains lisp files for GNU emacs 19.22. Emacs contains GNU emacs 19.22, except for lisp files. Emacsxtr contains the portions of GNU emacs which are not contained in other emacs packages in the MCC Interim distribution. Extrainf contains extra info files for bison, emacs, gas, gcc, texinfo, and gdb. Extralib contains additional libraries for gcc, release 2.5.8. Flex contains the GNU clone of lex, the lexical analyser generator. Gawk contains the GNU version of the awk programming language. Gcca contains executables, include files, and man pages for gcc 2.5.8. Gccb contains libraries and internal binaries for gcc, release 2.5.8. Gdb contains the GNU debugger. Gpp contains the GNU C++ compiler, release 2.5.8, except for those files contained in the gcc packages. Gprof contains the GNU profiler gprof and its associated library files. Groff contains the GNU clone of the nroff/troff text formatter. Info contains GNU info, makeinfo, and selected info files. Kermit contains the Kermit file transfer and serial communications program. Linux contains the kernel source files for Linux version 1.0. Lp contains programs and manpages for printing. Mail contains binaries and support files for smail and for elm. Manpages contains all unformatted manual pages which are distributed (formatted) as part of MCC Interim linux. Patches contains all patches used to compile the binaries included in the current MCC Interim distribution. Progman contains formatted manual pages from sections 2, 3, and 9. Timezone contains data for world timezones and related programs. Words contains a /usr/dict/words file. The kernel in ipide has no SCSI or xd support. The kernel in wd has no SCSI or xd support. It contains support only for Western Digital 80*3 Ethernet cards. If you have asked to be prompted, the message is printed before the prompt, so that you know what you are accepting or rejecting. During a floppy installation you will also see the following message from time to time: You may now remove the floppy disk from the drive. If you wish to install from another disk, then put it in the drive and type 'r' when ready; or type 'q' to stop: _ If your disks are DOS disks, you should have no other messages at mount time except `VFS: Disk change detected on device 2/28', or some such message, depending on your disk drive. But if your disks contain minix or ext2 file systems, you will get some error messages. I allow these to appear, since they might sometimes contain useful information. Creating a boot floppy ====================== After you install the last of the MCC packages, typing `q' if necessary to say that you have no more floppies, the installation procedure allows you to create a boot floppy, using either LILO or your newly installed kernel. You may also install LILO on your hard disk if you wish, though it is safer to make a boot floppy first. Installing LILO on a floppy or hard disk ---------------------------------------- LILO is Werner Almesberger's utility for booting Linux: it stands for LInux LOader. It is quite versatile. You can install it in the Master Boot Record on your hard disk, so that it functions as the primary boot program when your system boots, or you can install it in any partition on your hard disk, or on a floppy disk. LILO can allow you to select from up to 16 possible Linux boot images, or to boot other operating systems. It can pass special options to Linux kernels, such as an instruction to boot in single user mode, or to mount the root partition in read-only mode. It can boot a default option unless you intervene during boot, and it can force you to choose one of its images interactively. It can also protect some or all of your boot options by requiring a password at boot time. The `lilo' command, with its support files, is contained in part 2 of the MCC base package. The support files include `/etc/README.lilo', which describes many of the features of this utility, and `/etc/lilo.conf', the configuration file which you may wish to edit. See README.adapt. The binary support files for LILO are now installed in the `/boot' directory. The MCC installation procedure runs the command `install.lilo', a simple utility for installing LILO boot code, which asks you the following questions: The LILO utility allows you to boot Linux from a hard disk. It can give you the choice of booting one or more versions of Linux, or of booting one or more other operating systems. LILO installs a boot program in any partition (a complex option, since you must set active flags properly), or in the Master Boot Record (a simple option), or on a floppy disk (a safe option, since you can test for problems). Would you like LILO to install a boot program now? *y* Where should the boot code go? You may override this later to put the boot code on a floppy instead of the hard disk. Possible choices include /dev/hda (the master boot record on your first hard disk), /dev/hda2 (the partition you are installing Linux on), or /dev/fd0 (floppy disk 0, DOS floppy A:). Give me the name of a block device, or 'q' to quit. The default is /dev/hda: _ The default at this point is chosen by taking the name of your root partition (for example, `/dev/hda3'), removing the end of its name (leaving `/dev/hd'), and adding `a' (thus producing `/dev/hda' in this case). I recommend accepting this default. At this point, LILO needs to construct a `database' of bootable images and systems. This information is saved in the file `/etc/lilo.conf', which tells the LILO installer what to install, where, and how. Initially this file contains no systems or images; you must add each one which you wish LILO to be able to boot, including the system you have just installed. LILO will boot by default the first system you specify. Others must be selected by taking special action at boot time. Is the first system you wish to add a version of Linux or not? Answer 'L' for Linux, 'o' for other systems, 'q' to quit: (L, o, q): *l* The default Linux image in this installation is /boot/vmlinuz. Press if you are using this image, or if you have a different image somewhere else which is currently mounted, give its pathname: _ What would you like to call this option? The default is 'linux'. Remember, you may not give the same name to two options: _ Is the next system you wish to add a version of Linux or not? Answer 'L' for Linux, 'o' for other systems, 'i' to install: (L, o, i): *o* In what partition does this other system live? Press if you do not wish to add this option. Otherwise give an answer like /dev/hda1: */dev/hda1* What would you like to call this option? The default is 'dos'. Remember, you may not give the same name to two options: _ Is the next system you wish to add a version of Linux or not? Answer 'L' for Linux, 'o' for other systems, 'i' to install: (L, o, i): *i* This little loop repeats, expecting the answer `L' for a Linux image, `o' for another operating system, and `i' when you have no more options to add. You must be careful not to give the same name to two options. The `L' can be typed in lower case, but the prompt uses upper case because `l' looks too much like the digit `1'. The file `/boot/vmlinuz' is installed from the MCC boot floppy. When your list is finished, and if you have not added an option named `linux.old', `newinstall' inserts such an option to boot an old kernel named `/boot/vmlinuz.old' if it exists when LILO is run. The MCC extra kernel packages produce such a file, and the script `/usr/src/linux-mcc/install' produces such a file whenever you compile a new kernel. Now where would you like to install LILO at this time? You may put it on /dev/fd0 to be safe; be sure you have a formatted floppy disk in this drive NOW, and that it is a device you can boot from, not your DOS B: drive. You may install it in /dev/hda. Give me the name of a block device, or 'q' to quit. The default is /dev/fd0: /dev/hda Added linux Added dos Skipping /boot/vmlinuz.old This installation of LILO may fail if you have an odd disk, whose geometry LILO is unable to determine when it is run. In that case, you can log in, edit the file `/etc/disktab' to insert the correct geometry for your disk, then give the command `/etc/lilo/newinstall' to try again. The `lilo' command usually asks you to edit this file if you need to do so. The file itself contains a sample entry, and the file `/etc/README.lilo' contains more information about the `/etc/disktab' file. The boot floppy produced at this point will allow you to test whether the LILO boot code works properly before you attempt to install it on your hard disk. After rebooting from the test floppy, log in as root and give the command `lilo' to place the boot code in its permanent home. Sometimes it is necessary to pass disk or other parameters to the kernel explicitly. These can be included in the file `/etc/lilo.conf' so that you do not need to type them explicitly every time you boot Linux. See README.adapt. If you do install LILO boot code on your hard disk, and for some reason it fails, or you simply wish to remove it, your original Master Boot Record is saved in the file `/boot/boot.xxxx', where `xxxx' is a hexadecimal number based on the drive number. You can restore this with the command `dd if=/etc/lilo/boot.0300 of=/dev/hda', using the appropriate names for your system. You should be very careful: the saved Master Boot Record restores everything to its original state, including the first four partitions described in the primary boot sector; in other words, this command can delete partitions or make them inaccessible if you have changed your partition table since it was first created. If you have MS-DOS version 3.3 or later, you can create a normal DOS Master Boot Record with the DOS command `FDISK /MBR'. Be certain that the DOS partition is marked active (by using `fdisk') before you give this command. Making a conventional boot floppy --------------------------------- If you do not install LILO boot code on your hard disk during the MCC installation, you may wish to make a conventional boot floppy. The `ro' installation procedure asks you this question if you do not choose to install LILO boot code: You can now make a conventional boot floppy which will boot your newly installed Linux system. To do this, you must put a formatted high density diskette into your A drive and answer 'y'. If you wish to do this now, answer 'y'. (Y or N): _ If you answer `y', this simply copies your kernel to the floppy in drive 0 using the command /bin/dd if=/boot/vmlinuz of=/dev/fd0 bs=3072 The resulting disk should boot under any circumstances. Unfortunately, you cannot pass parameters to this kernel, as you can if you use LILO to boot; thus this disk is not useful if you have a difficult hard disk or some other hardware problem. But for most of those people who cannot get LILO to work, or who prefer not to use it, this is a way of booting Linux without messing about with the partition tables. This should not really be necessary, since there are very few known problems with LILO. Of course, you may need to put correct parameters in `/etc/disktab' for a few awkward disks, or to use the `append' feature to pass parameters to the kernel. See README.adapt. Making a special boot floppy using LILO --------------------------------------- It is useful to be able to create a floppy which boots, and which can be used as a recovery floppy or to boot with your hard disk as root. It is hard to fit all the files you may wish onto a floppy, particularly if you must boot from a 5.25 inch floppy. The following instructions should work in the simplest cases. First, create a file, for example `/tmp/lilo.conf' containing the following lines: install = /mnt/boot.b delay = 20 compact vga = normal backup = /dev/null map = /mnt/map boot = /dev/fd0 image = /mnt/vmlinuz root = /dev/fd0 ramdisk = 0 read-write Then place a new floppy in drive 0, and give the following commands: # fdformat /dev/fd0H1440 # for a 3.5 inch floppy # mkfs.minix -c -n14 /dev/fd0 1440 # fdformat /dev/fd0h1200 # for a 5.25 inch floppy # mkfs.minix -c -n14 /dev/fd0 1200 # mount -t minix /dev/fd0 /mnt # mkdir -p /mnt/etc /mnt/lib /mnt/bin /mnt/dev /mnt/mnt # ln -s bin /mnt/sbin # cp -p /boot/boot.b /boot/vmlinuz /mnt # rdev /mnt/vmlinuz /dev/fd0 # rdev -R /mnt/vmlinuz 0 # cp -p /lib/ld.so /lib/libc.so.4.5.21 /mnt/lib # mv /mnt/lib/libc.so.4.5.21 /mnt/lib/libc.so.4 # (cd /bin;tar cf - cat chown cp dd df ln ls mkdir mount mv \ rm rmdir sh sync umount)|(cd /mnt/bin;tar xfp -) # (cd /dev;tar cf - console fd0 fd1 null tty tty? hd* sd* xd*)|\ (cd /mnt/dev;tar xfp -) # (cd /sbin;tar cf - badblocks fdisk fsck.* mkfs.* mkswap swap* \ tune2fs)|(cd /mnt/bin;tar xfp -) # echo "/dev/fd0 / minix rw 0 0" >/mnt/etc/mtab # lilo -C /tmp/lilo.conf Added vmlinuz # df /dev/fd0 Filesystem 1024-blocks Used Available Capacity Mounted on /dev/fd0 1183 1078 105 91% /mnt # umount /mnt This example used a small kernel (`vmlinuz') 252420 bytes in size. If your kernel is much larger (for example, the 363012 bytes of the MCC kernel with CD ROM drivers included), it will be too big for a 5.25 inch floppy with all of the above commands. If you create and boot from this floppy, you must be careful not to leave the file system on it dirty. When you are finished using it, give the command `umount -a' before pressing CTRL-ALT-DEL or the RESET button.