Jason Lindquist (jlindquist) wrote,
Jason Lindquist
jlindquist

initrd vs. initramfs

My work (at work) over the last few months has involved a lot of network booting of systems. PXE and iso/pxelinux for x86, and the abominable union of RARP, tftp, and NFS for Sparc. Matt and I came up with a netbooted Linux test environment for our x86 targets so our production group doesn't have to play musical hard disks or compact flash cards. Right now, it uses an initrd (initial RAM disk) to hold its root filesystem. Since we're using a 2.6 kernel, I kept seeing references to "initramfs" as if it were something different. No obvious explanation stuck its head up at the time. (The documentation provided with the kernel is often spare and out of date.) I found this document today which explains it all quite nicely.

In short: initrd is old, wastes memory, gets cached (which is another waste of memory,) and needs to be located with a kernel command argument. initramfs is new, and is cache, makes much better use of memory, and can either be loaded the same way as an initrd (through the root= kernel argument) or compiled straight into the kernel. initrd is of fixed size, which you must calculate before you create it, and then are limited to while it's running. initramfs will grow and shrink as it needs to.

[3/15/07 Nota Bene:] The kernel treats an initrd like any other disk at startup. It tries to execute /linuxrc, /bin/init, then /sbin/init (or whatever you specify in the init= kernel argument,) which may be symbolic links. You also have to specify root=/dev/ram0 to tell it where to find the image. Under initramfs, you may omit the root= argument, and the kernel only looks for /init, which may not be a symlink. It's either what you want to run, or a hard link to it. (I use a hardlink to /bin/busybox.)
Subscribe

  • Aurora reference

    For reference, the only two links I could find on Aurora shooter (and Westview '06 grad) James Holmes, prior to his attendance at Westview being…

  • Your friend, FunnyJunk.com

    If you've never heard of funnyjunk.com, it's run by a content thief. It's a haven for incompetence, stupidity, and douchebaggery. Site owner…

  • X-header crap

    It is ridiculous how big this section of my .muttrc has gotten. Every goddamned special snowflake mailer has to have its own collection of…

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments