Sysfs

Pseudo file system provided by the Linux kernel


title: "Sysfs" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["free-special-purpose-file-systems", "interfaces-of-the-linux-kernel", "linux-kernel-features", "pseudo-file-systems-supported-by-the-linux-kernel"] description: "Pseudo file system provided by the Linux kernel" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Sysfs" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Pseudo file system provided by the Linux kernel ::

sysfs is a pseudo file system provided by the Linux kernel that exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files. In addition to providing information about various devices and kernel subsystems, exported virtual files are also used for their configuration.

sysfs provides functionality similar to the sysctl mechanism found in BSD operating systems, with the difference that sysfs is implemented as a virtual file system instead of being a purpose-built kernel mechanism, and that, in Linux, sysctl configuration parameters are made available at /proc/sys/ as part of procfs, not sysfs which is mounted at /sys/.

History

During the 2.5 development cycle, the Linux driver model was introduced to fix the following shortcomings of version 2.4:

  • No unified method of representing driver-device relationships existed.
  • There was no generic hotplug mechanism.
  • procfs was cluttered with non-process information.

Sysfs was designed to export the information present in the device tree which would then no longer clutter up procfs. It was written by Patrick Mochel. Maneesh Soni later wrote the sysfs backing store patch to reduce memory usage on large systems.

During the next year of 2.5 development the infrastructural capabilities of the driver model and driverfs began to prove useful to other subsystems. kobjects were developed to provide a central object management mechanism and driverfs was renamed to sysfs to represent its subsystem agnosticism.

Sysfs is mounted under the mount point. If it is not mounted automatically during initialization, it can be mounted manually using the [mount](mount-unix) command: mount -t sysfs sysfs /sys.

Supported buses

; ACPI : Exports information about ACPI devices.

; PCI : Exports information about PCI and PCI Express devices.

; PCI Express : Exports information about PCI Express devices.

; USB : Exports information about USB devices.

; SCSI : Exports information about mass storage devices, including USB, SATA and NVMe interfaces.

; S/390 buses : As the S/390 architecture contains devices not found elsewhere, special buses have been created: :* css: Contains subchannels (currently the only driver provided is for I/O subchannels). :* ccw: Contains channel attached devices (driven by CCWs). :* ccwgroup: Artificial devices, created by the user and consisting of ccw devices. Replaces some of the 2.4 chandev functionality. :* iucv: Artificial devices like netiucv devices which use VM's IUCV interface.

Sysfs and userspace

Sysfs is used by several utilities to access information about hardware and its driver (kernel modules) such as udev or HAL. Scripts have been written to access information previously obtained via procfs, and some scripts configure device drivers and devices via their attributes.

References

References

  1. Patrick Mochel and Mike Murphy. "sysfs - The filesystem for exporting kernel objects". [[kernel.org]].
  2. SUSE. "sysctl man page". FreeBSD.
  3. Torvalds, Linus. (18 October 2002). "Linux v2.5.44 - and offline for a week".
  4. Torvalds, Linus. (4 November 2002). "Linux v2.5.46".
  5. Mochel, Patrick. (17 October 2001). "[RFC] New Driver Model for 2.5".
  6. Jansen, Tim. (1 November 2001). "Re: [PATCH] 2.5 PROPOSAL: Replacement for current /proc of shit.".
  7. "SCSI Interfaces Guide — The Linux Kernel documentation".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

free-special-purpose-file-systemsinterfaces-of-the-linux-kernellinux-kernel-featurespseudo-file-systems-supported-by-the-linux-kernel