Advanced SUSE Linux
Enterprise Server
Administration (Course 3038)
Chapter 9
Manage Hardware and Component
Changes
Describe the Differences between
Devices and Interfaces
Device
Real, physical piece of hardware
Can have more than one interface
Interface
Software component associated with a device
Usually created by a driver
Driver
Software module that can be loaded into the Linux
kernel
Glue between a device and its interfaces
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe How Device Drivers Work
Types of device drivers
Kernel modules
User space drivers
Manage kernel modules using commands
lsmod
Lists all loaded kernel modules
modprobe
Loads kernel modules
rmmod
Removes loaded kernel modules
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe How Device Drivers are Loaded
initrd
Special file loaded into memory by the boot loader
Loads other device drivers
initscripts
Dedicated to loading and setting up hardware devices
hotplug
is a program which is used by the kernel to notify user mode software
when some significant (usually hardware-related) events take place.
X Server
Loads special drivers to enable hardware 3D support
manually
Use commands modprobe, hwup, or hwdown
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe the sysfs File System
sysfs
Virtual file system that is mounted under /sys
Represents all devices and interfaces of a Linux
system
Determines which interface belonged to which device
Main directories
/sys/bus and /sys/devices
Contain different representations of system hardware
/sys/class and /sys/block
Represent the interfaces of the devices
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe the sysfs File System
(continued)
Connect an interface with a device
Use file system links
There are also the device files in the /dev directory
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe How the SLES 9 Hotplug
System Works
Hotplug
Loads driver modules and set up interfaces
Every action hotplug performs
Must be triggered by a hotplug event
Hotplug events can be created in the following ways
By the Linux kernel
When a connection to a device is established
By Coldplug
Coldplug is a script that starts at boot time
Scans the system creating events for all devices it finds
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe How the SLES 9 Hotplug
System Works (continued)
Hotplug event
Basically a call of the script /sbin/hotplug
Kernel is configured to call this script
By an entry in /proc/sys/kernel/hotplug
Every hotplug event has an event type
Determined by a single parameter
ieee1394 used by the Firewire subsystem
usb used by the USB subsystem
net used by the networking subsystem
pci - used for PCI devices
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe How the SLES 9 Hotplug
System Works (continued)
Hotplug agents
Device agents
Load kernel modules and call additional commands to
set up a device
Call the hwup script that is used to initialize a device
Interface agents
Register an interface for the device
Located in the directory /etc/hotplug/
It might not be possible to start some devices with
the hwup script
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
Describe How the SLES 9 Hotplug
System Works (continued)
Agents have routines to find and load correct driver
module automatically
By searching module map files in the directories
/etc/hotplug/ and /lib/modules/kernelversion/
/etc/hotplug/blacklist
Contains a list of driver modules that should never be
loaded by hotplug
Switch off both coldplug and hotplug
NOCOLDPLUG=1
NOHOTPLUG=1
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
10
Describe How the SLES 9 Hotplug
System Works (continued)
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
11
Use the hwup Command
Command hwup
Used by hotplug agent to start preconfigured devices
Reads device configurations from files in directory
/etc/sysconfig/hardware/
Filename example: hwcfg-bus-pci-0000:02:08.0
Filename consists of the following four elements:
hwcfg
bus
pci
Address of device in PCI bus
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
12
Use the hwup Command (continued)
Command lspci
Displays the PCI address of a device
Start the network card
hwup bus-pci-0000:02:08.0
Deconfigure network card
hwdown bus-pci-0000:02:08.0
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
13
Use the hwup Command (continued)
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
14
Use the hwup Command (continued)
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
15
Add New Hardware to a SLES 9
System
Objectives
Add a New Drive to the System
Replace a Graphics Card
Add a New Network Adapter
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
16
Add a New Drive to the System
Steps
Shut down the system and install the new drive
Boot the system into runlevel 1
Create a partition and a file system on the new drive
Mount the drive temporarily in the /mnt directory
Copy the existing data from /srv to /mnt
Verify copied data and delete content of /srv directory
Umount the new hard disk
Edit /etc/fstab to mount new hard drive automatically
Reboot the system to the default runlevel
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
17
Replace a Graphics Card
Steps
Shut down the system and replace the graphics card
Boot the system into runlevel 3
Log in as root and start sax2 to configure the new
graphics card
When finished, change to runlevel 5
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
18
Add a Network Adapter
Steps
Open interface configuration file of existing adapter
Add the following line to the configuration file:
PERSISTENT_NAME=external
Shut down system and install new network adapter
Start the system and boot into runlevel 1
Configure the new network adapter with YaST
Open interface configuration file of the new network adapter
and add the following line:
PERSISTENT_NAME=internal
Reboot the system into the default runlevel
Advanced SUSE Linux Enterprise Server Administration (Course 3038)
19