Penguin
Diff: EliminateInitrd
EditPageHistoryDiffInfoLikePages

Differences between version 2 and previous revision of EliminateInitrd.

Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History

Newer page: version 2 Last edited on Wednesday, July 20, 2005 4:07:29 pm by KevinCroft Revert
Older page: version 1 Last edited on Wednesday, July 20, 2005 4:03:24 pm by KevinCroft Revert
@@ -1,57 +1,54 @@
-  
 How to eliminate the need for initrd in red hat enterprise linux 4 or Centos 4. 
  
-[[TableOfContents]]  
-  
-! !!! Background 
+!!! Background 
  
 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. 
  
-! !!! The Solution 
+!!! The Solution 
 Create the '''console''' and '''null''' devices as real files inside /dev. 
  
 Boot using the default initrd-based kernel, for me this is: 
-{{{  
+<pre>  
 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 
-}}}  
+</pre>  
  
 Log in as root, re-mount your root file-system to a new area (/mnt/root), and copy the console and null device nodes: 
-{{{  
+<pre>  
 mkdir -p /mnt/root 
 mount /dev/hda3 /mnt/root 
 cd /dev 
 cp -a console null tty1 tty2 tty3 /mnt/root/dev 
-}}}  
+</pre>  
  
 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. 
  
-! !!! etc files 
+!!! etc 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). 
  
-{{{  
+<pre>  
 # Run gettys in standard runlevels 
 1:2345:respawn:/sbin/mingetty tty1 
 # - remove the other 5 
-}}}  
+</pre>  
  
-! !!! Kernel Settings 
+!!! Kernel Settings 
  
 You can now create a lean and mean kernel without ram disk support, initrd, /dev/pts, or /dev. 
 Details: 
  
-! !!! Device Drivers/Block Devices  
-{{{  
+!!! Device Drivers/Block Devices  
+<pre>  
  < > Normal floppy disk support 
  < > Compaq SMART2 support 
  < > Compaq Smart Array 5xxx support 
  < > Mylex DAC960/DAC1100 PCI RAID Controller support 
@@ -65,12 +62,12 @@
  [*] Support for Large Block Devices 
  < > Packet writing on CD/DVD media 
  IO Schedulers ---> (only anticipatory) 
  < > ATA over Ethernet support 
-}}}  
+</pre>  
  
-! !!! Device Drivers/Character Devices  
-{{{  
+!!! Device Drivers/Character Devices  
+<pre>  
  [ ] Non-standard serial port support 
  Serial drivers ---> 
  [ ] Legacy (BSD) PTY support 
  IPMI ---> 
@@ -97,24 +94,24 @@
  < > Transmeta Efficeon support 
  < > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) 
  < > ACP Modem (Mwave) support 
  < > RAW driver (/dev/raw/rawN) (OBSOLETE) 
-}}}  
+</pre>  
  
-! !!! Filesystems/Pseudo Filesystems  
-{{{  
+!!! Filesystems/Pseudo Filesystems  
+<pre>  
  [*] /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 
-}}}  
+</pre>  
  
-! !!! Grub Config 
+!!! Grub Config 
 remember grub's ''(hdx,y)'' syntax is zero based. 
-{{{  
+<pre>  
 splashimage=(hd0,1)/grub/splash.xpm.gz 
 timeout 10 
 default 0 
 fallback 1 
@@ -123,22 +120,22 @@
 kernel (hd0,1)/bzImage-2.6.13 root=/dev/hda3 
  
 title Gentoo (2.6.12.13) 
 kernel (hd0,1)/bzImage-2.6.13 root=/dev/hda9 
-}}}  
+</pre>  
  
-! !!! It's working, but udev fails 
+!!! It's working, but udev fails 
 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). 
  
 Edit the script and comment out some of the statements near the end: 
-{{{  
+<pre>  
 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 
-}}}  
+</pre>  
  
 Now reboot and you should see '''OK''' in green letters.