Recommended Partitioning Scheme for Red Hat linux

  • A swap partition (at least 32MB) — swap partitions are used to support virtual memory. In other words, data is written to a swap partition when there is not enough RAM to store the data your system is processing. The size of your swap partition should be equal to twice your computer's RAM, or 32MB, whichever amount is larger.

    For example, if you have 1GB of RAM or less, your swap partition should be at least equal to the amount of RAM on your system, up to two times the RAM. For more than 1GB of RAM, 2GB of swap is recommended. Creating a large swap space partition will be especially helpful if you plan to upgrade your RAM at a later time.

  • A /boot partition (100MB) — the partition mounted on /boot contains the operating system kernel (which allows your system to boot Red Hat Linux), along with files used during the bootstrap process. Due to the limitations of most PC BIOSes, creating a small partition to hold these files is a good idea. For most users, a 100MB boot partition is sufficient.

  • A root partition (1.7-5.0GB) — this is where "/" (the root directory) will be located. In this setup, all files (except those stored in /boot) are on the root partition. A 1.7GB root partition will permit the equivalent of a personal desktop installation (with very little free space), while a 5.0GB root partition will let you install every package.

Reconfiguring and Recompiling the Linux Kernel

Linux has a modular, customisable kernel with several switchable options (e.g. support for multiple processors and device drivers for various hardware devices). It may happen that some new hardware is added to a Linux machine which requires you to recompile the kernel so that it includes device driver support (and possibly new system calls) for the new hardware. To do this, you will need to rebuild the Linux kernel from scratch as follows:
  • Look in /usr/src/linux for the kernel source code. If it isn't there (or if there is just a message saying that only kernel binaries have been installed), get hold of a copy of the latest kernel source code from http://www.kernel.org and untar it into /usr/src/linux.
  • Change directory to /usr/src/linux.
  • To configure the kernel type either
  • # make config (simple text mode configuration), or
    # make menuconfig (menu-driven text configuration), or
    # make xconfig (graphical configuration for X)

    You will be asked to select which modules (device drivers, multiprocessor support etc.) you wish to include. For each module, you can chose to include it in the kernel code (y), incorporate it as an optional module that will be loaded if needed (m) or to exclude it from the kernel code (n). To find out which optional modules have actually been loaded you can run lsmod when the system reboots.

  • Now type:
  • # make dep (to build source code dependencies)
    # make clean (to delete all stale object files)
    # make bzImage (to build the new kernel)
    # make modules (to build the new optional modules)
    # make modules_install (to install the modules)

    The file /usr/src/linux/arch/i386/boot/bzImage now contains your new kernel image. It remains only to install it.

  • Change directory to /usr/src/linux/arch/i386/boot. In the same directory should be a script called install.sh which will copy your kernel image into /boot/vmlinuz:
  • # install.sh version bzImage /boot/System.map /boot

    where version is the kernel version number (of form 2.2.xx).

    else you can run the command #make install

  • Finally, you may need to update the /etc/lilo.conf file so that lilo (the Linux boot loader) includes an entry for your new kernel. Then run
  • # lilo

    to update the changes. When you reboot your machine, you should be able to select your new kernel image from the lilo boot loader.