Skip to main content

rootfs

This filesystem is created when you install the operating system. It's then mounted at '/' (root) during boot.

switching from initramfs to rootfs

During boot, the '/' directory is first mounted with the initramfs filesystem. This is then swapped with the real root filesystem (rootfs). The rootfs was created when you installed the OS.

Commands such as pivot_root do this swap. Docker containers use the same logic. They switch from the host filesystem to the image's rootfs.

/bin - essential system binaries

/etc - configuration files

/lib - shared libraries

/home - user directories (optional, depending on the setup)

/dev - device files

/proc - virtual file system for system information

/sys - another virtual file system for kernel-related information

Kernel vs userspace applications

The kernel itself doesn't use these filesystems. They hold the tools userspace apps need to talk to the kernel.