Pcornel
Linux · Kernel & Hardware

/sys

Cheat sheet · https://pcornel.dk/topic.php?topic=2842

Back to the Topic

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.

Remember

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

First 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

Verify in this order

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

Where it usually breaks

First mismatch in hardware/kernel capability → scheduler/mm/device → cgroup/namespace → process/thread → service/runtime → workload behavior/counters; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2842

Confirmation

Confirm action

Continue?