SYSFS
Platform Ops Glossary /sys
Fundamentals, Kernel & Shell · Term #91

/sys

A virtual filesystem exposing kernel device and driver state, used for low-level tuning.

Category
Fundamentals, Kernel & Shell
Complexity
Intermediate
Glossary Entry
#91 of 190
/procsysctlKernel Modules/procsysctlKernel Modules
What Is It

The Short Answer

/sys (sysfs) is procfs's newer sibling, purpose-built to expose the kernel's device and driver model in an organized, predictable structure — rather than the somewhat ad-hoc layout /proc grew into over the decades. Where /proc is mostly about processes and general kernel stats, /sys is specifically about hardware devices, buses, and the drivers bound to them.

Every device the kernel knows about gets a directory under /sys/devices/, with symlinks organizing the same devices by class (/sys/class/net/ for network interfaces, /sys/block/ for block devices) for easier navigation.

How It Works

Under The Hood

Many files under /sys are writable, not just readable — writing a new value to one directly changes live kernel/driver behavior, which is how tools configure things like disk I/O schedulers or network interface parameters without a dedicated command-line tool for every single setting.

This makes /sys genuinely dangerous compared to /proc: reading kernel state can't hurt anything, but writing the wrong value to the wrong sysfs file can change hardware behavior instantly, with no confirmation prompt.

In Practice

Example Commands

read and tune via sysfs
cat /sys/class/net/eth0/mtu
cat /sys/block/sda/queue/scheduler
# shows the active I/O scheduler in brackets
echo mq-deadline > /sys/block/sda/queue/scheduler
# changes it live — no reboot needed, but also no undo prompt
Watch Out For

Common Mistakes

⚠️Confusing /proc (process/kernel stats, mostly read-only) with /sys (device/driver model, often writable) — they look similar but serve different purposes.
⚠️Writing to a sysfs file without checking whether the change persists across reboot — most sysfs writes are runtime-only and silently reset at the next boot unless captured in a udev rule or sysctl-style config.
VA
Vishal Abhinav
Platform Ops Engineer · Linux & Unix Glossary