14

I would like to know, what is the difference between initrd and initramfs?

2 Answers 2

15

Initrd is deprecated, replaced by Initramfs, which doesn't have some of the weaknesses of initrd:

  • Initrd requires at least one file system driver be compiled into the kernel
  • A disk created by Initrd has got to have a fixed size
  • All of the reads/writes on Initrd are buffered redundantly (unnecessarily) into main memory

I think that's all.


How does this update-initramfs command generate /boot/initrd.img?

It makes the necessary files into a cpio archive, which is a binary archive format (very similar to tar, not extensively used in Linux) and then uses gzip to compress that archive. Gzip is not an archive itself, just a compression (which is why you get .tar.gz archive files).

At boot time, the archive is uncompressed and unpacked onto a   ram-disk.

Also see: How a computer boots

7
  • "Initrd requires at least one file system driver be compiled into the kernel".. I dint get much idea on this. Could you please explain this?? Commented Nov 26, 2010 at 10:16
  • Normally, File system drivers can be bolted onto the operating system at will, for some things they have to be compiled right into the kernel. Which is a pain, since all kernel versions have to be customised, get larger, introduce additional dependencies and so on. (At least that's what I believe to be the case, could well be wrong, I've not got great knowledge about file systems specifically) Commented Nov 26, 2010 at 10:28
  • Is it like initramfs need not be mounted initially?? Commented Nov 26, 2010 at 10:55
  • All file systems have to be mounted before they can be used. If you want to learn about initramfs in depth, have a look at en.wikipedia.org/wiki/Initrd - there's a far more detailed explanation. Commented Nov 26, 2010 at 11:02
  • How does this update-initramfs command generate /boot/initrd.img? Commented Dec 8, 2010 at 4:56
3
  • initrd was block device based, initramfs is file base.

  • with initrd, you created a file system image. with initramfs, you create an archive with the files which the kernel extracts to a tmpfs.

1
  • could you please explain me the steps from the start to the loading and reading of initramfs? Commented Nov 26, 2010 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .