How to eliminate the need for initrd in red hat enterprise linux 4 or Centos 4.
Initrd is normally reserved for modules used to bring up the root filesystem that cannot be linked into the kernel, such as a propriety SCSI or RAID drivers. Once the root filesystem is readable any number of modules can be loaded from disk instead of initrd.
Red Hat Enterprise Linux uses initrd to create temporary device nodes '/dev/console' and '/dev/null' on a ram disk which is used to handle console IO when the kernel hands control to init, at which point udev kicks in and creates its own virtual device nodes.
The trouble is, the console and null devices never exist as real file objects inside the /dev directory, and without them a non-initrd kernel will fail with the dreaded "Warning: no initial console found" message.
Create the 'console' and 'null' devices as real files inside /dev.
title Centos-4 i386 (2.6.9-11.EL) root (hd0,1) kernel /vmlinuz-2.6.9-11.EL ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.9-11.EL.img
mkdir -p /mnt/root mount /dev/hda3 /mnt/root cd /dev cp -a console null tty1 tty2 tty3 /mnt/root/dev
The 'console', 'null', and 'tty' devices are now real files inside the /dev directory and will survive a reboot - unlike the devices created by udev and initrd.
You can also do this by booting the install CD, mounting your root partition, and creating the device files.
If you created three TTY nodes in the above, edit /etc/inittab to match by removing all but one of the tty's. (the init scripts will launch an additional 2 tty's).
# Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 # - remove the other 5
You can now create a lean and mean kernel without ram disk support, initrd, /dev/pts, or /dev. Details:
< > Normal floppy disk support < > Compaq SMART2 support < > Compaq Smart Array 5xxx support < > Mylex DAC960/DAC1100 PCI RAID Controller support < > Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL) <*> Loopback device support < > Cryptoloop Support (NEW) < > Network block device support < > Promise SATA SX8 support < > RAM disk support () Initramfs source file(s) [*] Support for Large Block Devices < > Packet writing on CD/DVD media IO Schedulers ---> (only anticipatory) < > ATA over Ethernet support
[ ] Non-standard serial port support Serial drivers ---> [ ] Legacy (BSD) PTY support IPMI ---> Watchdog Cards ---> < > Intel/AMD/VIA HW Random Number Generator support < > /dev/nvram support < > Enhanced Real Time Clock Support < > Generic /dev/rtc emulation < > Double Talk PC internal speech card support < > Siemens R3964 line discipline < > Applicom intelligent fieldbus card support < > Sony Vaio Programmable I/O Control Device support (EXPERIMENTAL) Ftape, the floppy tape device driver ---> <*> /dev/agpgart (AGP Support) < > ALI chipset support < > ATI chipset support < > AMD Irongate, 761, and 762 chipset support < > AMD Opteron/Athlon64 on-CPU GART support < > Intel 440LX/BX/GX, I8xx and E7x05 chipset support <*> NVIDIA nForce/nForce2 chipset support < > SiS chipset support < > Serverworks LE/HE chipset support < > VIA chipset support < > Transmeta Efficeon support < > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) < > ACP Modem (Mwave) support < > RAW driver (/dev/raw/rawN) (OBSOLETE)
[*] /proc file system support [ ] /proc/kcore support [ ] /dev file system support (OBSOLETE) [ ] /dev/pts Extended Attributes [*] Virtual memory file system support (former shm fs) [ ] tmpfs Extended Attributes [ ] HugeTLB file system support
splashimage=(hd0,1)/grub/splash.xpm.gz timeout 10 default 0 fallback 1 title RHEL-4 (220.127.116.11) kernel (hd0,1)/bzImage-2.6.13 root=/dev/hda3 title Gentoo (18.104.22.168) kernel (hd0,1)/bzImage-2.6.13 root=/dev/hda9
This is a false positive. Chances are you've built a static or mostly-static kernel but the '/sbin/startudev' script assumes a module-ladden kernel and fails to load scsi and ide modules (which you've probably builtin).
kill_udevd # scsi_replay ... -\ # ret=$[$ret + $?] \ comment out these 4 lines if you've builtin SCSI and IDE drivers. # kill_udevd ... / # ide_scan ... -/ /sbin/udevstart