initramfs is a temporary file system used to start up the system, and then passes control to the root FS (File System) after mounting it. The reason I can't just use the ramfs to do stuff is that anything you save doesn't stay, it gets erased any time you reboot.

But a root filesystem that gets mounted CAN be written to and remembers stuff even if you turn off the power. Why is this? How come the rootfs can record changes but initramfs cannot?

More importantly, where IS this root fs supposed to be? I'm looking in the root partition and I see the uinitfs.image, but I don't see any other archive that's supposed to be the root filesystem that I'm going to mount. Where is that stored physically?

1 Answer 1


The initramfs is a compressed image, typically stored in /boot (e.g. on my CentOS 7 machine, I have /boot/initramfs-3.10.0-327.18.2.el7.x86_64.img). This may be a gzip'd cpio archive.


sudo gzip -dc /boot/initramfs-3.10.0-327.4.5.el7.x86_64.img | cpio -t | head

This stores the minimum necessary set of routines to get the OS into a state where it can see the root device. e.g. it may contain the drivers needed to talk to your HBAs.

This is unpacked into RAM at boot time and executed. Because it's a RAM image any changes will be lost.

Once the real root disk has been found it is mounted and root switched to this. Boot then continues as normal. Because this root is a real filesystem (not a memory image) changes saved here are persistent.

  • I think I understand the initramfs. Although I don't understand why I've seen it written that it isn't strictly necessary. Why is it not necessary? What I'm less clear on is how the finding and mounting the real root disk works. I'm looking at an embedded linux platform, where as far as I can tell the main memory is an SD card, but I don't see anything on here that looks like a root filesystem. Where is that kept, if not in the boot partition?
    – Zephyr
    Jun 22, 2016 at 20:05
  • 1
    The initramfs is not necessary when the kernel is capable of locating and mounting the root filesystem itself. So if all the necessary kernel modules (e.g. the driver for the SATA controller, the filesystem module etc.) are compiled into the kernel, and the root filesystem is simple to access (e.g. just a partition on the hard disk), the kernel can do that on its own. As soon as you need a module that is not compiled in, or you need userspace tools and/or configuration to access the root filesystem (e.g. mdadm, mdadm.conf, cryptsetup, crypttab, LVM etc.) you have to use an initramfs. Jun 22, 2016 at 20:21
  • 1
    initramfs usage is dependent on the OS and boot process. So RedHat is different from Ubuntu from SuSe... embedded OS's may not have an initramfs because they work in a more limited environment and may use a different boot loader (eg uBoot). On many embedded OS's the root disk is read-only and may have an "overlay" filesystem where writes are stored and persisted. Where the root disk is configured may also change or be hard code; eg OpenWRT uses a "squashfs" readonly root. Jun 22, 2016 at 20:22
  • So what exactly is the difference between the initrd and a normal root filesystem besides the fact that initrd gets overwritten every time? If I start up a system once, so that initrd gets copied to the main partition, and then disable the part in uboot that copies initrd over, the next time I start up the system is it going to be exactly like a normal filesystem? Because the initrd copy isn't getting overwritten, but it otherwise kind of seems like a normal filesystem, just without most of the programs and directories that are typically standard
    – Zephyr
    Jun 22, 2016 at 20:43
  • 1
    initrd does not get copied to the main partition; it's a RAM image only and disposed of after the real root has been switched to. Jun 22, 2016 at 21:15

You must log in to answer this question.

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