Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

/sys · Kernel & Hardware

Direct answer

/sys (sysfs) exposes the kernel's device model: devices, drivers, buses, block and network devices, and some writable settings such as I/O scheduler or power settings.

When to use this

Use it to read device details or change device settings at runtime.

First 30 seconds

1. Find the device: ls /sys/class/net, /sys/block.

2. Read: cat /sys/block/<dev>/queue/scheduler.

3. Change at runtime: echo <value> > /sys/....

4. Persist with a udev rule.

5. Confirm after reboot.

Operational verification

kernel device model → sysfs attributes → read by tools → writable attributes change behaviour

Evidence · next step

For Kernel & Hardware → /sys, continue with the first unproven Topic check: Resolve /sys/class convenience links to the canonical device path and capture stable bus/vendor/device identifiers. If that boundary is healthy, advance to the adjacent check: Inspect driver binding, modalias, subsystem attributes, power/state/error counters and corresponding kernel logs for the incident. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to read device details or change device settings at runtime.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

firmware/bus device → kernel device object → sysfs canonical path → driver binding + attributes → subsystem interface → userspace consumer → workload

Healthy evidence: canonical device identity is stable, intended driver is bound, attributes/counters remain within expected state and the subsystem/workload functions normally.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Resolve /sys/class convenience links to the canonical device path and capture stable bus/vendor/device identifiers.

  • Inspect driver binding, modalias, subsystem attributes, power/state/error counters and corresponding kernel logs for the incident.
  • Compare sysfs state with the exposed block/net/char interface and workload behavior; check udev or module policy when naming/binding differs.
  • After a controlled runtime change, read back the exact attribute and repeat the original device-dependent workload; verify persistence via the real config owner separately.

Verification chain. firmware/bus device → kernel device object → sysfs canonical path → driver binding + attributes → subsystem interface → userspace consumer → workload

Step 3 Commands Verify boundary
cat /sys/class/net/eth0/speed
ls /sys/block
udevadm info -a /dev/sda | head
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: device path changes unexpectedly, driver link is absent/wrong, error/reset counters grow, power state is stuck, attributes conflict with configuration or subsystem behavior remains failed.

It does not show behavior outside the captured host/VM, boot, incident interval, namespace/cgroup, process, device, kernel/driver or workload scope. sysfs shows kernel-exposed device relationships and attributes for the current runtime; presence or a driver link alone does not show device health, persistence or service success.

Step 5 Common mistakes Narrow the fault
  • Persisting tuning by echo into /sys without udev/systemd.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Changes are lost at reboot — persist with udev rules or tmpfiles. Tools like lsblk, ip and udevadm read sysfs, so prefer them for reading.

Key checks
  • uname -r — running kernel
  • lsmod — loaded modules
  • lspci -k — PCI devices and the driver in use
  • lsusb — USB devices
  • journalctl -k -b -p warning — kernel warnings this boot
ReferenceWhat it is1 section · depth on demand

Core model

Resolve the real sysfs device path instead of relying only on convenience class symlinks, then inspect bus identity, vendor/device attributes, driver link, modalias and subsystem-specific state. Treat writable attributes carefully because many are runtime controls with device-specific semantics and are not persistent configuration.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

sysfs shows kernel-exposed device relationships and attributes for the current runtime; presence or a driver link alone does not show device health, persistence or service success.

/sys owns sysfs device/driver/class representation.

In depth

/sys for hardware information and control

sysfs, mounted at /sys, is the kernel's structured view of devices, drivers and buses. The kernel's sysfs documentation describes the layout:

  • /sys/devices is the device tree.
  • /sys/class groups devices by function, /sys/bus by bus type with its drivers, and /sys/block lists block devices.
  • /sys/module holds module parameters, and /sys/firmware holds firmware tables.
  • /sys/power covers power management.

Attributes are text files, preferably with one value per file. They're read and written like ordinary files, and a write must provide the complete value.

Hardware questions answered by /sys

QuestionPath
Link speed, duplex, carrier of a NIC/sys/class/net/<if>/{speed,duplex,carrier}
Which driver a NIC usesreadlink /sys/class/net/<if>/device/driver
Disk model, size, rotational/sys/block/<dev>/device/model, size, queue/rotational
NVMe firmware version/sys/class/nvme/nvme0/firmware_rev
CPU frequency policy/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Which CPUs are online/sys/devices/system/cpu/online
CPU vulnerabilities and mitigations/sys/devices/system/cpu/vulnerabilities/*
Firmware boot mode/sys/firmware/efi exists only on UEFI
Hardware details (DMI)/sys/class/dmi/id/{sys_vendor,product_name,bios_version}

Control through /sys

ActionWrite
Rescan a disk after resizingecho 1 > /sys/class/block/sdb/device/rescan
Remove a disk before unpluggingecho 1 > /sys/block/sdc/device/delete
Change the CPU governorecho performance > .../cpufreq/scaling_governor
Change the I/O schedulerecho mq-deadline > /sys/block/sda/queue/scheduler

Writes last until reboot. Make them permanent with udev rules, tmpfiles.d w lines, or the relevant service (for example tuned).

host$ cat /sys/class/dmi/id/{sys_vendor,product_name,bios_version}
Dell Inc.
PowerEdge R650
1.14.2
host$ grep -r . /sys/devices/system/cpu/vulnerabilities/ | sed 's#.*/##' | head -4
meltdown:Not affected
spectre_v1:Mitigation: usercopy/swapgs barriers and __user pointer sanitization
spectre_v2:Mitigation: Enhanced / Automatic IBRS; IBPB: conditional; RSB filling
host$ cat /sys/class/net/eth0/{speed,duplex,carrier}
1000
full
1
host$ readlink -f /sys/class/net/eth0/device/driver
/sys/bus/pci/drivers/ixgbe
host$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave

