The way I understand it, initramfs is responsible for loading the "real" root filesystem.

Now, there are two places where we define that root. First we put an entry in /etc/fstab. Second, we put the device on the kernel boot commands e.g. root=/dev/sda1.

Which one does initramfs use to determine where is the root filesystem? If it uses the root kernel parameter, why do we have an entry in /etc/fstab? The second option, (it reads /etc/fstab), is quite illogical because the /etc/fstab file is on the very root device that initramfs is trying to mount in the first place.

Very confusing stuff.

3 Answers 3


As you stated, the purpose of initramfs is to get the "real" root filesystem mounted (it can do other things too, but this is the common task).

Without an initramfs, the kernel will normally mount a partition up as read-only and then pass control over to /sbin/init. An initramfs just takes over this task from the kernel, usually when the root filesystem isn't a normal partition (mdraid, lvm, encrypted, etc).

Now, aside from the background on initramfs, your /etc/fstab resides on your root filesystem. As such, when initramfs is launched, that root filesystem isn't there, and so it can't get to the fstab (chicken and egg problem).
Instead we have to pass a parameter into the kernel boot arguments for the initramfs to use. Normally this is something like root=/dev/sdX. However it might also do something to automatically figure out where your root device is, and so there's no parameter at all. Since it's just software (generally a script), it can really do anything it wants for mounting the root device.

Now, as stated earlier, the kernel will mount the real root as read-only. The initramfs should do exactly this. Once the initramfs is done, the system proceeds booting exactly as if there were no initramfs at all, and /sbin/init starts up. This init then starts all your normal boot scripts, and it's the job of one of these scripts to read /etc/fstab, switch root to read-write, and mount all your other filesystems.

  • So, you are saying that /sbin/init inside the real root filesystem would again remount root using the options in the /etc/fstab? Commented Sep 28, 2013 at 13:32
  • 3
    Yes. Usually via a simple mount -o remount,rw /. It won't change the device that is mounted, but it will change the options on the mount. From man page: After this call mount reads fstab (or mtab) and merges these options with options from command line
    – phemmer
    Commented Sep 28, 2013 at 18:00
  • How do we pass a parameter into the kernel boot arguments if we are using the grub2 command line? My system doesn't show the grub menu for some reason.
    – intuited
    Commented Nov 19, 2017 at 22:37
  • 1
    @intuited You should ask a new question. Comments aren't the place for Q & A.
    – phemmer
    Commented Nov 20, 2017 at 1:31
  • 2
    lsinitramfs /boot/initrd* | fgrep fstab and surprise, initramfs do contains fstab file, at least for me.
    – youfu
    Commented Oct 14, 2019 at 3:08

It may or it may not. As the Initramfs can be constructed in various ways (the kernel just loads it and runs /init which does whatever). However, using a parameter is more common, as it allows more flexibility - i.e. if something changes you can just edit the boot entry and things keep working. With a builtin hardcoded root, this would not necessarily be possible.

The fstab entry may still be required either way as it also determines other things, such as mount options (some of which can be changed on the go) and fsck order. Also even if it was entirely superfluous (and if the Initramfs handles it, it may work without), I'd still keep the entry in there simply for completeness sake.


You can consider /etc/fstab as static mounting, it's only a way of doing such a task, but not the only, in fact, run the command mount, and you see a lot of filesystems that are missing in fstab. Service such a udev and udisk manage much of the "automounting" ignoring the /etc/fstab file...

So, if something is mounted or not often it has nothing to do with /etc/fstab.

initramfs it's only a temporary rootfs used during the boot process until the "true" rootfs is mounted, so why should initramfs be on /etc/fstab ?

You must log in to answer this question.

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