Chapter 22. Additional Information for IBM System z Users
22.1. The sysfs
File System
The Linux 2.6 kernel introduced the
sysfs
file system. The sysfs
file system is described as a union of the proc
, devfs
, and devpty
file systems. The sysfs
file system enumerates the devices and busses attached to the system into a file system hierarchy that can be accessed from user space. It is designed to handle the device and driver specific options that have previously resided in /proc/
, and encompass the dynamic device addition previously offered by devfs
.
The
sysfs
file system is mounted at /sys/
and contains directories that organize the devices attached to the system in several different ways. The /sysfs/
subdirectories include:
- The
/devices/
directoryThis directory contains the/css0/
directory. Its subdirectories represent all the subchannels detected by the Linux kernel. Subchannel directories are named in the form0.0.nnnn
where nnnn is the subchannel number in hex between 0000 and ffff. Subchannel directories in turn contain status files and another subdirectory which represents the actual device. The device directory is named0.0.xxxx
where xxxx is the unit address for the device. The/devices/
directory also contains status information as well as configuration options for the device. - The
/bus/
directoryThis contains a/ccw/
subdirectory and a/ccwgroup/
subdirectory. CCW devices are accessed using channel command words. Devices in the/ccw/
directory only use one subchannel on the mainframe channel subsystem. CCW group devices are also accessed with channel command words, but they use more than one subchannel per device. For example, a 3390-3 DASD device uses one subchannel, while a QDIO network connection for an OSA adapter uses three subchannels. The/ccw/
and the/ccwgroup/
directories both contain directories called devices and drivers:The/devices/
directory contains a symbolic link to the device directories in the/sys/devices/css0/
directory.The/drivers/
directory contains directories for each device driver currently loaded on the system. Drivers associated with devices such asdasd
,console
,qeth
, andzfcp
have directory entries here. The/driver/
directory contains settings for the device driver, as well as symbolic links to the devices it is using (in the/sys/devices/css0/
directory). - The
/class/
directoryThis contains directories that group together similar devices such as ttys, SCSI tape drives, network devices, and other miscellaneous devices. - The
/block/
directoryThis directory contains directories for each of the block devices on the system. These are mostly disk type devices such as real DASD, loopback devices, and software raid block devices. The noticeable difference between older Linux systems and ones that usesysfs
is the need to refer to devices by theirsysfs
name. On a 2.4 kernel image, thezFCP
driver was passed as its device addresses. On the 2.6 Kernel image system the driver is passed as0.0.1600
.