Reading the example

eth0 runs at 1000 Mbit/s full duplex, on an ixgbe driver, which is a 10-gigabit adapter. It has negotiated down. That points to the cable, the transceiver, or the switch port configuration. The powersave governor on a server may also explain latency spikes under load.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

/sys is part of Kernel & Hardware → /sys. /sys (sysfs) exposes Linux kernel device, driver, class, bus, firmware and attribute objects as a hierarchical runtime model and is the primary place to show device identity and driver binding relationships.

Load average is runnable plus uninterruptible work, not CPU percentage. /proc and /sys are exported runtime interfaces whose fields can be architecture/kernel-version specific.

Topic-specific state model. /sys (sysfs) exposes Linux kernel device, driver, class, bus, firmware and attribute objects as a hierarchical runtime model and is the primary place to show device identity and driver binding relationships.

Technical metadata. Host/VM, distribution, boot ID, kernel release, CPU topology, cgroup/namespace, workload/process/thread, CPU user/system/idle/iowait/steal + run queue/load, memory available/reclaim/swap/fault/OOM, block device/LV/MD latency/queue/throughput, PCI/USB/DMI identity, module/driver/parameters, procfs/sysfs path, kernel logs and original workload result.

Interpretation rule. - A sysfs class entry exists ≠ the underlying device is healthy.

  • A driver symlink exists ≠ initialization or dataplane operation succeeded.
  • Writing a sysfs attribute succeeds ≠ the change persists after reboot or device re-enumeration.
  • Two similar device names ≠ the same physical/virtual device; follow canonical sysfs paths and stable identifiers.

Quick reference

sysfs (/sys) exposes devices, drivers and kernel objects:

ls /sys/class/net/; cat /sys/class/net/eth0/{speed,duplex,carrier,mtu}
cat /sys/block/sda/queue/{scheduler,rotational,read_ahead_kb}
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/class/thermal/thermal_zone*/temp
cat /sys/kernel/mm/transparent_hugepage/enabled
find /sys/bus/pci/devices/*/ -maxdepth 0 | wc -l

Persist sysfs changes through udev rules, tuned profiles (tuned-adm profile throughput-performance) or systemd-tmpfiles (w /sys/... - - - - value).

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. sysfs shows kernel-exposed device relationships and attributes for the current runtime; presence or a driver link alone does not show device health, persistence or service success.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Configuration intent and lifecycle. Kernel tuning should start from a measured constraint and use documented sysctl/module parameters or subsystem interfaces with persistent ownership under /etc/sysctl.d, modprobe.d or distribution tooling. Resource limits can also come from cgroups/systemd, containers, ulimit and application settings, so system-wide kernel tunables are not always the correct control point.

Distribution/platform context. /sys owns sysfs device/driver/class representation. Kernel Modules owns module lifecycle; udev may own naming/actions; subsystem Topics own functional network/storage/etc behavior.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Kernel & Hardware → /sys. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/ · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux sysfs/sys linuxsysfs driver bindinglinux device sysfs
Embedded reference data

Quick lookup tables

/sys operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for /sys.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective state/sys (sysfs) exposes Linux kernel device, driver, class, bus, firmware and attribute objects as a hierarchical runtime model and is the primary place to prove device identity and driver binding relationships.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact symptom + interval → identify host/VM, workload and authoritative kernel/device/resource scope → capture correlated runtime telemetry/state → attribute the abnormal signal to process/cgroup/device/driver → find first failed boundary → change one demonstrated cause → read back effective state → repeat original workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainfirmware/bus device → kernel device object → sysfs canonical path → driver binding + attributes → subsystem interface → userspace consumer → workloadTrace requested/configured state through effective state to the observed workload result.
Failure boundarysysfs proves kernel-exposed device relationships and attributes for the current runtime; presence or a driver link alone does not prove device health, persistence or service success.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux resource/kernel evidence can establish this proof path: firmware/bus device → kernel device object → sysfs canonical path → driver binding + attributes → subsystem interface → userspace consumer → workloadUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host/VM, boot, incident interval, namespace/cgroup, process, device, kernel/driver or workload scope. sysfs proves kernel-exposed device relationships and attributes for the current runtime; presence or a driver link alone does not prove device health, persistence or service success.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven resource/kernel boundary: preserve the exact incident scope, capture the adjacent process/cgroup/device/driver or subsystem state, change only the demonstrated cause, then repeat the original workload and regression checks.Continue to the next unresolved boundary while preserving the original test condition.

/sys · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundary/sys
Topic pathKernel & Hardware → /sys
Runtime state/sys (sysfs) exposes Linux kernel device, driver, class, bus, firmware and attribute objects as a hierarchical runtime model and is the primary place to prove device identity and driver binding relationships.
Fast checks- Resolve /sys/class convenience links to the canonical device path and capture stable bus/vendor/device identifiers. - Inspect driver binding, modalias, subsystem attributes, power/state/error counters and corresponding kernel logs for the incident. - Compare sysfs state with the exposed block/net/char interface and workload behavior; check udev or module policy when naming/binding differs. - After a controlled runtime change, read back the exact attribute and repeat the original device-dependent workload; verify persistence via the real config owner separately.
Verification chainfirmware/bus device → kernel device object → sysfs canonical path → driver binding + attributes → subsystem interface → userspace consumer → workload Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundarysysfs proves kernel-exposed device relationships and attributes for the current runtime; presence or a driver link alone does not prove device health, persistence or service success. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?