Slashdot Mirror


Discover the Anatomy of initrd

IdaAshley writes "The Linux initial RAM disk (initrd) is a temporary root file system that is mounted during system boot to support the two-state boot process. It contains various executables and drivers that permit the real root file system to be mounted, after which the initrd RAM disk is unmounted and its memory freed. In this article explore the initial RAM disk for Linux 2.6, including its creation and use in the Linux kernel. In many embedded Linux systems, the initrd is the final root file system."

6 of 41 comments (clear)

  1. Great tutorial by gigne · · Score: 5, Informative

    This looks to be a pretty good tutorial.

    As well as mkinitrd, there are some cool tools coming along that help build an initrd.
    Here is one I have used, and although it's very early in it's development cycle.
    http://yaird.alioth.debian.org/

    Are there any more that are actually easy to use?

    --
    Signature v3.0, now with 42% less memory usage.
    1. Re:Great tutorial by Crussy · · Score: 3, Informative

      Arch linux is beginning to use Mkinitcpio. It is for the most part easy to install and use.

  2. Re:Initramfs? by fimbulvetr · · Score: 4, Informative

    You're right. Initramfs is better in many ways to initrd, and doesn't have the crazy limitations.

    Initramfs, IIRC, has these advantages:

    It doesn't need block level drivers compiled into the kernel to read itself like initrd does.
    It uses the kernel cache area as its file storage area so you don't have to allocate space with a ramdisk.
    The mem it used to store files with temporarily can be returned to the kernel after the kernel has booted.
    No artificial size limit.

    All in all, it's a much better alternative.

  3. Re:More trouble... by doti · · Score: 2, Informative

    If you want to know better, install a LFS system.
    I did it once, and even used it on my machine at home for many months, before I went back to Slackware.

    It's really instructive, if you want to know how Linux is organized.
    I, for one, feel unconfortable having lots of software running in my system that I don't know what it is, what's their purpose, and if I can turn it off nor not. LFS made me know which is which. Also, it gives great understanding of the boot process.
    I highly recommend it: http://www.linuxfromscratch.org/

    --
    factor 966971: 966971
  4. Re:Initramfs? by DarkDust · · Score: 2, Informative

    It has another advantage: it's compiled into the kernel, so you only need to load one image (good for embedded systems).

    It has a huge disadvantage: it's compiled into the kernel, so you can't easily change it (bad for desktop systems).

  5. Re:More trouble... by squiggleslash · · Score: 2, Informative

    ash is a self contained Bourne shell clone which is easily statically linked. bash is (a) relatively large (most compiled versions wiegh in in the megabytes) and generally not usually that self-contained. So yeah, he probably did mean ash, not bash.

    The initrds I've seen have used other shells such as nash (RedHat/Federoa) and dash (recent Debian kernels), bash really is overkill, especially when you consider you want the initrd to be as small as possible.

    --
    You are not alone. This is not normal. None of this is normal.