I'm reading up on Wake on Lan on Debian wiki https://wiki.debian.org/WakeOnLan and there is a part that says:

If your kernel uses an initramfs image (eg. Debian stock kernels), also run update-initramfs -u (or update-initramfs -u -k all if necessary) to rebuild kernel initial ramdisk(s).

How do I determine if my kernel uses initramfs?

I installed LMDE v2, 64-bit, Mate.

  • 3
    Your computer boots. – mikeserv Jun 22 '15 at 2:50

While terse, mikeserv is essentially correct - Linux has used initramfs for a long time, since the 2.6 days. If you use GRUB (which, assuming you have a default LMDE installation, you do), then checkout /boot/grub/grub.cfg:

$ grep initr /boot/grub/grub.cfg 
    initrd  /boot/initrd.img-3.13.0-53-generic
    initrd  /boot/initrd.img-3.13.0-53-generic
    initrd  /boot/initrd.img-3.13.0-52-generic
    initrd  /boot/initrd.img-3.13.0-52-generic
    initrd  /boot/initrd.img-3.13.0-24-generic
    initrd  /boot/initrd.img-3.13.0-24-generic

Even though the name is initrd, it is an initramfs archive, which you can test by virtue of initramfs being a CPIO archive:

$ file - < /boot/initrd.img-3.13.0-24-generic
/dev/stdin: gzip compressed data, from Unix, last modified: Tue Sep 30 20:07:43 2014
$ gunzip < /boot/initrd.img-3.13.0-24-generic | file -
/dev/stdin: ASCII cpio archive (SVR4 with no CRC)

(The name for the initramfs image is distro-dependent. Arch Linux, for example, simply calls it initramfs-linux.img.)

  • 2
    It's not just typical - initramfs is a filesystem. The image which accompanies most kernels is unpacked into that fs at boot. If there is no external image file, then it is because the required image has been compiled into the kernel itself. In both cases the kernel mounts its first root as an initramfs at boot. This has been the case since the 2.6 kernel series - it is a requirement for every linux kernel since. – mikeserv Jun 22 '15 at 4:15
  • @mikeserv Odd. Everything I've read (wiki.ubuntu.com/Initramfs, wiki.debian.org/initramfs/More, kernel.org/doc/Documentation/filesystems/…) seems to indicate that the primary quality of initramfs is that it is not a filesystem image, unlike initrd. Probably just a technical difference. – muru Jun 22 '15 at 4:17
  • 2
    Well. Yes and no - it's not an image of a filesystem, because initramfs is one whereas the initrd is a filesystem image laid down on a ram disk - a block dev. But initramfs is basically tmpfs - it's fs cache incarnate - so there's no underlying block layer at all, and the initramfs image (or archive may be more correct to say) can just be a simple cpio stream archive. But my point was that external archive/image file or no - initramfs is not optional. – mikeserv Jun 22 '15 at 4:22
  • @mikeserv Done. But in case the initramfs is compiled into the kernel, how do we detect it? – muru Jun 22 '15 at 4:34
  • 1
    Detect it? I guess you wouldn't - unless you stuck a debugger in there and did like init=bin/gdb on the kernel commandline. It's there though - it's the kernel's first root every time. See this for the whole story. – mikeserv Jun 22 '15 at 4:36

Almost all Linux desktop uses initramfs at least with default configuration including LMDE v2 and initramfs feature is kernel inbuilt.

Some OS like Slitaz and many embedded system OS like OpenWRT do not use initramfs image, they skips the initramfs image during boot, by a kernel boot argument noinitrd. you can check it at your bootloader(GRUB) menu or after booting, run

cat /proc/cmdline if you see a noinitrd word then it do not use initramfs image. There is a near 100% chance you will not see noinitrd word.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.