Chapter 14. The Hotplug System

Table of Contents

14.1. Devices and Interfaces
14.2. Hotplug Events
14.3. Hotplug Agents
14.4. Automatic Module Loading
14.5. Network Devices and Interface Designations
14.6. Hotplug with PCI
14.7. Coldplug
14.8. Error Analysis


The hotplug system under SUSE LINUX was developed in connection with the Linux Hotplug project, but it has a few distinguishing features. The main difference is that, under SUSE LINUX, the scripts /sbin/hwup and /sbin/hwdown are used instead of the event multiplexer /etc/hotplug.d to initialize or stop hotplug devices.

▪ s390;zseries
Many of the hardware and software characteristics described in this chapter are not the same on IBM S/390 and zSeries machines.▪

The hotplug system is not only used for devices that can be inserted and removed during operation, but also for all devices only detected after the kernel has been booted. These devices are entered in the sysfs file system, which is mounted under /sys. Until the kernel has been booted, only devices that are absolutely necessary, such as bus system, boot disks, or keyboard, are initialized.

The most important hotplug functions are configured in two files. The first of these, /etc/sysconfig/hotplug, contains variables that influence the behavior of hotplug and coldplug. Every variable is explained by a comment. The second file, /proc/sys/kernel/hotplug, contains the name of the executable program called by the kernel.

14.1. Devices and Interfaces

As well as devices, the hotplug system also administers interfaces. A device is either linked to a bus or an interface. An interface links devices to each other or to an application.

Devices entered in the sysfs file are found under /sys/devices. Interfaces are located under /sys/class or /sys/block. All interfaces should have a link to the related device in the sysfs file, but there are always some drivers that do not automatically add this link.

Typical examples of devices and interfaces include the following:

PCI Network Card

A device linked to the PCI bus (/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0) that has a network interface used by network services or linked to a virtual network device, such as a tunnel or VLAN. (/sys/class/net/eth0)

PCI SCSI Controller

A device (/sys/devices/pci0000:20/0000:20:01.1) that makes several physical interfaces available in the form of a bus (/sys/class/scsi_host/host1).

SCSI Hard Disk

A device (/sys/devices/pci0000:20/0000:20:01.1/host1/1:0:0:0) with several interfaces (/sys/block/sda*).