Linux RAID Guide
Last Modified 18-Dec-2000
 
  A Brief Guide to getting RAID set up with Linux  
  First of all, download everything you need to build the kernel:

Uncompress these archives, and use my patches to patch the outdated patches (that was a bit of a mouthful, wasn't it?):

  • tar xfI linux-2.2.18.tar.bz2
  • tar xfz linux-2.2.18-ow1.tar.gz
  • bunzip2 VM-global-2.2.18pre25-7.bz2
  • patch VM-global-2.2.18pre25-7 VM-global-2.2.18pre25-7-to-2.2.18-1
  • mv VM-global-2.2.18pre25-7 VM-global-2.2.18-1
  • patch raid-2.2.18-A2 raid-2.2.18-A2-to-A3
  • mv raid-2.2.18-A2 raid-2.2.18-A3
  • patch raid1readbalance-2.2.15-B2 raid1readbalance-2.2.15-B2-to-2.2.18-A0
  • mv raid1readbalance-2.2.15-B2 raid1readbalance-2.2.18-A0
  • mv linux linux-2.2.18-cdhs
  • cd linux-2.2.18-cdhs
  • patch -p1 < ../raid-2.2.18-A3
  • patch -p1 < ../raid1readbalance-2.2.18-A0
  • patch -p1 < ../linux-2.2.18-ow1/linux-2.2.18-ow1.diff
  • patch -p1 < ../VM-global-2.2.18-1

You may also want to make a few other changes to the kernel - I've listed the ones I normally do below in case you find them helpful.

  • Aim: Increase the number of processes that may run simultaneously
    Changes to
    include/linux/tasks.h:
    • increase NR_TASKS from 512 to 3072
    • increase MAX_TASKS_PER_USER from (NR_TASKS/2) to 2048
    • increase MIN_TASKS_LEFT_FOR_ROOT from 4 to 32
    Download: http://www.linuxraid.org/processes.patch

  • Aim: Increase the number of files that may be open simultaneously
    Changes to
    include/linux/fs.h:
    • increase NR_FILE from 4096 to 65536
    • increase NR_RESERVED_FILES from 10 to 128
    Changes to fs/inode.c:
    • increase MAX_INODE from 16384 to 262144
    Note: MAX_INODE must be at least three times larger than NR_FILE.
    Download: http://www.linuxraid.org/filehandles.patch

  • Aim: Decrease the time before disposing of unused TCP keepalive requests
    Changes to
    include/net/tcp.h:
    • decrease TCP_KEEPALIVE_TIME from 2 hours to 5 minutes
    Download: http://www.linuxraid.org/tcp-keepalive.patch

  • Aim: Increase the number of TCP/UDP ports that may be used simultaneously
    Changes to
    net/ipv4/tcp_ipv4.c:
    • increase sysctl_local_port_range from 1024-4999 to 1024-9999
    Download: http://www.linuxraid.org/tcp-port-range.patch

  • Aim: Disable console screen blanking
    Changes to
    drivers/char/console.c:
    • change blank_screen() to do nothing
    Note: If the kernel panics with the console blanked it is meant to unblank it so that you can see what happened pre-panic, and what the panic was. Either it doesn't, or the screen is blanked again, after the panic. This disables console blanking completely.
    Download: http://www.linuxraid.org/console-blanking.patch

You may also want to use my kernel config as a starting point. It's aimed at a high-end server with i686, up to 2GB memory, SMP, IDE or SCSI disks, tapes and CD-ROMs, RAID, IP aliasing/firewalling, TCP syn cookies, serial console, 2048 UNIX PTYs, Enhanced RTC, Quota.

So, to finish off:

  • make menuconfig
  • make dep && make clean && make bzImage
  • mv arch/i386/boot/bzImage /boot/vmlinux-2.2.18-cdhs
  • vi /etc/lilo.conf
  • lilo
  • reboot

See also my heavily commented lilo.conf file.

If you want to just try the kernel out straight off, and the config options sound close enough to you, you can download the compiled monolithic kernel or alternatively the modular kernel with network devices installed as modules.

If you're lazy (like me) you might just want to download everything listed on this page as one big bad-ass patch against the 2.2.18 kernel.

 
Written by Corin Hartland-Swann for Commerce Internet Ltd