http://www.Linux-Boot.net


Linux-Boot.net

BIOS
CPU Arch

MBR
Boot Stages
Boot Squence
Boot Errors

Booting
Boot-Loaders
SysLinux
Grub
Lilo


RootFS-HOWTO
RootFS-Config
RootFS-HOWTO


InitRD-HOWTO
InitRD
InitRD-Config
InitRD-HOWTO

Creating initrd.gz
RamDisk
Loop

Viewing initrd.gz


Obsolete
initrd/rootfs Scripts

Old Scripts


initrd HOWTO Scripts
rootfs HOWTO Scripts
( Bootable CF, USB, FD, CD )
Standalone Boot
/boot
InitRD
RootFS
Patches


Boot Media
CD-Boot
Floppy-Boot
USB-Boot
Compact-Flash-Boot
Network-Boot
DOS


Chroot


Forgot Root PassWord


CDRW HOWTO



1U Rackmount Chassis

Custom-Chassis.com

Linux-1U.net

1U-ITX.net


ITX-Blades.net


Small PC cases

Mini-Box.net

Wrap-Box.net

Wrap-OS.net


Wan-Sim.net



Linux-Consulting.com

Linux-CAE.net

Linux-Sec.net

Linux-Boot.net

Linux-Backup.net

Linux-Wireless.org

Linux-Office.net

Linux-Video.net

Linux-VOIP.net

Linux-Jobs.net

Linux-Diff.net

1U-Raid5.net

Linux-Howto.net


Spam Reporting



Free Linux CDs

ISO9660.org

Distro-CD.org

Patch-CD.org




Contact



Linux is a registered trademark of
Linus Torvalds

More Linux Legalese


InitRD Config Requirements & Howto Examples

Creating a RootFS

InitRD

  • initrd.gz is NOT required to boot if the kernel has everything it needs

  • if you do use initrd.gz, make sure /initrd exists on the final root disk

  • initrd.gz is required for modules/drivers that are NOT built into the kernel
    • use initrd to preload the nic drivers not in the kernel
    • use initrd to preload the scsi disk drivers not in the kernel
    • use initrd to preload the raid drivers not in the kernel
    • use initrd to preload the cdrom drivers, SVGA drivers, IDE drivers

  • use the initrd as a rescue disk, since it does NOT care about "/" yet

  • initrd.gz are used/referenced from:
  • initrd.gz are created many different ways
    • you have to add your own modules into the initrd tree to support the kernel you're booting

Creating RamDisks and Viewing initrd

man initrd
  • InitRD Bootup Operation
    • /dev/initrd is read-only device

      1. lilo/grub: loads initrd.gz into /dev/initrd
      2. kernel: gzip -d initrd.gz > /dev/ram0 and free /dev/initrd
      3. kernel: mount -o rw /dev/ram0 / ^ initial root filesystem
      4. huh ?? - how does it know
      5. if /linuxrc exists, it is executed uid=0
      • /linuxrc can be any executable including bash
      6. when /linuxrc finishes or is missing, the normal rootFS is mounted
      • /linuxrc should unmount everything before exiting
      • normal rootFS is from /etc/fstab ??
      7. if [ finalrootFS has /initrd ]
      • kernel will mv /dev/ram0 /initrd
      • all processes ( eg /proc ) can remain running
          else
      • attempt to unmount /dev/ram0
      • whacky things can happen ( see NOTES in man page )
        • /proc is not updated
        • /dev/ram0 will be stuck in memory if any process is using /dev/ram0
      8. normal /sbin/init

  • for changing rootFS in /linuxrc
    • mount /proc
    • # for booting into /dev/hda1
    • echo 0x301 > /proc/sys/kernel/real-root-dev

    • # for NFS booting
    • define /proc/sys/kernel/nfs-root-name
    • define /proc/sys/kernel/nfs-root-addrs
    • echo 0xFF > /proc/sys/kernel/real-root-dev


Copyright © 2000
Linux-Consulting
All Rights Reserved.
Updated: Mon Aug 22 15:37:07 2005 PDT