Linux File System Essentials

Common storage devices include solid-state disks, SD/MMC cards, and USB thumb drives.

Popular file systems are ext4, FAT32, NTFS, JFFS2, and NFS.

The Virtual File System (VFS) acts as an abstraction layer for diverse file systems, offering a consistent application programming interface (API). This lets user-space programs interact with any mounted file system without worrying about their specific implemenattion details. VFS APIs are wrapped into system calls (syscalls), which form the primary interface for user processes to manipulate files and directories across different storage formats.

Device File Systems

devfs (Obsolete)

The /dev directory historically managed all system devices. Prior to the 2.6 Linux kernel, devfs ran entire in kernel space and automatically created device nodes when hardware initialized. Device drivers could set parameters like device numbers, ownership, and permissions, but devfs had critical flaws: limited major/minor device number ranges, inflexible device naming, and no support for custom user-specified node identifiers.

sysfs + udev

/sys hosts the sysfs virtual file system, which exposes kernel-internal device and subsystem information as structured, readable/writable files. Similar to procfs, sysfs provides a dynamic hardware hierarchy and kernel state view to user-space tools. It facilitates explicit representation of kernel objects, their properties, and interrelationships, leveraging the kobject data structure—each registered kobject maps to a unique sysfs directory. Udev, a user-space daemon, complements sysfs by monitoring kernel uevents to dynamically create and manage /dev device nodes.

udev and mdev

Udev is the default device manager for modern Linux (2.6+ kernels), replacing devfs entirely. It runs in user space, listens for uevents emitted by the kernel during hardware detection/removal, and updates /dev with appropriate device nodes. Mdev is a lightweight busybox-based alternative optimized for embedded systems. It auto-creates and removes /dev device nodes during system boot, hotplug events, and driver module loading/unloading.

procfs is mounted at /proc and exposes process metadata, CPU/memory usage, and system configuration. debugfs, mounted at /sys/kernel/debug, offers detailed low-level kernel and driver debugging data accessible only to privileged users.

Tags: Linux File System vfs sysfs udev

Posted on Mon, 13 Jul 2026 16:47:02 +0000 by JKinBlack