return to first page linux journal archive
keywordscontents

Linux System Administration

Upgrading the Linux Kernel

For those who have hesitated to upgrade to the new stable Linux version 1.2, Mark explains how to easily upgrade from version 1.0 (or any subsequent version) to version 1.2^and even gives you a little help.

by Mark Komarinski

With the release of Linux 1.2.x, there have been a lot of questions on the newsgroups asking what needs to be done to upgrade a stable 1.0.x system to a stable 1.2.x system. Fortunately, this is relatively easy and painless.

One thing you should note is that you should upgrade to the 1.2.1 kernel, especially if you are using firewall software. Version 1.2.0 was somewhat broken in this respect.

The first thing you should realize is that a new program, bdflush, is required by the 1.2.x kernel. The program arrived early in the 1.1.x series and replaces update, implementing a style of disk caching that is a bit more efficient than the older style. Without this program, your disk caching will not work as well, and you will be warned: "Warning - bdflush not running".

The networking tools should also be upgraded. The new versions have been upgraded to support improvements in the kernel networking code. Do note that normal networking programs do not need to be upgraded; only a few special programs, included in a single kit, are affected by the changes.

I have built a package that includes all of these programs. It's called "The Linux Upgrade 1.2", in a file called linuxupgr-1.2.tar.gz. It is available at sunsite.unc.edu and its mirrors in /pub/Linux/system/, and at tsx-11.mit.edu and its mirrors in /pub/linux/binaries/sbin/. Download this package along with the version 1.2.1 kernel, which should be available nearby in the file linux-1.2.1.tar.gz. Sunsite and its mirrors have the kernel in /pub/Linux/kernel/v1.2/, and tsx-11 and its mirrors have the kernel in /pub/linux/sources/system/v1.2/.

Upgrading Your Kernel

  1. Back everything up! Back up your system just in case of any problems along the way. In case anything goes wrong, you can always go back to a stable system. At least back up your data files.
  2. Make notes about your system. The kind of filesystems you have, extra cards, sound card information, and so on.

    From this point on, you should be the root user with few users logged on.

  3. Move the linux kernel tar file to the /usr/src directory. mv linux-1.2.1.tar.gz /usr/src
  4. Back up the old kernel by moving its directory tree to a directory with another name. For example, if the old kernel is a 1.0.9 kernel, you can (in the /usr/src directory) mv linux linux-1.0.9. This way, you still have the source to the old 1.0.9 kernel available.
  5. Uncompress and untar the kernel file by running tar xzvf linux-1.2.1.tar.gz You should see a list of files being sent to the screen. They should all begin with "linux/".
  6. Change to the linux directory and run make config. You will be offered options, for which you will need the information you collected from step 2. In many cases, you can take the defaults, unless you have a specialized system. Issue 7 of Linux Journal had an article, "Linux Performance Tuning for the Faint of Heart", which specifically covers how to compile new kernels.

    One specific item that is not covered in that article is the new IDE driver in Linux 1.2. In the Linux kernel source, there is a file drivers/block/README.ide that you should read if you have a large IDE drive, multiple IDE controllers, or ATAPI IDE CD-ROM drives. Nearly everyone will want to answer "Use new IDE driver for primary/secondary [interface]" with yes. The only reason not to is if you use MFM or RLL drives, since the new IDE driver supports only IDE drives.

  7. Once the configuration is ready, make the dependencies needed by gcc to build the kernel correctly. Run make dep.
  8. At this point, if you're using lilo, you can run make zlilo and the makefile will automatically begin building the kernel and installing the new kernel in LILO. If you boot off a floppy drive, you can just run make zdisk, and put a blank formatted 1.4 (or 1.2) MB disk in the drive and makefile will build the kernel and install it on your floppy.

    NOTE: My preference is to install first to a diskette, and boot from that. If there are no problems, then I go back and run make zlilo. Another option is copying the current Linux kernel to another filename (such as vmlinuz1.0.9) and making a new LILO entry for that file. If you reboot with the first kernel and have problems, you can reboot again, get into LILO, and boot the older kernel. If you feel comfortable using LILO, this may be easier for you.

  9. You will also need to tell the kernel file to mount the root device read-only so that it can run fsck if necessary. If you're using a floppy, run rdev -R /dev/fd0 1. If you're using LILO, run rdev -R /vmlinuz 1. Using the capital R here is important. If you are using LILO, another option is to use the read-only option for the boot image. This is covered in the excellent LILO documentation.
  10. Once the kernel is built, install the Linux Upgrade Package. From /usr/src, run tar xzvf linuxupgr-1.2.tar.gz. This will create a directory called upgrade which has the bdflush and other assorted files in it. Read the README file for instructions on installing the upgrade files.
  11. Reboot the machine. If you did everything correctly, you should have a successfully running 1.2.1 kernel. If you do run into problems and you are using a floppy disk, you can pop the floppy out of the drive and reboot with the old kernel.

Misc. Other Upgrades

There are a few other packages you may want to upgrade at this point. Among them are gcc, libraries, and the X Window System. However, the old versions will work with the newer kernels, and upgrading is not necessary for running Linux 1.2.1.

If you have any comments about this article or suggestions for future articles, please e-mail me at komarimf@craft.camp.clarkson.edu

Mark Komarinski graduated from Clarkson University (in very cold Potsdam, NY) with a degree in computer science and technical communication. He now lives in Troy, NY, spending much of his free time working for the Department of Veterans Affairs where he is a programmer.

  Previous    Next