root filesystem
The top of the directory tree, written as a single slash, under which every other file and directory hangs.
In more detail
An absolute path starts at the root, so /tmp/notes means the tmp directory inside the root. On Linux and macOS there is only one tree; extra disks are mounted into it as directories. Inside a container the root filesystem comes from the image layers plus a writable layer, not from the host.
Examples
docker image inspect alpine:3.20 -f '{{.RootFS.Type}}' # layersEvery path on Linux starts from the root directory, and other filesystems are mounted into the tree beneath it. During boot the initramfs finds and mounts the real root filesystem, named by the root= kernel parameter, before handing over to the first user space process. If the kernel cannot find it, boot stops before any service starts.Related terms
- absolute path — A path that starts from the top of the file system, such as /home/ana/notes.txt or C:\Users\ana\notes.txt, and so works from anywhere.
- mount point — The directory where a filesystem is attached into the single directory tree.
- filesystem — The way an operating system organises files and folders on a disk or in memory.
- layer — One read-only slice of an image that records the files a single build step added, changed or deleted.
- pivot root — A Linux system call that swaps a process to a new root directory so it can no longer see the old one.
- read-only root filesystem — Running a container so that nothing in its root filesystem can be changed, with writable space only where you add it.
- initramfs — A small temporary root filesystem, loaded into memory with the kernel, that holds the drivers and tools needed to find and mount the real root filesystem.
- kernel command line — The list of options the bootloader passes to the kernel at start-up, such as root=/dev/sda2 quiet, which shapes early boot.
Taught in
- Moving Around: pwd, ls, cd And Paths — Bash Scripting & Command Line Automation
- Scheduling, Monitoring And A Script That Reports — Bash Scripting & Command Line Automation
- SecurityContexts And Capabilities — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Configuration And Security: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Union Filesystems, Images And Writable Layers — Docker Architecture & Production Containers
- Install Docker And Verify Your Environment — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- The Filesystem Hierarchy — Linux Fundamentals & Systems Administration
- Booting: GRUB, The Kernel Command Line And initramfs — Linux Fundamentals & Systems Administration
References
- hier(7) manual page
- OCI image configuration (rootfs)
- Docker storage drivers
- Linux kernel documentation: ramfs, rootfs and initramfs