100% found this document useful (1 vote)
1K views982 pages

SUSE Linux Enterprise Server 10 Installation and Administration

Uploaded by

infobits
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views982 pages

SUSE Linux Enterprise Server 10 Installation and Administration

Uploaded by

infobits
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 982

SUSE Linux Enterprise

Server
10 www.novell.com
May 11, 2007 Installation and Administration
Installation and Administration
All content is copyright © Novell, Inc.

Legal Notice

This manual is protected under Novell intellectual property rights. By reproducing, duplicating or
distributing this manual you explicitly agree to conform to the terms and conditions of this license
agreement.

This manual may be freely reproduced, duplicated and distributed either as such or as part of a bundled
package in electronic and/or printed format, provided however that the following conditions are ful-
filled:

That this copyright notice and the names of authors and contributors appear clearly and distinctively
on all reproduced, duplicated and distributed copies. That this manual, specifically for the printed
format, is reproduced and/or distributed for noncommercial use only. The express authorization of
Novell, Inc must be obtained prior to any other use of any manual or part thereof.

For Novell trademarks, see the Novell Trademark and Service Mark list http://www.novell
.com/company/legal/trademarks/tmlist.html. * Linux is a registered trademark of
Linus Torvalds. All other third party trademarks are the property of their respective owners. A trademark
symbol (®, ™ etc.) denotes a Novell trademark; an asterisk (*) denotes a third party trademark.

All information found in this book has been compiled with utmost attention to detail. However, this
does not guarantee complete accuracy. Neither Novell, Inc., SUSE LINUX Products GmbH, the authors,
nor the translators shall be held liable for possible errors or the consequences thereof.
Contents

About This Guide xv

Part I Deployment 1

1 Planning for SUSE Linux Enterprise 3


1.1 Considerations for Deployment of a SUSE Linux Enterprise . . . . . . . . 5
1.2 Deployment of SUSE Linux Enterprise . . . . . . . . . . . . . . . . . 5
1.3 Running SUSE Linux Enterprise . . . . . . . . . . . . . . . . . . . . 6

2 Deployment Strategies 7
2.1 Deploying up to 10 Workstations . . . . . . . . . . . . . . . . . . . 7
2.2 Deploying up to 100 Workstations . . . . . . . . . . . . . . . . . . 9
2.3 Deploying More than 100 Workstations . . . . . . . . . . . . . . . 16

3 Installation with YaST 17


3.1 IBM System z: System Start-Up for Installation . . . . . . . . . . . . . 17
3.2 System Start-Up for Installation . . . . . . . . . . . . . . . . . . . 18
3.3 The Boot Screen . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.5 IBM System z: Hard Disk Configuration . . . . . . . . . . . . . . . . 22
3.6 License Agreement . . . . . . . . . . . . . . . . . . . . . . . . 24
3.7 System Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.8 Time Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.9 Installation Summary . . . . . . . . . . . . . . . . . . . . . . . 26
3.10 Performing the Installation . . . . . . . . . . . . . . . . . . . . . 30
3.11 Configuration of the Installed System . . . . . . . . . . . . . . . . 32
3.12 Graphical Login . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4 Remote Installation 43
4.1 Installation Scenarios for Remote Installation . . . . . . . . . . . . . 43
4.2 Setting Up the Server Holding the Installation Sources . . . . . . . . . 52
4.3 Preparing the Boot of the Target System . . . . . . . . . . . . . . . 62
4.4 Booting the Target System for Installation . . . . . . . . . . . . . . . 72
4.5 Monitoring the Installation Process . . . . . . . . . . . . . . . . . 77

5 Automated Installation 81
5.1 Simple Mass Installation . . . . . . . . . . . . . . . . . . . . . . 81
5.2 Rule-Based Autoinstallation . . . . . . . . . . . . . . . . . . . . . 93
5.3 For More Information . . . . . . . . . . . . . . . . . . . . . . . 98

6 Deploying Customized Preinstallations 99


6.1 Preparing the Master Machine . . . . . . . . . . . . . . . . . . . 100
6.2 Customizing the firstboot Installation . . . . . . . . . . . . . . . . 100
6.3 Cloning the Master Installation . . . . . . . . . . . . . . . . . . . 108
6.4 Personalizing the Installation . . . . . . . . . . . . . . . . . . . . 109

7 Advanced Disk Setup 111


7.1 LVM Configuration . . . . . . . . . . . . . . . . . . . . . . . . 111
7.2 Soft RAID Configuration . . . . . . . . . . . . . . . . . . . . . 119

8 System Configuration with YaST 125


8.1 YaST Language . . . . . . . . . . . . . . . . . . . . . . . . . . 126
8.2 The YaST Control Center . . . . . . . . . . . . . . . . . . . . . 126
8.3 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
8.4 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
8.5 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
8.6 Network Devices . . . . . . . . . . . . . . . . . . . . . . . . . 159
8.7 Network Services . . . . . . . . . . . . . . . . . . . . . . . . 160
8.8 AppArmor . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
8.9 Security and Users . . . . . . . . . . . . . . . . . . . . . . . . 167
8.10 Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . 176
8.11 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . 176
8.12 YaST in Text Mode . . . . . . . . . . . . . . . . . . . . . . . . 179
8.13 Managing YaST from the Command Line . . . . . . . . . . . . . . . 183
8.14 SaX2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.15 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . 192
8.16 For More Information . . . . . . . . . . . . . . . . . . . . . . 192
9 Managing Software with ZENworks 193
9.1 Managing Packages from the Command Line with rug . . . . . . . . . 194
9.2 Managing Packages with the ZEN Tools . . . . . . . . . . . . . . . 197
9.3 For More Information . . . . . . . . . . . . . . . . . . . . . . 202

1 0 Updating SUSE Linux Enterprise 203


10.1 Updating SUSE Linux Enterprise . . . . . . . . . . . . . . . . . . 203
10.2 Installing Service Packs . . . . . . . . . . . . . . . . . . . . . . 205
10.3 Software Changes from Version 9 to Version 10 . . . . . . . . . . . 211

Part II Administration 225

1 1 OpenWBEM 227
11.1 Setting Up OpenWBEM . . . . . . . . . . . . . . . . . . . . . . 229
11.2 Changing the OpenWBEM CIMOM Configuration . . . . . . . . . . . 234
11.3 For More Information . . . . . . . . . . . . . . . . . . . . . . 254

1 2 Mass Storage over IP Networks—iSCSI 257


12.1 Setting Up an iSCSI Target . . . . . . . . . . . . . . . . . . . . . 257
12.2 Configuring iSCSI Initiator . . . . . . . . . . . . . . . . . . . . . 262

1 3 Oracle Cluster File System 2 267


13.1 Overview of OCFS2 . . . . . . . . . . . . . . . . . . . . . . . . 267
13.2 Creating an OCFS2 Volume . . . . . . . . . . . . . . . . . . . . 274
13.3 Mounting an OCFS2 Volume . . . . . . . . . . . . . . . . . . . . 279
13.4 Additional Information . . . . . . . . . . . . . . . . . . . . . . 280

1 4 Access Control Lists in Linux 281


14.1 Traditional File Permissions . . . . . . . . . . . . . . . . . . . . 281
14.2 Advantages of ACLs . . . . . . . . . . . . . . . . . . . . . . . 283
14.3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
14.4 Handling ACLs . . . . . . . . . . . . . . . . . . . . . . . . . . 284
14.5 ACL Support in Applications . . . . . . . . . . . . . . . . . . . . 292
14.6 For More Information . . . . . . . . . . . . . . . . . . . . . . 293

1 5 RPM—the Package Manager 295


15.1 Verifying Package Authenticity . . . . . . . . . . . . . . . . . . . 296
15.2 Managing Packages: Install, Update, and Uninstall . . . . . . . . . . . 296
15.3 RPM and Patches . . . . . . . . . . . . . . . . . . . . . . . . 297
15.4 Delta RPM Packages . . . . . . . . . . . . . . . . . . . . . . . 299
15.5 RPM Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 300
15.6 Installing and Compiling Source Packages . . . . . . . . . . . . . . 303
15.7 Compiling RPM Packages with build . . . . . . . . . . . . . . . . . 305
15.8 Tools for RPM Archives and the RPM Database . . . . . . . . . . . . 306

1 6 System Monitoring Utilities 307


16.1 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
16.2 Files and File Systems . . . . . . . . . . . . . . . . . . . . . . . 310
16.3 Hardware Information . . . . . . . . . . . . . . . . . . . . . . 313
16.4 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
16.5 The /proc File System . . . . . . . . . . . . . . . . . . . . . . 316
16.6 Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
16.7 System Information . . . . . . . . . . . . . . . . . . . . . . . 324
16.8 User Information . . . . . . . . . . . . . . . . . . . . . . . . 328
16.9 Time and Date . . . . . . . . . . . . . . . . . . . . . . . . . . 329

1 7 Working with the Shell 331


17.1 Getting Started with the Bash Shell . . . . . . . . . . . . . . . . . 332
17.2 Users and Access Permissions . . . . . . . . . . . . . . . . . . . 343
17.3 Important Linux Commands . . . . . . . . . . . . . . . . . . . . 347
17.4 The vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . 358

Part III System 363

1 8 32-Bit and 64-Bit Applications in a 64-Bit System Environment 365


18.1 Runtime Support . . . . . . . . . . . . . . . . . . . . . . . . 366
18.2 Software Development . . . . . . . . . . . . . . . . . . . . . . 367
18.3 Software Compilation on Biarch Platforms . . . . . . . . . . . . . . 368
18.4 Kernel Specifications . . . . . . . . . . . . . . . . . . . . . . . 370

1 9 Booting and Configuring a Linux System 371


19.1 The Linux Boot Process . . . . . . . . . . . . . . . . . . . . . . 371
19.2 The init Process . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.3 System Configuration via /etc/sysconfig . . . . . . . . . . . . . . . 384

2 0 The Boot Loader 387


20.1 Selecting a Boot Loader . . . . . . . . . . . . . . . . . . . . . . 388
20.2 Booting with GRUB . . . . . . . . . . . . . . . . . . . . . . . . 388
20.3 Configuring the Boot Loader with YaST . . . . . . . . . . . . . . . 398
20.4 Uninstalling the Linux Boot Loader . . . . . . . . . . . . . . . . . 402
20.5 Creating Boot CDs . . . . . . . . . . . . . . . . . . . . . . . . 402
20.6 The Graphical SUSE Screen . . . . . . . . . . . . . . . . . . . . 404
20.7 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . 405
20.8 For More Information . . . . . . . . . . . . . . . . . . . . . . 406

2 1 Special System Features 407


21.1 Information about Special Software Packages . . . . . . . . . . . . 407
21.2 Virtual Consoles . . . . . . . . . . . . . . . . . . . . . . . . . 414
21.3 Keyboard Mapping . . . . . . . . . . . . . . . . . . . . . . . . 414
21.4 Language and Country-Specific Settings . . . . . . . . . . . . . . . 415

2 2 Virtualization 421
22.1 System and Software Requirements . . . . . . . . . . . . . . . . . 422
22.2 Virtualization Infrastructure . . . . . . . . . . . . . . . . . . . . 425
22.3 Installing Virtualization Software . . . . . . . . . . . . . . . . . . 426
22.4 Starting the Virtualization Host Server . . . . . . . . . . . . . . . . 427
22.5 Managing Virtual Machines . . . . . . . . . . . . . . . . . . . . 428
22.6 Creating Virtual Machines . . . . . . . . . . . . . . . . . . . . 431
22.7 Windows Server 2003 Virtual Machines . . . . . . . . . . . . . . . 432
22.8 For More Information . . . . . . . . . . . . . . . . . . . . . . 433

2 3 Printer Operation 435


23.1 The Workflow of the Printing System . . . . . . . . . . . . . . . . 437
23.2 Methods and Protocols for Connecting Printers . . . . . . . . . . . . 437
23.3 Installing the Software . . . . . . . . . . . . . . . . . . . . . . 438
23.4 Setting Up a Printer . . . . . . . . . . . . . . . . . . . . . . . 439
23.5 Network Printers . . . . . . . . . . . . . . . . . . . . . . . . . 443
23.6 Graphical Printing Interfaces . . . . . . . . . . . . . . . . . . . . 446
23.7 Printing from the Command Line . . . . . . . . . . . . . . . . . . 447
23.8 Special Features in SUSE Linux Enterprise . . . . . . . . . . . . . . 447
23.9 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . 452

2 4 Dynamic Kernel Device Management with udev 461


24.1 The /dev Directory . . . . . . . . . . . . . . . . . . . . . . . 461
24.2 Kernel uevents and udev . . . . . . . . . . . . . . . . . . . . . 462
24.3 Drivers, Kernel Modules, and Devices . . . . . . . . . . . . . . . . 462
24.4 Booting and Initial Device Setup . . . . . . . . . . . . . . . . . . 463
24.5 Debugging udev Events . . . . . . . . . . . . . . . . . . . . . . 463
24.6 Influencing Kernel Device Event Handling with udev Rules . . . . . . . 464
24.7 Persistent Device Naming . . . . . . . . . . . . . . . . . . . . . 465
24.8 The Replaced hotplug Package . . . . . . . . . . . . . . . . . . . 466
24.9 For More Information . . . . . . . . . . . . . . . . . . . . . . 467

2 5 File Systems in Linux 469


25.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
25.2 Major File Systems in Linux . . . . . . . . . . . . . . . . . . . . 470
25.3 Some Other Supported File Systems . . . . . . . . . . . . . . . . 476
25.4 Large File Support in Linux . . . . . . . . . . . . . . . . . . . . 477
25.5 For More Information . . . . . . . . . . . . . . . . . . . . . . 478

2 6 The X Window System 481


26.1 Manually Configuring the X Window System . . . . . . . . . . . . . 481
26.2 Installing and Configuring Fonts . . . . . . . . . . . . . . . . . . 488
26.3 For More Information . . . . . . . . . . . . . . . . . . . . . . 493

2 7 Authentication with PAM 495


27.1 Structure of a PAM Configuration File . . . . . . . . . . . . . . . . 496
27.2 The PAM Configuration of sshd . . . . . . . . . . . . . . . . . . 497
27.3 Configuration of PAM Modules . . . . . . . . . . . . . . . . . . 500
27.4 For More Information . . . . . . . . . . . . . . . . . . . . . . 502

2 8 Power Management 503


28.1 Power Saving Functions . . . . . . . . . . . . . . . . . . . . . . 504
28.2 APM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
28.3 ACPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
28.4 Rest for the Hard Disk . . . . . . . . . . . . . . . . . . . . . . 514
28.5 The powersave Package . . . . . . . . . . . . . . . . . . . . . . 515
28.6 The YaST Power Management Module . . . . . . . . . . . . . . . . 524

2 9 Wireless Communication 529


29.1 Wireless LAN . . . . . . . . . . . . . . . . . . . . . . . . . . 529

Part IV Services 541

3 0 Basic Networking 543


30.1 IP Addresses and Routing . . . . . . . . . . . . . . . . . . . . . 547
30.2 IPv6—The Next Generation Internet . . . . . . . . . . . . . . . . 550
30.3 Name Resolution . . . . . . . . . . . . . . . . . . . . . . . . 559
30.4 Configuring a Network Connection with YaST . . . . . . . . . . . . 560
30.5 Managing Network Connections with NetworkManager . . . . . . . . 578
30.6 Configuring a Network Connection Manually . . . . . . . . . . . . . 580
30.7 smpppd as Dial-up Assistant . . . . . . . . . . . . . . . . . . . . 596

3 1 SLP Services in the Network 599


31.1 Activating SLP . . . . . . . . . . . . . . . . . . . . . . . . . . 599
31.2 SLP Front-Ends in SUSE Linux Enterprise . . . . . . . . . . . . . . . 600
31.3 Installation over SLP . . . . . . . . . . . . . . . . . . . . . . . 600
31.4 Providing Services with SLP . . . . . . . . . . . . . . . . . . . . 601
31.5 For More Information . . . . . . . . . . . . . . . . . . . . . . 602

3 2 Time Synchronization with NTP 603


32.1 Configuring an NTP Client with YaST . . . . . . . . . . . . . . . . 603
32.2 Configuring xntp in the Network . . . . . . . . . . . . . . . . . . 607
32.3 Setting Up a Local Reference Clock . . . . . . . . . . . . . . . . . 607

3 3 The Domain Name System 609


33.1 DNS Terminology . . . . . . . . . . . . . . . . . . . . . . . . 609
33.2 Configuration with YaST . . . . . . . . . . . . . . . . . . . . . . 610
33.3 Starting the Name Server BIND . . . . . . . . . . . . . . . . . . 620
33.4 The Configuration File /etc/named.conf . . . . . . . . . . . . . . . 622
33.5 Zone Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
33.6 Dynamic Update of Zone Data . . . . . . . . . . . . . . . . . . . 631
33.7 Secure Transactions . . . . . . . . . . . . . . . . . . . . . . . 631
33.8 DNS Security . . . . . . . . . . . . . . . . . . . . . . . . . . 633
33.9 For More Information . . . . . . . . . . . . . . . . . . . . . . 633

3 4 DHCP 635
34.1 Configuring a DHCP Server with YaST . . . . . . . . . . . . . . . . 636
34.2 DHCP Software Packages . . . . . . . . . . . . . . . . . . . . . 647
34.3 The DHCP Server dhcpd . . . . . . . . . . . . . . . . . . . . . 648
34.4 For More Information . . . . . . . . . . . . . . . . . . . . . . 651

3 5 Using NIS 653


35.1 Configuring NIS Servers . . . . . . . . . . . . . . . . . . . . . . 653
35.2 Configuring NIS Clients . . . . . . . . . . . . . . . . . . . . . . 659
3 6 LDAP—A Directory Service 661
36.1 LDAP versus NIS . . . . . . . . . . . . . . . . . . . . . . . . . 662
36.2 Structure of an LDAP Directory Tree . . . . . . . . . . . . . . . . 663
36.3 Server Configuration with slapd.conf . . . . . . . . . . . . . . . . 666
36.4 Data Handling in the LDAP Directory . . . . . . . . . . . . . . . . 672
36.5 Configuring an LDAP Server with YaST . . . . . . . . . . . . . . . . 676
36.6 Configuring an LDAP Client with YaST . . . . . . . . . . . . . . . . 681
36.7 Configuring LDAP Users and Groups in YaST . . . . . . . . . . . . . 690
36.8 Browsing the LDAP Directory Tree . . . . . . . . . . . . . . . . . 692
36.9 For More Information . . . . . . . . . . . . . . . . . . . . . . 693

3 7 Samba 695
37.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
37.2 Starting and Stopping Samba . . . . . . . . . . . . . . . . . . . 697
37.3 Configuring a Samba Server . . . . . . . . . . . . . . . . . . . . 697
37.4 Configuring Clients . . . . . . . . . . . . . . . . . . . . . . . . 703
37.5 Samba as Login Server . . . . . . . . . . . . . . . . . . . . . . 704
37.6 Samba Server in the Network with Active Directory . . . . . . . . . . 705
37.7 Migrating a Windows NT Server to Samba . . . . . . . . . . . . . . 707
37.8 For More Information . . . . . . . . . . . . . . . . . . . . . . 709

3 8 Sharing File Systems with NFS 711


38.1 Installing the Required Software . . . . . . . . . . . . . . . . . . 711
38.2 Importing File Systems with YaST . . . . . . . . . . . . . . . . . 712
38.3 Importing File Systems Manually . . . . . . . . . . . . . . . . . . 713
38.4 Exporting File Systems with YaST . . . . . . . . . . . . . . . . . . 715
38.5 Exporting File Systems Manually . . . . . . . . . . . . . . . . . . 720
38.6 NFS with Kerberos . . . . . . . . . . . . . . . . . . . . . . . . 723
38.7 For More Information . . . . . . . . . . . . . . . . . . . . . . 723

3 9 File Synchronization 725


39.1 Available Data Synchronization Software . . . . . . . . . . . . . . . 725
39.2 Determining Factors for Selecting a Program . . . . . . . . . . . . . 727
39.3 Introduction to CVS . . . . . . . . . . . . . . . . . . . . . . . 730
39.4 Introduction to rsync . . . . . . . . . . . . . . . . . . . . . . . 733

4 0 The Apache HTTP Server 737


40.1 Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
40.2 Configuring Apache . . . . . . . . . . . . . . . . . . . . . . . 739
40.3 Starting and Stopping Apache . . . . . . . . . . . . . . . . . . . 754
40.4 Installing, Activating, and Configuring Modules . . . . . . . . . . . . 756
40.5 Getting CGI Scripts to Work . . . . . . . . . . . . . . . . . . . . 764
40.6 Setting Up a Secure Web Server with SSL . . . . . . . . . . . . . . 766
40.7 Avoiding Security Problems . . . . . . . . . . . . . . . . . . . . 772
40.8 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . 774
40.9 For More Information . . . . . . . . . . . . . . . . . . . . . . 775

4 1 The Proxy Server Squid 779


41.1 Some Facts about Proxy Caches . . . . . . . . . . . . . . . . . . 780
41.2 System Requirements . . . . . . . . . . . . . . . . . . . . . . . 781
41.3 Starting Squid . . . . . . . . . . . . . . . . . . . . . . . . . . 783
41.4 The Configuration File /etc/squid/squid.conf . . . . . . . . . . . . . 785
41.5 Configuring a Transparent Proxy . . . . . . . . . . . . . . . . . . 791
41.6 cachemgr.cgi . . . . . . . . . . . . . . . . . . . . . . . . . . 794
41.7 squidGuard . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
41.8 Cache Report Generation with Calamaris . . . . . . . . . . . . . . 797
41.9 For More Information . . . . . . . . . . . . . . . . . . . . . . 798

Part V Security 799

4 2 Managing X.509 Certification 801


42.1 The Principles of Digital Certification . . . . . . . . . . . . . . . . 801
42.2 YaST Modules for CA Management . . . . . . . . . . . . . . . . . 806

4 3 Masquerading and Firewalls 817


43.1 Packet Filtering with iptables . . . . . . . . . . . . . . . . . . . . 817
43.2 Masquerading Basics . . . . . . . . . . . . . . . . . . . . . . . 819
43.3 Firewalling Basics . . . . . . . . . . . . . . . . . . . . . . . . 820
43.4 SuSEfirewall2 . . . . . . . . . . . . . . . . . . . . . . . . . . 821
43.5 For More Information . . . . . . . . . . . . . . . . . . . . . . 826

4 4 SSH: Secure Network Operations 827


44.1 The OpenSSH Package . . . . . . . . . . . . . . . . . . . . . . 827
44.2 The ssh Program . . . . . . . . . . . . . . . . . . . . . . . . . 828
44.3 scp—Secure Copy . . . . . . . . . . . . . . . . . . . . . . . . 828
44.4 sftp—Secure File Transfer . . . . . . . . . . . . . . . . . . . . . 829
44.5 The SSH Daemon (sshd)—Server-Side . . . . . . . . . . . . . . . . 829
44.6 SSH Authentication Mechanisms . . . . . . . . . . . . . . . . . . 830
44.7 X, Authentication, and Forwarding Mechanisms . . . . . . . . . . . . 832
4 5 Network Authentication—Kerberos 833
45.1 Kerberos Terminology . . . . . . . . . . . . . . . . . . . . . . 833
45.2 How Kerberos Works . . . . . . . . . . . . . . . . . . . . . . . 835
45.3 Users' View of Kerberos . . . . . . . . . . . . . . . . . . . . . . 838
45.4 For More Information . . . . . . . . . . . . . . . . . . . . . . 839

4 6 Installing and Administering Kerberos 841


46.1 Choosing the Kerberos Realms . . . . . . . . . . . . . . . . . . . 841
46.2 Setting Up the KDC Hardware . . . . . . . . . . . . . . . . . . . 842
46.3 Clock Synchronization . . . . . . . . . . . . . . . . . . . . . . 843
46.4 Configuring the KDC . . . . . . . . . . . . . . . . . . . . . . . 843
46.5 Manually Configuring Kerberos Clients . . . . . . . . . . . . . . . 846
46.6 Configuring a Kerberos Client with YaST . . . . . . . . . . . . . . . 849
46.7 Remote Kerberos Administration . . . . . . . . . . . . . . . . . . 851
46.8 Creating Kerberos Host Principals . . . . . . . . . . . . . . . . . 853
46.9 Enabling PAM Support for Kerberos . . . . . . . . . . . . . . . . 855
46.10 Configuring SSH for Kerberos Authentication . . . . . . . . . . . . . 856
46.11 Using LDAP and Kerberos . . . . . . . . . . . . . . . . . . . . . 857

4 7 Encrypting Partitions and Files 861


47.1 Setting Up an Encrypted File System with YaST . . . . . . . . . . . . 862
47.2 Using Encrypted Home Directories . . . . . . . . . . . . . . . . . 865
47.3 Using vi to Encrypt Single Files . . . . . . . . . . . . . . . . . . . 867

4 8 Confining Privileges with AppArmor 869


48.1 Installing Novell AppArmor . . . . . . . . . . . . . . . . . . . . 870
48.2 Enabling and Disabling Novell AppArmor . . . . . . . . . . . . . . 870
48.3 Getting Started with Profiling Applications . . . . . . . . . . . . . 872

4 9 Security and Confidentiality 879


49.1 Local Security and Network Security . . . . . . . . . . . . . . . . 880
49.2 Some General Security Tips and Tricks . . . . . . . . . . . . . . . 889
49.3 Using the Central Security Reporting Address . . . . . . . . . . . . 891

Part VI Troubleshooting 893

5 0 Help and Documentation 895


50.1 Using the SUSE Help Center . . . . . . . . . . . . . . . . . . . . 895
50.2 Man Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
50.3 Info Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
50.4 The Linux Documentation Project . . . . . . . . . . . . . . . . . 900
50.5 Wikipedia: The Free Online Encyclopedia . . . . . . . . . . . . . . 901
50.6 Guides and Books . . . . . . . . . . . . . . . . . . . . . . . . 901
50.7 Package Documentation . . . . . . . . . . . . . . . . . . . . . 902
50.8 Usenet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
50.9 Standards and Specifications . . . . . . . . . . . . . . . . . . . . 903

5 1 Common Problems and Their Solutions 907


51.1 Finding and Gathering Information . . . . . . . . . . . . . . . . . 907
51.2 Installation Problems . . . . . . . . . . . . . . . . . . . . . . . 910
51.3 Boot Problems . . . . . . . . . . . . . . . . . . . . . . . . . 918
51.4 Login Problems . . . . . . . . . . . . . . . . . . . . . . . . . 920
51.5 Network Problems . . . . . . . . . . . . . . . . . . . . . . . . 926
51.6 Data Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 931
51.7 IBM System z: Using initrd as a Rescue System . . . . . . . . . . . . 944

Index 949
About This Guide
This guide is intended for use by professional network and system administrators during
the actual planning, deployment, configuration, and operation of SUSE Linux Enter-
prise®. As such, it is solely concerned with ensuring that SUSE Linux Enterprise is
properly configured and that the required services on the network are available to allow
it to function properly as initially installed. This guide does not cover the process of
ensuring that SUSE Linux Enterprise offers proper compatibility with your enterprise's
application software or that its core functionality meets those requirements. It assumes
that a full requirements audit has been done and the installation has been requested or
that a test installation, for the purpose of such an audit, has been requested.

This guide contains the following:

Deployment
Before you install SUSE Linux Enterprise, choose the deployment strategy and
disk setup that is best suited for your scenario. Learn how to install your system
manually, how to use network installation setups, and how to perform an autoinstal-
lation. Configure the installed system with YaST to adapt it to your requirements.

Administration
SUSE Linux Enterprise offers a wide range of tools to customize various aspects
of the system. This part introduces a few of them.

System
Learn more about the underlying operating system by studying this part. SUSE
Linux Enterprise supports a number of hardware architectures and you can use this
to adapt your own applications to run on SUSE Linux Enterprise. The boot loader
and boot procedure information assists you in understanding how your Linux system
works and how your own custom scripts and applications may blend in with it.

Services
SUSE Linux Enterprise is designed to be a network operating system. It offers a
wide range of network services, such as DNS, DHCP, Web, proxy, and authentica-
tion services, and integrates well into heterogeneous environments including MS
Windows clients and servers.
Security
This edition of SUSE Linux Enterprise includes several security-related features.
It ships with Novell® AppArmor, which enables you to protect your applications
by restricting privileges. Secure login, firewalling, and file system encryption are
covered as well.

Troubleshooting
SUSE Linux Enterprise includes a wealth of applications, tools, and documentation
should you need them in case of trouble. Some of the most common problems that
can occur with SUSE Linux Enterprise and their solutions are discussed in detail.

1 Feedback
We want to hear your comments and suggestions about this manual and the other doc-
umentation included with this product. Please use the User Comments feature at the
bottom of each page of the online documentation and enter your comments there.

2 Documentation Updates
For the latest version of this documentation, see the SUSE Linux Enterprise Server
Web site [http://www.novell.com/documentation/sles10/index
.html].

3 Additional Documentation
For additional documentation on this product, refer to http://www.novell.com/
documentation/sles10/index.html:

Start-Up Guide
Basic information about installation types and work flows.

Architecture-Specific Information
Architecture-specific information needed to prepare a SUSE Linux Enterprise
Server target for installation.

xvi Installation and Administration


Novell AppArmor Administration Guide
An in-depth administration guide to Novell AppArmor that introduces application
confinement for heightened security in your environment.

Storage Administration Guide


An introduction to managing various types of storage devices on SUSE Linux En-
terprise.

Heartbeat Guide
An in-depth administration guide to setting up high availability scenarios with
Heartbeat.

Novell Virtualization Technology User Guide


An introduction to virtualization solutions based on SUSE Linux Enterprise and
the Xen* virtualization technology.

For a documentation overview on the SUSE® Linux Enterprise Desktop product, refer
to http://www.novell.com/documentation/sled10/index.html. The
following manuals are exclusively available for SUSE Linux Enterprise Desktop:

GNOME User Guide


A comprehensive guide to the GNOME desktop and its most important applications.

KDE User Guide


A comprehensive guide to the KDE desktop and its most important applications.

Deployment Guide
An in-depth guide for administrators facing the deployment and management of
SUSE Linux Enterprise Desktop.

Novell AppArmor Administration Guide


An in-depth administration guide to Novell AppArmor that introduces application
confinement for heightened security in your environment.

Many chapters in this manual contain links to additional documentation resources. This
includes additional documentation that is available on the system as well as documen-
tation available on the Internet.

About This Guide xvii


4 Documentation Conventions
The following typographical conventions are used in this manual:

• /etc/passwd: filenames and directory names

• placeholder: replace placeholder with the actual value

• PATH: the environment variable PATH

• ls, --help: commands, options, and parameters

• user: users or groups

• Alt, Alt + F1: a key to press or a key combination; keys are shown in uppercase as
on a keyboard

• File, File > Save As: menu items, buttons

• ►amd64 ipf: This paragraph is only relevant for the specified architectures. The
arrows mark the beginning and the end of the text block.◄

►ipseries s390 zseries: This paragraph is only relevant for the specified architec-
tures. The arrows mark the beginning and the end of the text block.◄

• Dancing Penguins (Chapter Penguins, ↑Another Manual): This is a reference to a


chapter in another manual.

xviii Installation and Administration


Part I. Deployment
Planning for SUSE Linux
Enterprise
The implementation of an operating system either in an existing IT environment or as
1
a completely new rollout must be carefully prepared. With SUSE Linux Enterprise 10,
get a variety of new features. It is impossible to describe all the new features here. The
following is just a list of major enhancements that might be of interest.

Xen 3.0 Virtualization


Runs many virtual machines on a single server, each with its own instance of an
operating system. For more information, see Chapter 22, Virtualization (page 421).

YaST
Several new configuration options have been developed for YaST. These are nor-
mally described in the chapters about the technology involved.

CIM Management with openWBEM


The Common Information Model Object Manager (CIMON) is a Web-based enter-
prise management utility. It provides a mature management framework. See also
Chapter 11, OpenWBEM (page 227).

SPident
The management utility SPident gives an overview of the installed software base
and clarifies the current service pack level of the system.

Directory Services
Several LDAP-compliant directory services are available:
• Microsoft Active Directory

• OpenLDAP

Planning for SUSE Linux Enterprise 3


Novell AppArmor
Harden your System with the Novell AppArmor technology. This service is de-
scribed in depth in Novell AppArmor Administration Guide (↑Novell AppArmor
Administration Guide).

iSCSI
iSCSI provides an easy and reasonably inexpensive solution for connecting Linux
computers to central storage systems. Find more information about iSCSI in
Chapter 12, Mass Storage over IP Networks—iSCSI (page 257).

Network File System v4


Starting with version 10, SUSE Linux Enterprise supports NFS also in version 4.
This gives you performance improvements, strong security, and a “stateful” protocol.
See also Chapter 38, Sharing File Systems with NFS (page 711).

Oracle Cluster File System 2


OCFS2 is a general-purpose journaling file system that is fully integrated in the
Linux 2.6 kernel and later. Find an overview of OCFS2 in Chapter 13, Oracle
Cluster File System 2 (page 267).

Heartbeat 2
Heartbeat 2 provides a cluster membership and messaging infrastructure. The setup
of such a cluster is described in the Heartbeat Guide.

Multipath I/O
Device mapping multipath IO features automatic configuration of the subsystem
for a large variety of setups. For details, see the chapter about multipath I/O in
Storage Administration Guide.

Linux Kernel Crash Dump


Debugging kernel-related problems is now much more comfortable when using
Kexec and Kdump. This technology is available on x86, AMD64, Intel 64, and
POWER platforms.

4 Installation and Administration


1.1 Considerations for Deployment of
a SUSE Linux Enterprise
At the beginning of the planning process, you should try to define the project goals and
needed features. This must be done individually for each project, but the questions to
answer should include the following:

• How many installations should be done? Depending on this, the best deployment
method differs. See also Chapter 2, Deployment Strategies (page 7).

• Will the system be in a hostile environment? Have a look at Chapter 49, Security
and Confidentiality (page 879) to get an overview of consequences.

• How will you get regular updates? All patches are provided online for registered
users. Find the registration and patch support database at http://www.novell
.com/suselinuxportal.

• Do you need help for your local installation? Novell provides training, support,
and consulting for all topics around SUSE Linux Enterprise. Find more information
about this at http://www.novell.com/products/
linuxenterpriseserver/.

• Do you need third-party products? Make sure that the required product is also
supported on the desired platform. Novell can also provide help to port software
to different platforms when needed.

1.2 Deployment of SUSE Linux


Enterprise
To make sure that your system will run flawlessly, always try to use certified hardware.
The hardware certification process is an ongoing process and the database of certified
hardware is updated regularly. Find the search form for certified hardware at http://
developer.novell.com/yessearch/Search.jsp.

Depending on the number of desired installations, it is beneficial to use installation


servers or even completely automatic installations. Have a look at Chapter 2, Deployment

Planning for SUSE Linux Enterprise 5


Strategies (page 7) for more information. When using the Xen virtualization technolo-
gies, network root file systems or network storage solutions like iSCSI should be con-
sidered. See also Chapter 12, Mass Storage over IP Networks—iSCSI (page 257).

SUSE Linux Enterprise provides you with a broad variety of services. Find an overview
of the documentation in this book in About This Guide (page xv). Most of the needed
configurations can be made with YaST, the SUSE configuration utility. In addition to
that, many manual configurations are described in the corresponding chapters.

In addition to the plain software installation, you should consider training the end users
of the systems as well as help desk staff.

1.3 Running SUSE Linux Enterprise


The SUSE Linux Enterprise operating system is a well-tested and stable system. Unfor-
tunately, this does not prevent hardware failures or other causes for downtime or data
loss. For any serious computing task where data loss could occur, a regular backup
should be done.

For optimal security and safe work, you should make regular updates of all the operated
machines. If you have a mission critical server, you should probably run a second
identical machine where you can apply all changes for testing purposes before doing
so on the real system. This also gives you the possibility to switch machines in case of
hardware failure.

6 Installation and Administration


Deployment Strategies
There are several different ways to deploy SUSE® Linux Enterprise. Choose from
2
various approaches ranging from a local installation using physical media or a network
installation server to a mass deployment using a remote-controlled, highly-customized,
and automated installation technique. Select the method that best matches your require-
ments.

2.1 Deploying up to 10 Workstations


If your deployment of SUSE Linux Enterprise only involves 1 to 10 workstations, the
easiest and least complex way of deploying SUSE Linux Enterprise is a plain manual
installation as featured in Chapter 3, Installation with YaST (page 17). Manual installa-
tion can be done in several different ways depending on your requirements:

Installing from the SUSE Linux Enterprise Media (page 8)


Consider this approach if you want to install a single, disconnected workstation.

Installing from a Network Server Using SLP (page 8)


Consider this approach if you have a single workstation or a small number of
workstations and if a network installation server announced via SLP is available.

Installing from a Network Server (page 9)


Consider this approach if you have a single workstation or a small number of
workstations and if a network installation server is available.

Deployment Strategies 7
Table 2.1 Installing from the SUSE Linux Enterprise Media

Installation Source SUSE Linux Enterprise media kit

Tasks Requiring Manual Inter- • Inserting the installation media


action
• Booting the installation target

• Changing media

• Determining the YaST installation scope

• Configuring the system with YaST system

Remotely Controlled Tasks None

Details Section 3.2.2, “Installing from the SUSE Linux En-


terprise Media” (page 19)

Table 2.2 Installing from a Network Server Using SLP

Installation Source Network installation server holding the SUSE Linux


Enterprise installation media

Tasks Requiring Manual • Inserting the boot disk


Interaction
• Booting installation target

• Determining the YaST installation scope

• Configuring the system with YaST

Remotely Controlled Tasks None, but this method can be combined with VNC

Details Section 3.2.3, “Installing from a Network Server Using


SLP” (page 19)

8 Installation and Administration


Table 2.3 Installing from a Network Server

Installation Source Network installation server holding the SUSE Linux


Enterprise installation media

Tasks Requiring Manual • Inserting the boot disk


Interaction
• Providing boot options

• Booting the installation target

• Determining the YaST installation scope

• Configuring the system with YaST

Remotely Controlled Tasks None, but method can be combined with VNC

Details Section 3.2.4, “Installing from a Network Source with-


out SLP” (page 19)

2.2 Deploying up to 100 Workstations


With a growing numbers of workstations to install, you certainly do not want to install
and configure each one of them manually. There are many automated or semiautomated
approaches as well as several options to perform an installation with minimal to no
physical user interaction.

Before considering a fully-automated approach, take into account that the more complex
the scenario gets the longer it takes to set up. If a time limit is associated with your de-
ployment, it might be a good idea to select a less complex approach that can be carried
out much more quickly. Automation makes sense for huge deployments and those that
need to be carried out remotely.

Choose from the following options:

Simple Remote Installation via VNC—Static Network Configuration (page 11)


Consider this approach in a small to medium scenario with a static network setup.
A network, network installation server, and VNC viewer application are required.

Deployment Strategies 9
Simple Remote Installation via VNC—Dynamic Network Configuration (page 11)
Consider this approach in a small to medium scenario with dynamic network setup
through DHCP. A network, network installation server, and VNC viewer application
are required.

Remote Installation via VNC—PXE Boot and Wake on LAN (page 12)
Consider this approach in a small to medium scenario that should be installed via
network and without physical interaction with the installation targets. A network,
a network installation server, network boot images, network bootable target hard-
ware, and a VNC viewer application are required.

Simple Remote Installation via SSH—Static Network Configuration (page 12)


Consider this approach in a small to medium scenario with static network setup.
A network, network installation server, and SSH client application are required.

Remote Installation via SSH—Dynamic Network Configuration (page 13)


Consider this approach in a small to medium scenario with dynamic network setup
through DHCP. A network, network installation server, and SSH client application
are required.

Remote Installation via SSH—PXE Boot and Wake on LAN (page 13)
Consider this approach in a small to medium scenario that should be installed via
network and without physical interaction with the installation targets. A network,
a network installation server, network boot images, network bootable target hard-
ware, and an SSH client application are required.

Simple Mass Installation (page 14)


Consider this approach for large deployments to identical machines. If configured
to use network booting, physical interaction with the target systems is not needed
at all. A network, a network installation server, a remote controlling application
such as a VNC viewer or an SSH client, and an AutoYaST configuration profile
are required. If using network boot, a network boot image and network bootable
hardware are required as well.

Rule-Based Autoinstallation (page 15)


Consider this approach for large deployments to various types of hardware. If
configured to use network booting, physical interaction with the target systems is
not needed at all. A network, a network installation server, a remote controlling
application such as a VNC viewer or an SSH client, and several AutoYaST confi-
guration profiles as well as a rule setup for AutoYaST are required. If using network
boot, a network boot image and network bootable hardware are required as well.

10 Installation and Administration


Table 2.4 Simple Remote Installation via VNC—Static Network Configuration

Installation Source Network

Preparations • Setting up an installation source

• Booting from the installation media

Control and Monitoring Remote: VNC

Best Suited For small to medium scenarios with varying hardware

Drawbacks • Each machine must be set up individually

• Physical access is needed for booting

Details Section 4.1.1, “Simple Remote Installation via


VNC—Static Network Configuration” (page 44)

Table 2.5 Simple Remote Installation via VNC—Dynamic Network Configuration

Installation Source Network

Preparations • Setting up the installation source

• Booting from the installation media

Control and Monitoring Remote: VNC

Best Suited For Small to medium scenarios with varying hardware

Drawbacks • Each machine must be set up individually

• Physical access is needed for booting

Deployment Strategies 11
Details Section 4.1.2, “Simple Remote Installation via
VNC—Dynamic Network Configuration” (page 45)

Table 2.6 Remote Installation via VNC—PXE Boot and Wake on LAN

Installation Source Network

Preparations • Setting up the installation source

• Configuring DHCP, TFTP, PXE boot, and WOL

• Booting from the network

Control and Monitoring Remote: VNC

Best Suited For • Small to medium scenarios with varying hardware

• Completely remote installs; cross-site deployment

Drawbacks Each machine must be set up manually

Details Section 4.1.3, “Remote Installation via VNC—PXE


Boot and Wake on LAN” (page 47)

Table 2.7 Simple Remote Installation via SSH—Static Network Configuration

Installation Source Network

Preparations • Setting up the installation source

• Booting from the installation media

Control and Monitoring Remote: SSH

Best Suited For • Small to medium scenarios with varying hardware

12 Installation and Administration


• Low bandwidth connections to target

Drawbacks • Each machine must be set up individually

• Physical access is needed for booting

Details Section 4.1.4, “Simple Remote Installation via


SSH—Static Network Configuration” (page 48)

Table 2.8 Remote Installation via SSH—Dynamic Network Configuration

Installation Source Network

Preparations • Setting up the installation source

• Booting from installation media

Control and Monitoring Remote: SSH

Best Suited For • Small to medium scenarios with varying hardware

• Low bandwidth connections to target

Drawbacks • Each machine must be set up individually

• Physical access is needed for booting

Details Section 4.1.5, “Simple Remote Installation via


SSH—Dynamic Network Configuration” (page 49)

Table 2.9 Remote Installation via SSH—PXE Boot and Wake on LAN

Installation Source Network

Preparations • Setting up the installation source

Deployment Strategies 13
• Configuring DHCP, TFTP, PXE boot, and WOL

• Booting from the network

Control and Monitoring Remote: SSH

Best Suited For • Small to medium scenarios with varying hardware

• Completely remote installs; cross-site deployment

• Low bandwidth connections to target

Drawbacks Each machine must be set up individually

Details Section 4.1.6, “Remote Installation via SSH—PXE Boot


and Wake on LAN” (page 51)

Table 2.10 Simple Mass Installation

Installation Source Preferably network

Preparations • Gathering hardware information

• Creating AutoYaST profile

• Setting up the installation server

• Distributing the profile

• Setting up network boot (DHCP, TFTP, PXE, WOL)

or

Booting the target from installation media

Control and Monitoring Local or remote through VNC or SSH

14 Installation and Administration


Best Suited For • Large scenarios

• Identical hardware

• No access to system (network boot)

Drawbacks Applies only to machines with identical hardware

Details Section 5.1, “Simple Mass Installation” (page 81)

Table 2.11 Rule-Based Autoinstallation

Installation Source Preferably network

Preparations • Gathering hardware information

• Creating AutoYaST profiles

• Creating AutoYaST rules

• Setting up the installation server

• Distributing the profile

• Setting up network boot (DHCP, TFTP, PXE, WOL)

or

Booting the target from installation media

Control and Monitoring Local or remote through SSH or VNC

Best Suited For • Varying hardware

• Cross-site deployments

Drawbacks Complex rule setup

Deployment Strategies 15
Details Section 5.2, “Rule-Based Autoinstallation” (page 93)

2.3 Deploying More than 100


Workstations
Most of the considerations brought up for medium installation scenarios in Section 2.1,
“Deploying up to 10 Workstations” (page 7) still hold true for large scale deployments.
However, with a growing number of installation targets, the benefits of a fully automated
installation method outweigh its disadvantages.

It pays off to invest a considerable amount of time to create a sophisticated rule and
class framework in AutoYaST to match the requirements of a huge deployment site.
Not having to touch each target separately can save you a tremendous amount of time
depending on the scope of your installation project.

16 Installation and Administration


Installation with YaST
After your hardware has been prepared for the installation of SUSE Linux Enterprise®
3
as described in the Architecture-Specific Information manual and after the connection
with the installation system has been established, you are presented with the interface
of SUSE Linux Enterprise's system assistant YaST. YaST guides you through the entire
installation and configuration procedure.

3.1 IBM System z: System Start-Up for


Installation
For IBM System z platforms, the system is initialized (IPL) as described in the Archi-
tecture-Specific Information manual. SUSE Linux Enterprise does not show a splash
screen on these systems. During the installation, load the kernel, initrd, and parmfile
manually. YaST starts with its installation screen as soon as a connection has been es-
tablished to the installation system via VNC, X, or SSH. Because there is no splash
screen, kernel or boot parameters cannot be entered on screen, but must be specified
in a parmfile (see the parmfile information in Appendix A, Appendix (↑Architecture-
Specific Information)).

TIP: IBM System z: The Next Steps

To install, follow the description of the installation procedure with YaST starting
from Section 3.4, “Language” (page 21).

Installation with YaST 17


3.2 System Start-Up for Installation
You can install SUSE Linux Enterprise from local installation sources, such as the
SUSE Linux Enterprise CDs or DVD, or from network source of an FTP, HTTP, or
NFS server. Any of these approaches requires physical access to the system to install
and user interaction during the installation. The installation procedure is basically the
same regardless of the installation source.

3.2.1 Boot Options


Boot options other than CD or DVD exist and can be used if problems arise booting
from CD or DVD. These options are described in Table 3.1, “Boot Options” (page 18).

Table 3.1 Boot Options

Boot Option Description

CD-ROM This is the easiest boot option. This option can be used if the
system has a local CD-ROM drive that is supported by Linux.

Floppy The images for generating boot floppies are located on CD 1 in


the /boot directory. A README is available in the same direc-
tory.

PXE or BOOTP This must be supported by the system's BIOS or firmware and a
boot server must be available in the network. This task can also
be handled by another SUSE Linux Enterprise system.

Hard Disk SUSE Linux Enterprise can also be booted from the hard disk.
To do this, copy the kernel (linux) and the installation system
(initrd) from the directory /boot/loader on CD 1 to the
hard disk and add the appropriate entry to the boot loader.

18 Installation and Administration


3.2.2 Installing from the SUSE Linux
Enterprise Media
To install from the media, insert the first CD or DVD into the appropriate drive of the
system to install. Reboot the system to boot from the media and open the boot screen.

3.2.3 Installing from a Network Server Using


SLP
If your network setup supports OpenSLP and your network installation source has been
configured to announce itself via OpenSLP (described in Section 4.2, “Setting Up the
Server Holding the Installation Sources” (page 52)), boot the system from the media
or with another boot option. In the boot screen, select the desired installation option.
Press F4 then select SLP.

The installation program retrieves the location of the network installation source using
OpenSLP and configures the network connection with DHCP. If the DHCP network
configuration fails, you are prompted to enter the appropriate parameters manually.
The installation then proceeds normally.

3.2.4 Installing from a Network Source


without SLP
If your network setup does not support OpenSLP for the retrieval of network installation
sources, boot the system from the media or with another boot option. In the boot screen,
select the desired installation option. Press F4 then select the desired network protocol
(NFS, HTTP, FTP, or SMB). Provide the server's address and the path to the installation
media. The installation retrieves the installation data from the source specified. The
installation then proceeds normally.

3.3 The Boot Screen


The boot screen displays a number of options for the installation procedure. Boot from
Hard Disk boots the installed system and is selected default, because the CD is often

Installation with YaST 19


left in the drive. To install the system, select one of the installation options with the
arrow keys. The relevant options are:

Installation
The normal installation mode. All modern hardware functions are enabled.

Installation—ACPI Disabled
If the normal installation fails, this might be due to the system hardware not sup-
porting ACPI (advanced configuration and power interface). If this seems to be the
case, use this option to install without ACPI support.

Installation—Local APIC Disabled


If the normal installation fails, this might be due to the system hardware not sup-
porting local APIC (Advanced Programmable Interrupt Controllers). If this seems
to be the case, use this option to install without local APIC support.

If you are not sure, try one of the following options first: Installation—ACPI Dis-
abled or Installation—Safe Settings.

Installation—Safe Settings
Boots the system with the DMA mode (for CD-ROM drives) and power management
functions disabled. Experts can also use the command line to enter or change kernel
parameters.

Installation options from the menu disable only the most problematic functions. If you
need to disable or set other functions, use the Boot Options prompt. Find detailed infor-
mation about kernel parameters at http://en.opensuse.org/Linuxrc.

Use the function keys indicated in the bar at the bottom of the screen to change a lan-
guage, resolution of the monitor, or installation source or to add addition driver from
your hardware vendor:

F1
Get context-sensitive help for the active element of the boot screen.

F2
Select the display language for the installation. The default language is English.

F3
Select various graphical display modes for the installation. Select Text Mode if the
graphical installation causes problems.

20 Installation and Administration


F4
Normally, the installation is performed from the inserted installation medium. Here,
select other sources, like FTP or NFS servers. If the installation is carried out in a
network with an SLP server, select one of the installation sources available on the
server with this option. Find information about SLP in Chapter 31, SLP Services
in the Network (page 599).

F5
Press this key to tell the system that you have an optional disk with a driver update
for SUSE Linux Enterprise. With File, load drivers directly from CD before the
installation starts. If you select Yes, you are prompted to insert the update disk at
the appropriate point in the installation process. The default option is No—not to
load a driver update.

A few seconds after starting the installation, SUSE Linux Enterprise loads a minimal
Linux system to run the installation procedure. To see what is going on during the boot
process, press Esc to see the messages and copyright notices. At the end of the loading
process, the YaST installation program starts. After a few more seconds, the screen
should display the graphical installer. The actual installation of SUSE Linux Enterprise
begins at this point.

TIP: Installation without a Mouse

If the installer does not detect your mouse correctly, use Tab for navigation,
arrow keys to scroll, and Enter to confirm a selection.

3.4 Language
YaST and SUSE Linux Enterprise in general can be configured to use different languages
according to your needs. The language selected here is also used for the keyboard layout.
In addition, YaST uses the language setting to guess a time zone for the system clock.
These settings can be modified later along with the selection of secondary languages
to install on your system.

You can change the language later during installation in the Installation Summary, de-
scribed in Section 3.9, “Installation Summary” (page 26). For information about lan-
guage settings in the installed system, see Section 8.1, “YaST Language” (page 126).

Installation with YaST 21


3.5 IBM System z: Hard Disk
Configuration
When installing on IBM System z platforms, the language selection dialog is followed
by a dialog to configure the attached hard disks. Select DASD, Fibre Channel Attached
SCSI Disks (ZFCP), or iSCSI for installation of SUSE Linux Enterprise.

After selecting Configure DASD Disks, an overview lists all available DASDs. To get
a clearer picture of the available devices, use the entry field located above the list to
specify a range of channels to display. To filter the list according to such a range, select
Filter. See Figure 3.1, “IBM System z: Selecting a DASD” (page 22).

Figure 3.1 IBM System z: Selecting a DASD

Now specify the DASDs to use for the installation by selecting the corresponding entries
in the list then clicking Select or Deselect. After that, activate and make the DASDs
available for the installation by selecting Perform Action > Activate. See Figure 3.2,
“IBM System z: Activating a DASD” (page 23). To format the DASDs, select Perform
Action > Format right away or use the YaST partitioner later as described in Sec-
tion 8.5.7, “Using the YaST Partitioner” (page 149).

22 Installation and Administration


Figure 3.2 IBM System z: Activating a DASD

Figure 3.3 IBM System z: Overview of Available ZFCP Disks

To use ZFCP disks for the SUSE Linux Enterprise installation, select Configure ZFCP
Disks in the selection dialog. This opens a dialog with a list of the ZFCP disks available
on the system. In this dialog, select Add to open another dialog in which to enter ZFCP
parameters. See Figure 3.3, “IBM System z: Overview of Available ZFCP Disks”
(page 23).

To make a ZFCP disk available for the SUSE Linux Enterprise installation, use Channel
Number, WWPN (World Wide Port Number), and FCP-LUN to specify the parameters
identifying the corresponding disk. When completed, exit the ZFCP dialog with Next

Installation with YaST 23


and the general hard disk configuration dialog with Finish to continue with the rest of
the configuration.

TIP: Adding DASD or zFCP Disks at a Later Stage

Adding DASD or zFCP disks is not only possible during the installation workflow,
but also when the installation proposal is shown. To add disks at that stage,
click Expert and scroll down. The DASD and zFCP entries are shown at the very
bottom.

After adding the disks, reread the partition table. Return to the installation
proposal screen and choose Partitioning then select Reread Partition Table.
This reads the new partition table and resets any previously entered information.

3.6 License Agreement


Read the license agreement that is displayed on screen thoroughly. If you agree to the
terms, choose Yes, I Agree to the License Agreement and click Next to confirm your
selection. If you do not agree to the license agreement, you cannot install SUSE Linux
Enterprise and the installation terminates.

3.7 System Analysis


After a system analysis where YaST tries to find other installed systems or an already
existing SUSE Linux Enterprise system on your machine, YaST displays the installation
modes available:

New installation
Select this option to start a new installation from scratch.

Update an existing system


Select this option to update to a newer version. For more information about system
update, see Chapter 10, Updating SUSE Linux Enterprise (page 203).

Other
This option provides an opportunity to abort installation and boot or repair an in-
stalled system instead. To boot an already installed SUSE Linux Enterprise, select

24 Installation and Administration


Boot Installed System. If you have problems booting an already installed SUSE
Linux Enterprise, see Section 51.3, “Boot Problems” (page 918).

To repair an installed system that fails to boot, select Repair Installed System. Find
a description of the system repair options in Section “Using YaST System Repair”
(page 934).

NOTE

Updating is only possible if an older SUSE Linux Enterprise system is already


installed. If no SUSE Linux Enterprise system is installed, you can only perform
a new installation.

You can choose to install add-on products together with your SUSE Linux Enterprise
system during the initial installation process or at any time later as described in Sec-
tion 8.3.2, “Installing Add-On Products” (page 135). Add-on products are extensions
for your SUSE Linux Enterprise. An add-on product can include proprietary third-party
products or additional software for your system.

To include add-on products during the installation of SUSE Linux Enterprise, select
Include Add-On Products from Separate Media and click Next. In the next dialog, click
Add to select the source from which to install the add-on products. Many source types
are available, such as CD, FTP, or a local directory. After adding the add-on media,
you may need to agree to additional licenses for third-party products. The added source
for add-on media appears in the overview.

3.8 Time Zone


In this dialog, select your region and time zone from the lists. During installation, both
are preselected according to the selected installation language. Choose between Local
Time and UTC (GMT) for Hardware Clock Set To. The selection depends on how the
BIOS hardware clock is set on your machine. If it is set to GMT, which corresponds
to UTC, your system can rely on SUSE Linux Enterprise to switch from standard time
to daylight saving time and back automatically. Click Change to set the current date
and time. When finished, click Next to continue the installation.

Installation with YaST 25


3.9 Installation Summary
After a thorough system analysis, YaST presents reasonable suggestions for all instal-
lation settings. The options that sometimes need manual intervention in common instal-
lation situations are presented in the Overview tab. Find more special options in the
Expert tab. To modify the suggestions, click Change and select the category to change.
After configuring any of the items presented in these dialogs, you are always returned
to the summary window, which is updated accordingly.

TIP: Resetting the Installation Summary to the Default

You can reset all changes to the defaults by clicking Change > Reset to Defaults.
YaST then shows the original proposal again.

Figure 3.4 Installation Settings

3.9.1 Keyboard Layout


To change the keyboard layout, select Keyboard Layout. By default, the layout corre-
sponds to the language chosen for installation.

26 Installation and Administration


Select the keyboard layout from the list. Use the Test field at the bottom of the dialog
to check if you can enter special characters of that layout correctly. Find more informa-
tion about changing the keyboard layout in Section 8.4.10, “Keyboard Layout”
(page 144). When finished, click Accept to return to the installation summary.

►zseries: On the IBM System z platforms, the installation is performed from a remote
terminal. The host as such has no keyboard or mouse locally connected to it. ◄

3.9.2 Partitioning
In most cases, YaST proposes a reasonable partitioning scheme that can be accepted
without change. YaST can also be used to customize the partitioning, but only experi-
enced users should change partitioning.

When you select the partitioning item in the suggestion window for the first time, the
YaST partitioning dialog displays the proposed partition settings. To accept these set-
tings, click Accept Proposal.

To make small changes in the proposal, select Base Partition Setup on This Proposal
and adjust partitioning in the next dialog. For completely different partitioning, select
Create Custom Partition Setup. In the next dialog, choose the disk to partition or Custom
Partitioning. The YaST partitioner provides tools for LVM and EVMS creation. To
create an LVM proposal, select Create LVM Based Proposal. To create an EVMS
proposal, select Create EVMS Based Proposal. For more information about custom
partitioning, refer to Section 8.5.7, “Using the YaST Partitioner” (page 149).

The partitioning scheme proposed should have sufficient disk space. If implementing
your own partitioning scheme, consider the following recommendations concerning
the requirements for different system types.

3.9.3 Software
SUSE Linux Enterprise contains a number of software packages for various application
purposes. Click Software in the suggestion window to start the software selection and
modify the installation scope according to your needs. Select your categories from the
list in the middle and see the description in the right window. Each category contains
a number of software packages that meet most requirements for that category. For more
detailed selection of software packages to install, select Details to switch to the YaST

Installation with YaST 27


Package Manager. See Figure 3.5, “Installing and Removing Software with the YaST
Package Manager” (page 28).

You can also install additional software packages or remove software packages from
your system at any time later. For more information, refer to Section 8.3.1, “Installing
and Removing Software” (page 127) .

NOTE: Default Desktop

The default desktop of SUSE Linux Enterprise is GNOME. To install KDE, click
Software and select KDE Desktop Environment from Graphical Environments.

Figure 3.5 Installing and Removing Software with the YaST Package Manager

3.9.4 Language
To change the system language or to configure support for secondary languages, select
Language. Select the language from the list. The primary language is used as the system
language. To have support for other languages, select these languages as secondary
languages. For more information, see Section 8.5.15, “Language Selection” (page 158).

28 Installation and Administration


3.9.5 The Expert Configuration
The Overview tab in the Installation Settings dialog provides only basic options. If you
are an advanced user and want to configure booting or change the time zone or default
runlevel, select the Expert tab. It shows the following additional entries not contained
on the Overview tab:

System
This dialog presents all the hardware information YaST could obtain about your
computer. Select any item in the list and click Details to see detailed information
about the selected item. Also add PCI IDs to device drivers with this dialog.

Add-On Products
The added source for add-on media appears in the overview. Before you start the
installation of the SUSE Linux Enterprise, add, remove, or modify add-on products
here if needed.

Booting

►zseries: This module cannot be used to configure the boot loader (zipl) on the
IBM System z platforms. ◄

During installation, YaST proposes a boot configuration for your system. Normally,
you can leave these settings unchanged. However, if you need a custom setup,
modify the proposal for your system. For information, see Section 20.3, “Config-
uring the Boot Loader with YaST” (page 398).

Time Zone
This is the same as the configuration shown earlier in installation. See Section 3.8,
“Time Zone” (page 25) for details.

Default Runlevel
SUSE Linux Enterprise can boot to different runlevels. Normally there should be
no need to change anything here, but if necessary set the default runlevel with this
dialog. Refer to Section 19.2.3, “Configuring System Services (Runlevel) with
YaST” (page 382) for information about runlevel configuration.

Installation with YaST 29


3.10 Performing the Installation
After making all installation settings, click Accept in the suggestion window to begin
the installation. Confirm with Install in the dialog that opens. The installation usually
takes between 15 and 30 minutes, depending on the system performance and the software
selected. As soon as all packages are installed, YaST boots into the new Linux system,
after which you can configure the hardware and set up system services.

Some software can require the license confirmation. If your software selection includes
such software, YaST displays a license confirmation dialog after you click Accept. To
install the software, read the license and click I Agree. If you do not agree with the li-
cense, click I Disagree. The software then is not installed on your system.

3.10.1 IBM System z: IPLing the Installed


System
On the IBM System z platforms, another IPL must be performed after installing the
selected software packages. However, the procedure varies according to the type of
installation:

LPAR Installation
In the IBM System z HMC, select LOAD, select Clear, then enter the loading ad-
dress (the device address of the root device). If using a ZFCP disk as the boot device,
choose LOAD from SCSI and specify both ZFCP WWPN and LUN of the boot
device. Now start the loading process.

z/VM Installation
Shut down the installed system with the halt command. Log in to the VM guest
as LINUX1 and proceed to IPL the installed system. If using a ZFCP disk as the
boot device, specify both the ZFCP WWPN and LUN of the boot device before
initiating the IPL. The parameter length is limited to eight characters. Longer
numbers must be separated by spaces:

SET LOADDEV PORT 50050763 00C590A9 LUN 50010000 00000000

Finally, initiate the IPL:


IPL 151 CLEAR

30 Installation and Administration


3.10.2 IBM System z: Connecting to the
Installed System
After IPLing the installed system, establish a connection with it to complete the instal-
lation. The steps involved in this vary depending on the type of connection used at the
outset.

Using VNC to Connect


A message in the 3270 terminal asks you to connect to the Linux system using a VNC
client. This message is easily missed, however, because it is mixed with kernel messages
and because the terminal process might quit before you become aware of the message.
If nothing happens for five minutes, try to initiate a connection to the Linux system
using a VNC viewer.

If connecting using a Java-capable browser, enter the complete URL, consisting of the
IP address of the installed system along with the port number, in the following fashion:

http://<IP of installed system>:5801/

Using X to Connect
When IPLing the installed system, make sure that the X server used for the first phase
of the installation is still available. YaST opens on this X server to finish the installation.

Using SSH to Connect


IMPORTANT: IBM System z: Connecting from a Linux or UNIX System

Start SSH in an xterm. Other terminal emulators lack complete support for the
text-based interface of YaST.

A message in the 3270 terminal asks you to connect to the Linux system with an SSH
client. This message is easily missed, however, because it is mixed with kernel messages
and because the terminal process might quit before you become aware of the message.

Installation with YaST 31


Once the message appears, use SSH to log in to the Linux system as root. If the con-
nection is denied or times out, wait a few minutes then try again.

When the connection is established, execute the command


/usr/lib/YaST2/startup/YaST2.ssh. yast does not suffice in this case.

YaST then starts to complete the installation of the remaining packages and create an
initial system configuration.

3.11 Configuration of the Installed


System
The system is installed now but not configured for use. No users, hardware, or services
are configured. If the installation fails in one of the step of this stage, the configuration
part restarts from the beginning. The installation itself is not repeated.

First, provide a password for the account of the system administrator (the root user).
You can then configure your Internet access and network connection. With a working
Internet connection, you can perform an update of the system as part of the installation.
You can also configure an authentication server for centralized user administration in
a local network. Finally, configure the hardware devices connected to the machine.

3.11.1 Root Password


root is the name of the superuser, the administrator of the system. Unlike regular
users, which may or may not have permission to do certain things on the system, root
has unlimited power to do anything: change the system configuration, install programs,
and set up new hardware. If users forget their passwords or have other problems with
the system, root can help. The root account should only be used for system admin-
istration, maintenance, and repair. Logging in as root for daily work is rather risky:
a single mistake could lead to irretrievable loss of many system files.

For verification purposes, the password for root must be entered twice. Do not forget
the root password. Once entered, this password cannot be retrieved.

32 Installation and Administration


SUSE Linux Enterprise can use the DES, MD5, or Blowfish encryption types for
passwords. The default encryption type is Blowfish. To change the encryption type,
click Expert Options > Encryption Type and select the new type.

3.11.2 Hostname
The hostname is the computer's name in the network. The domain name is the name of
the network. A hostname and domain are proposed by default. If your system is part
of a local network or should be accessible from the Internet, the domain name used
here must be that expected by the network or Internet. For a system in a local network,
the hostname should be unique in the network.

In many networks, the system receives its hostname over DHCP, in which case you
should not modify the name. Instead select Change Hostname via DHCP.

To be able to access your system using this hostname, select Write Hostname to
/etc/hosts. This assigns the IP address 127.0.0.2 to the name, both with and without the
domain.

To change hostname settings at any time after installation, use YaST Network Devices
> Network Card. For more information, see Section 30.4.1, “Configuring the Network
Card with YaST” (page 560).

3.11.3 Network
TIP: IBM System z: Network Configuration

For the IBM System z platforms, a working network connection is needed at


installation time to connect to the target system, the installation source, and
the YaST terminal controlling the process. The steps to set up the network are
discussed in the network configuration chapter of the Architecture-Specific In-
formation manual (Chapter 2, Preparing for Installation (↑Architecture-Specific
Information)). The IBM System z platforms only support the types of network
interfaces mentioned there (OSA Token Ring, OSA Ethernet, OSA Gigabit Eth-
ernet, OSA Express Fast Ethernet, Escon, IUCV, and OSA Express High-Speed
Token Ring). The YaST dialog simply displays the interface with its settings as
already configured. Just confirm this dialog to continue.

Installation with YaST 33


By default, Traditional Method without NetworkManager Applet is enabled. If desired,
you can also use NetworkManager to manage all your network devices. However, the
traditional method is the preferred option for server solutions. Find detailed information
about NetworkManager in Section 30.5, “Managing Network Connections with Net-
workManager” (page 578).

To configure your network connection later, select Skip Configuration and click Next.
Network hardware can also be configured after the system installation has been com-
pleted. If you skip the network device configuration, your system is left offline and is
unable to retrieve any available updates.

As well as device configuration, configure some other network settings in this step:

Firewall Configuration
When you connect to a network, a firewall is started automatically on the configured
interface. The configuration proposal for the firewall is updated automatically every
time the configuration of the interfaces or services is modified. To adapt the auto-
matic settings to your own preferences, click Change > Firewall. In the dialog that
opens, determine whether the firewall should be started. If you do not want the
firewall to be started, select the appropriate option and exit the dialog. To start and
configure the firewall, click Next for a series of dialogs similar to those described
in Section 43.4.1, “Configuring the Firewall with YaST” (page 822).

IPv6
By default the IPv6 support is enabled. To disable it, click Disable IPv6. For more
information about IPv6, see Section 30.2, “IPv6—The Next Generation Internet”
(page 550).

VNC Remote Administration


To administer your machine remotely by VNC, click Change > VNC Remote Ad-
ministration, enable remote administration, and open the port in the firewall. If you
have multiple network devices and want to select on which to open the port, click
Firewall Details and select the network device. You can also use SSH, a more secure
option, for remote administration.

Proxy
If you have a proxy server in your network to control access to the Internet, enter
the server name and all other required information to enable access to the Internet.

34 Installation and Administration


TIP: Resetting the Network Configuration to the Defaults

Reset the network settings to the original proposed values by clicking Change
> Reset to Defaults. This discards any changes made.

After configuring an Internet connection, you can test it. For this purpose, YaST estab-
lishes a connection to the SUSE Linux Enterprise server and downloads the latest release
notes. Read them at the end of the installation.

To start the test, select Yes, Test Connection to the Internet and click Next. In the next
dialog, view the progress of the test and the results. If the test fails, click Back to return
in the previous dialog and correct the configuration or skip the test. If you need more
information about the test process, click View Logs.

If you do not want to test the connection at this point, select No, Skip This Test then
Next. This also skips downloading release notes, configuring the customer center, and
updating online.

If you have multiple network interfaces in your system, verify that the the desired card
is used to connect to the Internet. To do so, click Change device.

3.11.4 Customer Center


To get technical support and product updates, first register and activate your product.
Novell Customer Center Configuration provides assistance for doing so.

If you are offline or want to skip this step, select Configure Later. This also skips SUSE
Linux Enterprise online update.

In Include for Convenience, select whether to obtain some of the necessary information
from your system. This simplifies the registration process. To keep your installation
sources valid, select Regularly Synchronize with Customer Center. This option checks
your installation sources and adds new available sources or removes obsolete sources.
It does not touch manually added sources. Additionally, it resends your hardware infor-
mation if Hardware Information is activated, which can make new hardware-specific
sources available. To see what is required to register your system or what happens with
your data, use Details.

Installation with YaST 35


TIP: Technical Support

Find more information about the technical support at http://www.novell


.com/support/products/linuxenterpriseserver/.

3.11.5 Online Update


If the Novell Customer Center has not been configured, the next step is the user confi-
guration. See Section 3.11.7, “Users” (page 38). For detailed instructions for to perform
an online update after the installation, see Section 8.3.5, “YaST Online Update”
(page 136) .

If YaST was able to connect to the SUSE Linux Enterprise servers, select whether to
perform a YaST online update. If there are any patched packages available on the
servers, download and install them now to fix known bugs or security issues.

3.11.6 Services
After testing the Internet connection and downloading the first updates, a dialog opens
in which to enable and configure two important network services. See Figure 3.6,
“Proposed Setup for Network Services” (page 37).

36 Installation and Administration


Figure 3.6 Proposed Setup for Network Services

CA Management
The purpose of a CA (certificate authority) is to guarantee a trust relationship among
all network services communicating with each other. Without a CA, you can secure
server communications with SSL and TLS separately for each individual service.
By default, a CA is created and enabled during the installation. Find details about
the creation of a CA with YaST in Chapter 42, Managing X.509 Certification
(page 801).

OpenLDAP Server
You can run an LDAP service on your host to have a central facility manage a
range of configuration files. Typically, an LDAP server handles user account data,
but with SUSE Linux Enterprise it can also be used for mail, DHCP, and DNS data.
By default, an LDAP server is set up during the installation. If you decide against
the use of an LDAP server, the YaST mail server module does not work because
it depends on LDAP functionality. However, you can still set up a mail server on
your system with the help of the Mail Transfer Agent module. Find details about
LDAP and its configuration with YaST in Chapter 36, LDAP—A Directory Service
(page 661).

If preferred, you can skip this configuration proposal for now. After the installation is
finished, configure and start the same services with the help of YaST.

Installation with YaST 37


TIP: Resetting the Service Configuration to Defaults

Restore the defaults by clicking Change > Reset to Defaults. This discards any
changes made.

3.11.7 Users
If network access was configured successfully during the previous steps of the installa-
tion, you now have the following possibilities to manage user administration method
on your system:

Local (/etc/passwd)
Users are administered locally on the installed host. This is a suitable option for
stand-alone workstations. User data is managed by the local file /etc/passwd.
All users who are entered in this file can log in to the system even if no network
is available.

If YaST found a former version of SUSE Linux Enterprise or another system using
/etc/passwd, it offers the possibility to import local users. To do so, check
Read User Data from a Previous Installation and click Choose. In the next dialog,
select the users to import and click OK.

LDAP
Users are administered centrally on an LDAP server for all systems in the network.

NIS
Users are administered centrally on a NIS server for all systems in the network.

Windows Domain
SMB authentication is often used in mixed Linux and Windows networks.

NOTE: Content of the Authentication Menu

If you use the custom package selection and one or more authentication
methods are missing from the menu, the required packages probably are not
installed.

38 Installation and Administration


You can also add additional user accounts or change the user authentication method in
the installed system. For detailed information about user management, see Section 8.9.1,
“User Management” (page 167).

Along with the selected user administration method, you can use Kerberos authentication.
This is essential for integrating your SUSE Linux Enterprise to an Active Directory
domain, which is described in Section 37.6, “Samba Server in the Network with Active
Directory” (page 705). To use Kerberos authentication, select Set Up Kerberos Authen-
tication.

3.11.8 Clean Up
This step does not require any user interaction. The installation program launches the
SuSEconfig script to write the system configuration. Depending on the CPU and the
amount of memory, this process can take some time.

3.11.9 Release Notes


After completing the user authentication setup, YaST displays the release notes. Reading
them is advised because they contain important up-to-date information that was not
available when the manuals were printed. If you tested the Internet connection, read
the most recent version of the release notes, as fetched from SUSE Linux Enterprise's
servers. Use Miscellaneous > Release Notes to view the release notes after installation.

3.11.10 Hardware Configuration


At the end of the installation, YaST opens a dialog for the configuration of the graphics
card and other hardware components connected to the system. Click the individual
components to start the hardware configuration. For the most part, YaST detects and
configures the devices automatically.

TIP: IBM System z: Hardware Configuration

On the IBM System z, there is no display that would be supported by XFree.


Accordingly, you do not find a Graphics Cards entry on these systems.

Installation with YaST 39


You can skip any peripheral devices and configure them later, as described in Section 8.4,
“Hardware” (page 141). To skip the configuration, select Skip Configuration and click
Next.

However, you should configure the graphics card right away. Although the display
settings as configured by YaST should be generally acceptable, most users have very
strong preferences as far as resolution, color depth, and other graphics features are
concerned. To change these settings, select the respective item and set the values as
desired. To test your new configuration, click Test the Configuration.

TIP: Resetting Hardware Configuration to Defaults

You can cancel changes by clicking Change > Reset to Defaults. YaST then shows
the original proposal again.

3.11.11 Completing the Installation


After a successful installation, YaST shows the Installation Completed dialog. In this
dialog, select whether to clone your newly installed system for AutoYaST. To clone
your system, select Clone This System for AutoYaST. The profile of the current system
is stored in /root/autoyast.xml. Cloning is selected by default.

AutoYaST is a system for installing one or more SUSE Linux Enterprise systems auto-
matically without user intervention. AutoYaST installations are performed using a
control file with installation and configuration data. For detailed information, refer to
Chapter 5, Automated Installation (page 81). Finish the installation of SUSE Linux
Enterprise with Finish in the final dialog.

40 Installation and Administration


3.12 Graphical Login
TIP: IBM System z: No Graphical Login

The graphical login is not available on IBM System z platforms.

SUSE Linux Enterprise is now installed. Unless you enabled the automatic login function
or customized the default runlevel, you should see the graphical login on your screen
in which to enter a username and password to log in to the system. If automatic login
is activated, the desktop starts automatically.

Installation with YaST 41


Remote Installation
SUSE Linux Enterprise® can be installed in several different ways. As well as the
4
usual CD or DVD installation covered in Chapter 3, Installation with YaST (page 17),
you can choose from various network-based approaches or even take a completely
hands-off approach to the installation of SUSE Linux Enterprise.

Each method is introduced by means of two short check lists: one listing the prerequisites
for this method and the other illustrating the basic procedure. More detail is then pro-
vided for all the techniques used in these installation scenarios.

NOTE

In the following sections, the system to hold your new SUSE Linux Enterprise
installation is referred to as target system or installation target. The term instal-
lation source is used for all sources of installation data. This includes physical
media, such as CD and DVD, and network servers distributing the installation
data in your network.

4.1 Installation Scenarios for Remote


Installation
This section introduces the most common installation scenarios for remote installations.
For each scenario, carefully check the list of prerequisites and follow the procedure
outlined for this scenario. If in need of detailed instructions for a particular step, follow
the links provided for each one of them.

Remote Installation 43
IMPORTANT

The configuration of the X Window System is not part of any remote installation
process. After the installation has finished, log in to the target system as root,
enter telinit 3, and start SaX2 to configure the graphics hardware.

4.1.1 Simple Remote Installation via


VNC—Static Network Configuration
This type of installation still requires some degree of physical access to the target system
to boot for installation. The installation itself is entirely controlled by a remote worksta-
tion using VNC to connect to the installation program. User interaction is required as
with the manual installation in Chapter 3, Installation with YaST (page 17).

For this type of installation, make sure that the following requirements are met:

• Remote installation source: NFS, HTTP, FTP, or SMB with working network
connection

• Target system with working network connection

• Controlling system with working network connection and VNC viewer software
or Java-enabled browser (Firefox, Konqueror, Internet Explorer, or Opera)

• Physical boot medium (CD or DVD) for booting the target system

• Valid static IP addresses already assigned to the installation source and the control-
ling system

• Valid static IP address to assign to the target system

To perform this kind of installation, proceed as follows:

1 Set up the installation source as described in Section 4.2, “Setting Up the Server
Holding the Installation Sources” (page 52). Choose an NFS, HTTP, or FTP
network server. For an SMB installation source, refer to Section 4.2.5, “Managing
an SMB Installation Source” (page 60).

44 Installation and Administration


2 Boot the target system using the first CD or DVD of the SUSE Linux Enterprise
media kit.

3 When the boot screen of the target system appears, use the boot options prompt
to set the appropriate VNC options and the address of the installation source.
This is described in detail in Section 4.4, “Booting the Target System for Instal-
lation” (page 72).

The target system boots to a text-based environment, giving the network address
and display number under which the graphical installation environment can be
addressed by any VNC viewer application or browser. VNC installations announce
themselves over OpenSLP and can be found using Konqueror in service:/
or slp:/ mode.

4 On the controlling workstation, open a VNC viewing application or Web


browser and connect to the target system as described in Section 4.5.1, “VNC
Installation” (page 77).

5 Perform the installation as described in Chapter 3, Installation with YaST


(page 17). Reconnect to the target system after it reboots for the final part of the
installation.

6 Finish the installation.

4.1.2 Simple Remote Installation via


VNC—Dynamic Network Configuration
This type of installation still requires some degree of physical access to the target system
to boot for installation. The network configuration is made with DHCP. The installation
itself is entirely controlled from a remote workstation using VNC to connect to the in-
staller, but still requires user interaction for the actual configuration efforts.

For this type of installation, make sure that the following requirements are met:

• Remote installation source: NFS, HTTP, FTP, or SMB with working network
connection

• Target system with working network connection

Remote Installation 45
• Controlling system with working network connection and VNC viewer software
or Java-enabled browser (Firefox, Konqueror, Internet Explorer, or Opera)

• Physical boot medium (CD, DVD, or custom boot disk) for booting the target system

• Running DHCP server providing IP addresses

To perform this kind of installation, proceed as follows:

1 Set up the installation source as described in Section 4.2, “Setting Up the Server
Holding the Installation Sources” (page 52). Choose an NFS, HTTP, or FTP
network server. For an SMB installation source, refer to Section 4.2.5, “Managing
an SMB Installation Source” (page 60).

2 Boot the target system using the first CD or DVD of the SUSE Linux Enterprise
media kit.

3 When the boot screen of the target system appears, use the boot options prompt
to set the appropriate VNC options and the address of the installation source.
This is described in detail in Section 4.4, “Booting the Target System for Instal-
lation” (page 72).

The target system boots to a text-based environment, giving the network address
and display number under which the graphical installation environment can be
addressed by any VNC viewer application or browser. VNC installations announce
themselves over OpenSLP and can be found using Konqueror in service:/
or slp:/ mode.

4 On the controlling workstation, open a VNC viewing application or Web


browser and connect to the target system as described in Section 4.5.1, “VNC
Installation” (page 77).

5 Perform the installation as described in Chapter 3, Installation with YaST


(page 17). Reconnect to the target system after it reboots for the final part of the
installation.

6 Finish the installation.

46 Installation and Administration


4.1.3 Remote Installation via VNC—PXE
Boot and Wake on LAN
This type of installation is completely hands-off. The target machine is started and
booted remotely. User interaction is only needed for the actual installation. This approach
is suitable for cross-site deployments.

To perform this type of installation, make sure that the following requirements are met:

• Remote installation source: NFS, HTTP, FTP, or SMB with working network
connection

• TFTP server

• Running DHCP server for your network

• Target system capable of PXE boot, networking, and Wake on LAN, plugged in
and connected to the network

• Controlling system with working network connection and VNC viewer software
or Java-enabled browser (Firefox, Konqueror, Internet Explorer, or Opera)

To perform this type of installation, proceed as follows:

1 Set up the installation source as described in Section 4.2, “Setting Up the Server
Holding the Installation Sources” (page 52). Choose an NFS, HTTP, or FTP
network server or configure an SMB installation source as described in Sec-
tion 4.2.5, “Managing an SMB Installation Source” (page 60).

2 Set up a TFTP server to hold a boot image that can be pulled by the target system.
This is described in Section 4.3.2, “Setting Up a TFTP Server” (page 64).

3 Set up a DHCP server to provide IP addresses to all machines and reveal the lo-
cation of the TFTP server to the target system. This is described in Section 4.3.1,
“Setting Up a DHCP Server” (page 62).

4 Prepare the target system for PXE boot. This is described in further detail in
Section 4.3.5, “Preparing the Target System for PXE Boot” (page 71).

Remote Installation 47
5 Initiate the boot process of the target system using Wake on LAN. This is de-
scribed in Section 4.3.7, “Wake on LAN” (page 71).

6 On the controlling workstation, open a VNC viewing application or Web


browser and connect to the target system as described in Section 4.5.1, “VNC
Installation” (page 77).

7 Perform the installation as described in Chapter 3, Installation with YaST


(page 17). Reconnect to the target system after it reboots for the final part of the
installation.

8 Finish the installation.

4.1.4 Simple Remote Installation via


SSH—Static Network Configuration
This type of installation still requires some degree of physical access to the target system
to boot for installation and to determine the IP address of the installation target. The
installation itself is entirely controlled from a remote workstation using SSH to connect
to the installer. User interaction is required as with the regular installation described in
Chapter 3, Installation with YaST (page 17).

For this type of installation, make sure that the following requirements are met:

• Remote installation source: NFS, HTTP, FTP, or SMB with working network
connection

• Target system with working network connection

• Controlling system with working network connection and working SSH client
software

• Physical boot medium (CD, DVD, or custom boot disk) for the target system

• Valid static IP addresses already assigned to the installation source and the control-
ling system

• Valid static IP address to assign to the target system

48 Installation and Administration


To perform this kind of installation, proceed as follows:

1 Set up the installation source as described in Section 4.2, “Setting Up the Server
Holding the Installation Sources” (page 52). Choose an NFS, HTTP, or FTP
network server. For an SMB installation source, refer to Section 4.2.5, “Managing
an SMB Installation Source” (page 60).

2 Boot the target system using the first CD or DVD of the SUSE Linux Enterprise
media kit.

3 When the boot screen of the target system appears, use the boot options prompt
to set the appropriate parameters for network connection, address of the installa-
tion source, and SSH enablement. This is described in detail in Section 4.4.3,
“Using Custom Boot Options” (page 74).

The target system boots to a text-based environment, giving the network address
under which the graphical installation environment can be addressed by any SSH
client.

4 On the controlling workstation, open a terminal window and connect to the target
system as described in Section “Connecting to the Installation Program”
(page 79).

5 Perform the installation as described in Chapter 3, Installation with YaST


(page 17). Reconnect to the target system after it reboots for the final part of the
installation.

6 Finish the installation.

4.1.5 Simple Remote Installation via


SSH—Dynamic Network Configuration
This type of installation still requires some degree of physical access to the target system
to boot for installation and determine the IP address of the installation target. The instal-
lation itself is entirely controlled from a remote workstation using VNC to connect to
the installer, but still requires user interaction for the actual configuration efforts.

Remote Installation 49
For this type of installation, make sure that the following requirements are met:

• Remote installation source: NFS, HTTP, FTP, or SMB with working network
connection

• Target system with working network connection

• Controlling system with working network connection and working SSH client
software

• Physical boot medium (CD or DVD) for booting the target system

• Running DHCP server providing IP addresses

To perform this kind of installation, proceed as follows:

1 Set up the installation source as described in Section 4.2, “Setting Up the Server
Holding the Installation Sources” (page 52). Choose an NFS, HTTP, or FTP
network server. For an SMB installation source, refer to Section 4.2.5, “Managing
an SMB Installation Source” (page 60).

2 Boot the target system using the first CD or DVD of the SUSE Linux Enterprise
media kit.

3 When the boot screen of the target system appears, use the boot options prompt
to pass the appropriate parameters for network connection, location of the instal-
lation source, and SSH enablement. See Section 4.4.3, “Using Custom Boot
Options” (page 74) for detailed instructions on the use of these parameters.

The target system boots to a text-based environment, giving you the network
address under which the graphical installation environment can be addressed by
any SSH client.

4 On the controlling workstation, open a terminal window and connect to the target
system as described in Section “Connecting to the Installation Program”
(page 79).

5 Perform the installation as described in Chapter 3, Installation with YaST


(page 17). Reconnect to the target system after it reboots for the final part of the
installation.

6 Finish the installation.

50 Installation and Administration


4.1.6 Remote Installation via SSH—PXE Boot
and Wake on LAN
This type of installation is completely hands-off. The target machine is started and
booted remotely.

To perform this type of installation, make sure that the following requirements are met:

• Remote installation source: NFS, HTTP, FTP, or SMB with working network
connection

• TFTP server

• Running DHCP server for your network, providing a static IP to the host to install

• Target system capable of PXE boot, networking, and Wake on LAN, plugged in
and connected to the network

• Controlling system with working network connection and SSH client software

To perform this type of installation, proceed as follows:

1 Set up the installation source as described in Section 4.2, “Setting Up the Server
Holding the Installation Sources” (page 52). Choose an NFS, HTTP, or FTP
network server. For the configuration of an SMB installation source, refer to
Section 4.2.5, “Managing an SMB Installation Source” (page 60).

2 Set up a TFTP server to hold a boot image that can be pulled by the target system.
This is described in Section 4.3.2, “Setting Up a TFTP Server” (page 64).

3 Set up a DHCP server to provide IP addresses to all machines and reveal the lo-
cation of the TFTP server to the target system. This is described in Section 4.3.1,
“Setting Up a DHCP Server” (page 62).

4 Prepare the target system for PXE boot. This is described in further detail in
Section 4.3.5, “Preparing the Target System for PXE Boot” (page 71).

5 Initiate the boot process of the target system using Wake on LAN. This is de-
scribed in Section 4.3.7, “Wake on LAN” (page 71).

Remote Installation 51
6 On the controlling workstation, start an SSH client and connect to the target
system as described in Section 4.5.2, “SSH Installation” (page 79).

7 Perform the installation as described in Chapter 3, Installation with YaST


(page 17). Reconnect to the target system after it reboots for the final part of the
installation.

8 Finish the installation.

4.2 Setting Up the Server Holding the


Installation Sources
Depending on the operating system running on the machine to use as network installation
source for SUSE Linux Enterprise, there are several options for the server configuration.
The easiest way to set up an installation server is to use YaST on SUSE Linux Enterprise
Server 9 or 10 orSUSE Linux 9.3 and higher. On other versions of SUSE Linux Enter-
prise Server or SUSE Linux Enterprise, set up the installation source manually.

TIP

You can even use a Microsoft Windows machine as installation server for your
Linux deployment. See Section 4.2.5, “Managing an SMB Installation Source”
(page 60) for details.

4.2.1 Setting Up an Installation Server Using


YaST
YaST offers a graphical tool for creating network installation sources. It supports HTTP,
FTP, and NFS network installation servers.

1 Log in as root to the machine that should act as installation server.

2 Start YaST > Miscellaneous > Installation Server.

52 Installation and Administration


3 Select the server type (HTTP, FTP, or NFS). The selected server service is
started automatically every time the system starts. If a service of the selected
type is already running on your system and you want to configure it manually
for the server, deactivate the automatic configuration of the server service with
Do Not Configure Any Network Services. In both cases, define the directory in
which the installation data should be made available on the server.

4 Configure the required server type. This step relates to the automatic configuration
of server services. It is skipped when automatic configuration is deactivated.

Define an alias for the root directory of the FTP or HTTP server on which the
installation data should be found. The installation source will later be located
under ftp://Server-IP/Alias/Name (FTP) or under
http://Server-IP/Alias/Name (HTTP). Name stands for the name of
the installation source, which is defined in the following step. If you selected
NFS in the previous step, define wild cards and export options. The NFS server
will be accessible under nfs://Server-IP/Name. Details of NFS and exports
can be found in Chapter 38, Sharing File Systems with NFS (page 711).

TIP: Firewall Settings

Make sure that the firewall settings of your server system allow traffic
on the ports for HTTP, NFS, and FTP. If they currently do not, start the
YaST firewall module and open the respective ports.

5 Configure the installation source. Before the installation media are copied to their
destination, define the name of the installation source (ideally, an easily remem-
bered abbreviation of the product and version). YaST allows providing ISO im-
ages of the media instead of copies of the installation CDs. If you want this, acti-
vate the relevant check box and specify the directory path under which the ISO
files can be found locally. Depending on the product to distribute using this in-
stallation server, it might be that more add-on CDs or service pack CDs are re-
quired and should be added as extra installation sources. To announce your in-
stallation server in the network via OpenSLP, activate the appropriate option.

Remote Installation 53
TIP

Consider announcing your installation source via OpenSLP if your network


setup supports this option. This saves you from entering the network in-
stallation path on every target machine. The target systems are just
booted using the SLP boot option and find the network installation source
without any further configuration. For details on this option, refer to
Section 4.4, “Booting the Target System for Installation” (page 72).

6 Upload the installation data. The most lengthy step in configuring an installation
server is copying the actual installation CDs. Insert the media in the sequence
requested by YaST and wait for the copying procedure to end. When the sources
have been fully copied, return to the overview of existing information sources
and close the configuration by selecting Finish.

Your installation server is now fully configured and ready for service. It is auto-
matically started every time the system is started. No further intervention is re-
quired. You only need to configure and start this service correctly by hand if you
have deactivated the automatic configuration of the selected network service
with YaST as an initial step.

To deactivate an installation source, select the installation source to remove then select
Delete. The installation data are removed from the system. To deactivate the network
service, use the respective YaST module.

If your installation server should provide the installation data for more than one product
of product version, start the YaST installation server module and select Add in the
overview of existing installation sources to configure the new installation source.

4.2.2 Setting Up an NFS Installation Source


Manually
Setting up an NFS source for installation is basically done in two steps. In the first step,
create the directory structure holding the installation data and copy the installation
media over to this structure. Second, export the directory holding the installation data
to the network.

54 Installation and Administration


To create a directory holding the installation data, proceed as follows:

1 Log in as root.

2 Create a directory that should later hold all installation data and change into this
directory. For example:
mkdir install/product/productversion
cd install/product/productversion

Replace product with an abbreviation of the product name and


productversion with a string that contains the product name and version.

3 For each CD contained in the media kit execute the following commands:

3a Copy the entire content of the installation CD into the installation server di-
rectory:
cp -a /media/path_to_your_CD-ROM_drive .

Replace path_to_your_CD-ROM_drive with the actual path under


which your CD or DVD drive is addressed. Depending on the type of drive
used in your system, this can be cdrom, cdrecorder, dvd, or
dvdrecorder.

3b Rename the directory to the CD number:


mv path_to_your_CD-ROM_drive CDx

Replace x with the actual number of your CD.

On SUSE Linux Enterprise Server, you can export the installation sources with NFS
using YaST. Proceed as follows:

1 Log in as root.

2 Start YaST > Network Services > NFS Server.

3 Select Start and Open Port in Firewall and click Next.

4 Select Add Directory and browse for the directory containing the installation
sources, in this case, productversion.

Remote Installation 55
5 Select Add Host and enter the hostnames of the machines to which to export the
installation data. Instead of specifying hostnames here, you could also use wild
cards, ranges of network addresses, or just the domain name of your network.
Enter the appropriate export options or leave the default, which works fine in
most setups. For more information about the syntax used in exporting NFS shares,
read the exports man page.

6 Click Finish. The NFS server holding the SUSE Linux Enterprise installation
sources is automatically started and integrated into the boot process.

If you prefer manually exporting the installation sources via NFS instead of using the
YaST NFS Server module, proceed as follows:

1 Log in as root.

2 Open the file /etc/exports and enter the following line:


/productversion *(ro,root_squash,sync)

This exports the directory /productversion to any host that is part of this
network or to any host that can connect to this server. To limit the access to this
server, use netmasks or domain names instead of the general wild card *. Refer
to the export man page for details. Save and exit this configuration file.

3 To add the NFS service to the list of servers started during system boot, execute
the following commands:
insserv /etc/init.d/nfsserver
insserv /etc/init.d/portmap

4 Start the NFS server with rcnfsserver start. If you need to change the
configuration of your NFS server later, modify the configuration file and restart
the NFS daemon with rcnfsserver restart.

Announcing the NFS server via OpenSLP makes its address known to all clients in
your network.

1 Log in as root.

2 Enter the directory /etc/slp.reg.d/.

56 Installation and Administration


3 Create a configuration file called install.suse.nfs.reg containing the
following lines:

# Register the NFS Installation Server


service:install.suse:nfs://$HOSTNAME/path_to_instsource/CD1,en,65535
description=NFS Installation Source

Replace path_to_instsource with the actual path to the installation source


on your server.

4 Save this configuration file and start the OpenSLP daemon with rcslpd start.

For more information about OpenSLP, refer to the package documentation located under
/usr/share/doc/packages/openslp/ or refer to Chapter 31, SLP Services
in the Network (page 599).

4.2.3 Setting Up an FTP Installation Source


Manually
Creating an FTP installation source is very similar to creating an NFS installation source.
FTP installation sources can be announced over the network using OpenSLP as well.

1 Create a directory holding the installation sources as described in Section 4.2.2,


“Setting Up an NFS Installation Source Manually” (page 54).

2 Configure the FTP server to distribute the contents of your installation directory:

2a Log in as root and install the package vsftpd using the YaST package
manager.

2b Enter the FTP server root directory:


cd /srv/ftp

2c Create a subdirectory holding the installation sources in the FTP root direc-
tory:
mkdir instsource

Replace instsource with the product name.

Remote Installation 57
2d Mount the contents of the installation repository into the change root envi-
ronment of the FTP server:
mount --bind path_to_instsource /srv/ftp/instsource

Replace path_to_instsource and instsource with values matching


your setup. If you need to make this permanent, add it to /etc/fstab.

2e Start vsftpd with vsftpd.

3 Announce the installation source via OpenSLP, if this is supported by your net-
work setup:

3a Create a configuration file called install.suse.ftp.reg under /etc/


slp/reg.d/ that contains the following lines:

# Register the FTP Installation Server


service:install.suse:ftp://$HOSTNAME/srv/ftp/instsource/CD1,en,65535
description=FTP Installation Source

Replace instsource with the actual name to the installation source direc-
tory on your server. The service: line should be entered as one continuous
line.

3b Save this configuration file and start the OpenSLP daemon with rcslpd
start.

4.2.4 Setting Up an HTTP Installation Source


Manually
Creating an HTTP installation source is very similar to creating an NFS installation
source. HTTP installation sources can be announced over the network using OpenSLP
as well.

1 Create a directory holding the installation sources as described in Section 4.2.2,


“Setting Up an NFS Installation Source Manually” (page 54).

58 Installation and Administration


2 Configure the HTTP server to distribute the contents of your installation directory:

2a Install the Web server Apache as described in Section 40.1.2, “Installation”


(page 738).

2b Enter the root directory of the HTTP server (/srv/www/htdocs) and


create a subdirectory that will hold the installation sources:
mkdir instsource

Replace instsource with the product name.

2c Create a symbolic link from the location of the installation sources to the
root directory of the Web server (/srv/www/htdocs):
ln -s /path_instsource /srv/www/htdocs/instsource

2d Modify the configuration file of the HTTP server (/etc/apache2/


default-server.conf) to make it follow symbolic links. Replace the
following line:
Options None

with
Options Indexes FollowSymLinks

2e Reload the HTTP server configuration using rcapache2 reload.

3 Announce the installation source via OpenSLP, if this is supported by your net-
work setup:

3a Create a configuration file called install.suse.http.reg under


/etc/slp/reg.d/ that contains the following lines:

# Register the HTTP Installation Server


service:install.suse:http://$HOSTNAME/srv/www/htdocs/instsource/CD1/,en,65535
description=HTTP Installation Source

Replace instsource with the actual path to the installation source on


your server. The service: line should be entered as one continuous line.

Remote Installation 59
3b Save this configuration file and start the OpenSLP daemon using rcslpd
restart.

4.2.5 Managing an SMB Installation Source


Using SMB, you can import the installation sources from a Microsoft Windows server
and start your Linux deployment even with no Linux machine around.

To set up an exported Windows Share holding your SUSE Linux Enterprise installation
sources, proceed as follows:

1 Log in to your Windows machine.

2 Start Explorer and create a new folder that will hold the entire installation tree
and name it INSTALL, for example.

3 Export this share according the procedure outlined in your Windows documenta-
tion.

4 Enter this share and create a subfolder, called product. Replace product
with the actual product name.

5 Enter the INSTALL/product folder and copy each CD or DVD to a separate


folder, such as CD1 and CD2.

To use a SMB mounted share as installation source, proceed as follows:

1 Boot the installation target.

2 Select Installation.

3 Press F4 for a selection of installation sources.

4 Choose SMB and enter the Windows machine's name or IP address, the share
name (INSTALL/product/CD1, in this example), username, and password.

After you hit Enter, YaST starts and you can perform the installation.

60 Installation and Administration


4.2.6 Using ISO Images of the Installation
Media on the Server
Instead of copying physical media into your server directory manually, you can also
mount the ISO images of the installation media into your installation server and use
them as installation source. To set up an HTTP, NFS or FTP server that uses ISO images
instead of media copies, proceed as follows:

1 Download the ISO images and save them to the machine to use as the installation
server.

2 Log in as root.

3 Choose and create an appropriate location for the installation data, as described
in Section 4.2.2, “Setting Up an NFS Installation Source Manually” (page 54),
Section 4.2.3, “Setting Up an FTP Installation Source Manually” (page 57), or
Section 4.2.4, “Setting Up an HTTP Installation Source Manually” (page 58).

4 Create subdirectories for each CD or DVD.

5 To mount and unpack each ISO image to the final location, issue the following
command:

mount -o loop path_to_iso path_to_instsource/product/mediumx

Replace path_to_iso with the path to your local copy of the ISO image,
path_to_instsource with the source directory of your server, product
with the product name, and mediumx with the type (CD or DVD) and number
of media you are using.

6 Repeat the previous step to mount all ISO images needed for your product.

7 Start your installation server as usual, as described in Section 4.2.2, “Setting Up


an NFS Installation Source Manually” (page 54), Section 4.2.3, “Setting Up an
FTP Installation Source Manually” (page 57), or Section 4.2.4, “Setting Up an
HTTP Installation Source Manually” (page 58).

Remote Installation 61
4.3 Preparing the Boot of the Target
System
This section covers the configuration tasks needed in complex boot scenarios. It contains
ready-to-apply configuration examples for DHCP, PXE boot, TFTP, and Wake on
LAN.

4.3.1 Setting Up a DHCP Server


There are two ways to set up a DHCP server. For SUSE Linux Enterprise Server 9 and
higher, YaST provides a graphical interface to the process. Users of any other SUSE
Linux-based products and non-SUSE Linux users should manually edit the configuration
files or use the front-end provided by their operating system vendors.

Setting Up a DHCP Server with YaST


To announce the TFTP server's location to the network clients and specify the boot
image file the installation target should use, add two declarations to your DHCP server
configuration.

1 Log in as root to the machine hosting the DHCP server.

2 Start YaST > Network Services > DHCP Server.

3 Complete the setup wizard for basic DHCP server setup.

4 Select Expert Settings and select Yes when warned about leaving the start-up di-
alog.

5 In the Configured Declarations dialog, select the subnet in which the new system
should be located and click Edit.

6 In the Subnet Configuration dialog select Add to add a new option to the subnet's
configuration.

7 Select filename and enter pxelinux.0 as the value.

62 Installation and Administration


8 Add another option (next-server) and set its value to the address of the TFTP
server.

9 Select OK and Finish to complete the DHCP server configuration.

To configure DHCP to provide a static IP address to a specific host, enter the Expert
Settings of the DHCP server configuration module (Step 4 (page 62)) and add a new
declaration of the host type. Add the options hardware and fixed-address to
this host declaration and provide the appropriate values.

Setting Up a DHCP Server Manually


All the DHCP server needs to do, apart from providing automatic address allocation to
your network clients, is to announce the IP address of the TFTP server and the file that
should be pulled in by the installation routines on the target machine.

1 Log in as root to the machine hosting the DHCP server.

2 Append the following lines to your DHCP server's configuration file located
under /etc/dhcpd.conf:

group {
# PXE related stuff
#
# "next server" defines the tftp server that will be used
next server ip_tftp_server:
#
# "filename" specifies the pxelinux image on the tftp server
# the server runs in chroot under /srv/tftpboot
filename "pxelinux.0";
}

Replace ip_of_the_tftp_server with the actual IP address of the TFTP


server. For more information about the options available in dhcpd.conf, refer
to the dhcpd.conf manual page.

3 Restart the DHCP server by executing rcdhcpd restart.

If you plan on using SSH for the remote control of a PXE and Wake on LAN installation,
explicitly specify the IP address DHCP should provide to the installation target. To
achieve this, modify the above-mentioned DHCP configuration according to the follow-
ing example:

Remote Installation 63
group {
# PXE related stuff
#
# "next server" defines the tftp server that will be used
next server ip_tftp_server:
#
# "filename" specifies the pxelinux image on the tftp server
# the server runs in chroot under /srv/tftpboot
filename "pxelinux.0";
host test { hardware ethernet mac_address;
fixed-address some_ip_address; }
}

The host statement introduces the hostname of the installation target. To bind the
hostname and IP address to a specific host, you must know and specify the system's
hardware (MAC) address. Replace all the variables used in this example with the actual
values that match your environment.

After restarting the DHCP server, it provides a static IP to the host specified, enabling
you to connect to the system via SSH.

4.3.2 Setting Up a TFTP Server


Set up a TFTP server with YaST on SUSE Linux Enterprise Server and SUSE Linux
Enterprise or set it up manually on any other Linux operating system that supports
xinetd and tftp. The TFTP server delivers the boot image to the target system once it
boots and sends a request for it.

Setting Up a TFTP Server Using YaST


1 Log in as root.

2 Start YaST > Network Services > TFTP Server and install the requested package.

3 Click Enable to make sure that the server is started and included in the boot
routines. No further action from your side is required to secure this. xinetd starts
tftpd at boot time.

4 Click Open Port in Firewall to open the appropriate port in the firewall running
on your machine. If there is no firewall running on your server, this option is not
available.

64 Installation and Administration


5 Click Browse to browse for the boot image directory. The default directory
/tftpboot is created and selected automatically.

6 Click Finish to apply your settings and start the server.

Setting Up a TFTP Server Manually


1 Log in as root and install the packages tftp and xinetd.

2 If unavailable, create /srv/tftpboot and /srv/tftpboot/pxelinux


.cfg directories.

3 Add the appropriate files needed for the boot image as described in Section 4.3.3,
“Using PXE Boot” (page 66).

4 Modify the configuration of xinetd located under /etc/xinetd.d/ to make


sure that the TFTP server is started on boot:

4a If it does not exist, create a file called tftp under this directory with touch
tftp. Then run chmod 755 tftp.

4b Open the file tftp and add the following lines:

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /srv/tftpboot
disable = no
}

4c Save the file and restart xinetd with rcxinetd restart.

Remote Installation 65
4.3.3 Using PXE Boot
Some technical background information as well as PXE's complete specifications are
available in the Preboot Execution Environment (PXE) Specification (http://www
.pix.net/software/pxeboot/archive/pxespec.pdf).

1 Change to the directory of your installation repository and copy the linux,
initrd, message, and memtest files to the /srv/tftpboot directory
by entering the following:

cp -a boot/loader/linux boot/loader/initrd
boot/loader/message boot/loader/memtest /srv/tftpboot

2 Install the syslinux package directly from your installation CDs or DVDs
with YaST.

3 Copy the /usr/share/syslinux/pxelinux.0 file to the /srv/


tftpboot directory by entering the following:
cp -a /usr/share/syslinux/pxelinux.0 /srv/tftpboot

4 Change to the directory of your installation repository and copy the isolinux
.cfg file to /srv/tftpboot/pxelinux.cfg/default by entering the
following:

cp -a boot/loader/isolinux.cfg /srv/tftpboot/pxelinux.cfg/default

5 Edit the /srv/tftpboot/pxelinux.cfg/default file and remove the


lines beginning with gfxboot, readinfo, and framebuffer.

6 Insert the following entries in the append lines of the default failsafe and
apic labels:

insmod=kernel module
By means of this entry, enter the network kernel module needed to support
network installation on the PXE client. Replace kernel module with the
appropriate module name for your network device.

66 Installation and Administration


netdevice=interface
This entry defines the client's network interface that must be used for the
network installation. It is only necessary if the client is equipped with several
network cards and must be adapted accordingly. In case of a single network
card, this entry can be omitted.

install=nfs://ip_instserver/path_instsource/CD1
This entry defines the NFS server and the installation source for the client
installation. Replace ip_instserver with the actual IP address of your
installation server. path_instsource should be replaced with the actual
path to the installation sources. HTTP, FTP, or SMB sources are addressed
in a similar manner, except for the protocol prefix, which should read http,
ftp, or smb.

IMPORTANT

If you need to pass other boot options to the installation routines,


such as SSH or VNC boot parameters, append them to the install
entry. An overview of parameters and some examples are given in
Section 4.4, “Booting the Target System for Installation” (page 72).

An example /srv/tftpboot/pxelinux.cfg/default file follows.


Adjust the protocol prefix for the installation source to match your network setup
and specify your preferred method of connecting to the installer by adding the
vnc and vncpassword or the usessh and sshpassword options to the
install entry. The lines separated by \ must be entered as one continuous
line without a line break and without the \.

default linux

# default
label linux
kernel linux
append initrd=initrd ramdisk_size=65536 insmod=e100 \
install=nfs://ip_instserver/path_instsource/product/CD1

# failsafe
label failsafe
kernel linux
append initrd=initrd ramdisk_size=65536 ide=nodma apm=off acpi=off \
insmod=e100 install=nfs://ip_instserver/path_instsource/product/CD1

# apic

Remote Installation 67
label apic
kernel linux
append initrd=initrd ramdisk_size=65536 apic insmod=e100 \
install=nfs://ip_instserver/path_instsource/product/CD1

# manual
label manual
kernel linux
append initrd=initrd ramdisk_size=65536 manual=1

# rescue
label rescue
kernel linux
append initrd=initrd ramdisk_size=65536 rescue=1

# memory test
label memtest
kernel memtest

# hard disk
label harddisk
kernel
linux append SLX=0x202

implicit 0
display message
prompt 1
timeout 100

Replace ip_instserver and path_instsource with the values used in


your setup.

The following section serves as a short reference to the PXELINUX options used
in this setup. Find more information about the options available in the documen-
tation of the syslinux package located under /usr/share/doc/
packages/syslinux/.

4.3.4 PXELINUX Configuration Options


The options listed here are a subset of all the options available for the PXELINUX
configuration file.

DEFAULT kernel options...


Sets the default kernel command line. If PXELINUX boots automatically, it acts
as if the entries after DEFAULT had been typed in at the boot prompt, except the
auto option is automatically added, indicating an automatic boot.

68 Installation and Administration


If no configuration file is present or no DEFAULT entry is present in the configu-
ration file, the default is the kernel name “linux” with no options.

APPEND options...
Add one or more options to the kernel command line. These are added for both
automatic and manual boots. The options are added at the very beginning of the
kernel command line, usually permitting explicitly entered kernel options to override
them.

LABEL label KERNEL image APPEND options...


Indicates that if label is entered as the kernel to boot, PXELINUX should instead
boot image and the specified APPEND options should be used instead of the ones
specified in the global section of the file (before the first LABEL command). The
default for image is the same as label and, if no APPEND is given, the default
is to use the global entry (if any). Up to 128 LABEL entries are permitted.

Note that GRUB uses the following syntax:

title mytitle
kernel my_kernel my_kernel_options
initrd myinitrd

PXELINUX uses the following syntax:

label mylabel
kernel mykernel
append myoptions

Labels are mangled as if they were filenames and they must be unique after man-
gling. For example, the two labels “v2.1.30” and “v2.1.31” would not be distin-
guishable under PXELINUX because both mangle to the same DOS filename.

The kernel does not have to be a Linux kernel; it can be a boot sector or a COM-
BOOT file.

APPEND -
Append nothing. APPEND with a single hyphen as argument in a LABEL section
can be used to override a global APPEND.

Remote Installation 69
LOCALBOOT type
On PXELINUX, specifying LOCALBOOT 0 instead of a KERNEL option means
invoking this particular label and causes a local disk boot instead of a kernel boot.

Argument Description

0 Perform a normal boot

4 Perform a local boot with the Universal


Network Driver Interface (UNDI) driver still
resident in memory

5 Perform a local boot with the entire PXE


stack, including the UNDI driver, still resi-
dent in memory

All other values are undefined. If you do not know what the UNDI or PXE stacks
are, specify 0.

TIMEOUT time-out
Indicates how long to wait at the boot prompt until booting automatically, in units
of 1/10 second. The time-out is canceled as soon as the user types anything on the
keyboard, assuming the user will complete the command begun. A time-out of zero
disables the time-out completely (this is also the default). The maximum possible
time-out value is 35996 (just less than one hour).

PROMPT flag_val
If flag_val is 0, displays the boot prompt only if Shift or Alt is pressed or Caps
Lock or Scroll Lock is set (this is the default). If flag_val is 1, always displays
the boot prompt.

F2 filename
F1 filename
..etc...
F9 filename
F10 filename

Displays the indicated file on the screen when a function key is pressed at the boot
prompt. This can be used to implement preboot online help (presumably for the
kernel command line options). For backward compatibility with earlier releases,

70 Installation and Administration


F10 can be also entered as F0. Note that there is currently no way to bind filenames
to F11 and F12.

4.3.5 Preparing the Target System for PXE


Boot
Prepare the system's BIOS for PXE boot by including the PXE option in the BIOS boot
order.

WARNING: BIOS Boot Order

Do not place the PXE option ahead of the hard disk boot option in the BIOS.
Otherwise this system would try to reinstall itself every time you boot it.

4.3.6 Preparing the Target System for Wake


on LAN
Wake on LAN (WOL) requires the appropriate BIOS option to be enabled prior to the
installation. Also, note down the MAC address of the target system. This data is needed
to initiate Wake on LAN.

4.3.7 Wake on LAN


Wake on LAN allows a machine to be turned on by a special network packet containing
the machine's MAC address. Because every machine in the world has a unique MAC
identifier, you do not need to worry about accidentally turning on the wrong machine.

IMPORTANT: Wake on LAN across Different Network Segments

If the controlling machine is not located in the same network segment as the
installation target that should be awakened, either configure the WOL requests
to be sent as multicasts or remotely control a machine on that network segment
to act as the sender of these requests.

Remote Installation 71
Users of SUSE Linux Enterprise Server 9 and higher can use a YaST module called
WOL to easily configure Wake on LAN. Users of other versions of SUSE Linux-based
operating systems can use a command line tool.

4.3.8 Wake on LAN with YaST


1 Log in as root.

2 Start YaST > Network Services > WOL.

3 Click Add and enter the hostname and MAC address of the target system.

4 To turn on this machine, select the appropriate entry and click Wake up.

4.3.9 Manual Wake on LAN


1 Log in as root.

2 Start YaST > Software Management and install the package netdiag.

3 Open a terminal and enter the following command as root to wake the target:

ether-wake mac_of_target

Replace mac_of_target with the actual MAC address of the target.

4.4 Booting the Target System for


Installation
Basically, there are two different ways to customize the boot process for installation
apart from those mentioned under Section 4.3.7, “Wake on LAN” (page 71) and Sec-
tion 4.3.3, “Using PXE Boot” (page 66). You can either use the default boot options
and function keys or use the boot options prompt of the installation boot screen to pass
any boot options that the installation kernel might need on this particular hardware.

72 Installation and Administration


4.4.1 Using the Default Boot Options
The boot options are described in detail in Chapter 3, Installation with YaST (page 17).
Generally, just selecting Installation starts the installation boot process.

If problems occur, use Installation—ACPI Disabled or Installation—Safe Settings. For


more information about troubleshooting the installation process, refer to Section 51.2,
“Installation Problems” (page 910).

4.4.2 Using the F Keys


The menu bar at the bottom screen offers some advanced functionality needed in some
setups. Using the F keys, you can specify additional options to pass to the installation
routines without having to know the detailed syntax of these parameters (see Sec-
tion 4.4.3, “Using Custom Boot Options” (page 74)).

See the table below for a complete set of the options available.

Table 4.1 F Keys During Installation

Key Purpose Available Options Default Value

F1 Provide help None None

F2 Select the installation All supported languages English


language

F3 Change screen resolu- • Text mode • Default value


tion for installation depends on
• VESA your graphics
hardware
• resolution #1

• resolution #2

• ...

Remote Installation 73
Key Purpose Available Options Default Value

F4 Select the installation • CD-ROM or DVD CD-ROM or DVD


source
• SLP

• FTP

• HTTP

• NFS

• SMB

• Hard Disk

F5 Apply driver update Driver None


disk

4.4.3 Using Custom Boot Options


Using the appropriate set of boot options helps facilitate your installation procedure.
Many parameters can also be configured later using the linuxrc routines, but using the
boot options is easier. In some automated setups, the boot options can be provided with
initrd or an info file.

The following table lists all installation scenarios mentioned in this chapter with the
required parameters for booting and the corresponding boot options. Just append all of
them in the order they appear in this table to get one boot option string that is handed
to the installation routines. For example (all in one line):

install=... netdevice=... hostip=...netmask=... vnc=... vncpassword=...

Replace all the values (...) in this string with the values appropriate for your setup.

74 Installation and Administration


Table 4.2 Installation (Boot) Scenarios Used in This Chapter

Installation Scenario Parameters Needed Boot Options


for Booting

Chapter 3, Installation None: system boots au- None needed


with YaST (page 17) tomatically

Section 4.1.1, “Simple • Location of the in- • install=(nfs,http,


Remote Installation via stallation server ftp,smb)://path_to
VNC—Static Network • Network device _instmedia
Configuration” (page 44) • IP address • netdevice=some
• Netmask _netdevice (only need-
• Gateway ed if several network de-
• VNC enablement vices are available)
• VNC password • hostip=some_ip
• netmask=some
_netmask
• gateway=ip_gateway
• vnc=1
• vncpassword=some
_password

Section 4.1.2, “Simple • Location of the in- • install=(nfs,http,


Remote Installation via stallation server ftp,smb)://path_to
VNC—Dynamic Net- • VNC enablement _instmedia
work Configuration” • VNC password • vnc=1
(page 45) • vncpassword=some
_password

Section 4.1.3, “Remote • Location of the in- Not applicable; process man-
Installation via stallation server aged through PXE and DHCP
VNC—PXE Boot and • Location of the
Wake on LAN” TFTP server
(page 47) • VNC enablement
• VNC password

Remote Installation 75
Installation Scenario Parameters Needed Boot Options
for Booting

Section 4.1.4, “Simple • Location of the in- • install=(nfs,http,


Remote Installation via stallation server ftp,smb)://path_to
SSH—Static Network • Network device _instmedia
Configuration” (page 48) • IP address • netdevice=some
• Netmask _netdevice (only need-
• Gateway ed if several network de-
• SSH enablement vices are available)
• SSH password • hostip=some_ip
• netmask=some
_netmask
• gateway=ip_gateway
• usessh=1
• sshpassword=some
_password

Section 4.1.5, “Simple • Location of the in- • install=(nfs,http,


Remote Installation via stallation server ftp,smb)://path_to
SSH—Dynamic Network • SSH enablement _instmedia
Configuration” (page 49) • SSH password • usessh=1
• sshpassword=some
_password

Section 4.1.6, “Remote • Location of the in- Not applicable; process man-
Installation via stallation server aged through PXE and DHCP
SSH—PXE Boot and • Location of the
Wake on LAN” TFTP server
(page 51) • SSH enablement
• SSH password

76 Installation and Administration


TIP: More Information about linuxrc Boot Options

Find more information about the linuxrc boot options used for booting a Linux
system in /usr/share/doc/packages/linuxrc/linuxrc.html.

4.5 Monitoring the Installation


Process
There are several options for remotely monitoring the installation process. If the proper
boot options have been specified while booting for installation, either VNC or SSH can
be used to control the installation and system configuration from a remote workstation.

4.5.1 VNC Installation


Using any VNC viewer software, you can remotely control the installation of SUSE
Linux Enterprise from virtually any operating system. This section introduces the setup
using a VNC viewer application or a Web browser.

Preparing for VNC Installation


All you need to do on the installation target to prepare for a VNC installation is to
provide the appropriate boot options at the initial boot for installation (see Section 4.4.3,
“Using Custom Boot Options” (page 74)). The target system boots into a text-based
environment and waits for a VNC client to connect to the installation program.

The installation program announces the IP address and display number needed to connect
for installation. If you have physical access to the target system, this information is
provided right after the system booted for installation. Enter this data when your VNC
client software prompts for it and provide your VNC password.

Because the installation target announces itself via OpenSLP, you can retrieve the address
information of the installation target via an SLP browser without the need for any
physical contact to the installation itself provided your network setup and all machines
support OpenSLP:

Remote Installation 77
1 Start the KDE file and Web browser Konqueror.

2 Enter service://yast.installation.suse in the location bar. The


target system then appears as an icon in the Konqueror screen. Clicking this icon
launches the KDE VNC viewer in which to perform the installation. Alternatively,
run your VNC viewer software with the IP address provided and add :1 at the
end of the IP address for the display the installation is running on.

Connecting to the Installation Program


Basically, there are two ways to connect to a VNC server (the installation target in this
case). You can either start an independent VNC viewer application on any operating
system or connect using a Java-enabled Web browser.

Using VNC, you can control the installation of a Linux system from any other operating
system, including other Linux flavors, Windows, or Mac OS.

On a Linux machine, make sure that the package tightvnc is installed. On a Windows
machine, install the Windows port of this application, which can be obtained at the
TightVNC home page (http://www.tightvnc.com/download.html).

To connect to the installation program running on the target machine, proceed as


follows:

1 Start the VNC viewer.

2 Enter the IP address and display number of the installation target as provided by
the SLP browser or the installation program itself:
ip_address:display_number

A window opens on your desktop displaying the YaST screens as in a normal


local installation.

Using a Web browser to connect to the installation program makes you totally indepen-
dent of any VNC software or the underlying operating system. As long as the browser
application has Java support enabled, you can use any browser (Firefox, Internet Ex-
plorer, Konqueror, Opera, etc.) to perform the installation of your Linux system.

To perform a VNC installation, proceed as follows:

78 Installation and Administration


1 Launch your preferred Web browser.

2 Enter the following at the address prompt:


http://ip_address_of_target:5801

3 Enter your VNC password when prompted to do so. The browser window now
displays the YaST screens as in a normal local installation.

4.5.2 SSH Installation


Using SSH, you can remotely control the installation of your Linux machine using any
SSH client software.

Preparing for SSH Installation


Apart from installing the appropriate software package (OpenSSH for Linux and PuTTY
for Windows), you just need to pass the appropriate boot options to enable SSH for
installation. See Section 4.4.3, “Using Custom Boot Options” (page 74) for details.
OpenSSH is installed by default on any SUSE Linux–based operating system.

Connecting to the Installation Program


1 Retrieve the installation target's IP address. If you have physical access to the
target machine, just take the IP address the installation routine provides at the
console after the initial boot. Otherwise take the IP address that has been assigned
to this particular host in the DHCP server configuration.

2 At a command line, enter the following command:

ssh -X root@ip_address_of_target

Replace ip_address_of_target with the actual IP address of the installation


target.

3 When prompted for a username, enter root.

Remote Installation 79
4 When prompted for the password, enter the password that has been set with the
SSH boot option. After you have successfully authenticated, a command line
prompt for the installation target appears.

5 Enter yast to launch the installation program. A window opens showing the
normal YaST screens as described in Chapter 3, Installation with YaST (page 17).

80 Installation and Administration


Automated Installation
AutoYaST allows you to install SUSE® Linux Enterprise on a large number of machines
5
in parallel. The AutoYaST technology offers great flexibility to adjust deployments to
heterogeneous hardware. This chapter tells you how to prepare a simple automated in-
stallation and lay out an advanced scenario involving different hardware types and in-
stallation purposes.

5.1 Simple Mass Installation


IMPORTANT: Identical Hardware

This scenario assumes you are rolling out SUSE Linux Enterprise to a set of
machines with exactly the same hardware configuration.

To prepare for an AutoYaST mass installation, proceed as follows:

1 Create an AutoYaST profile that contains the installation details needed for your
deployment as described in Section 5.1.1, “Creating an AutoYaST Profile”
(page 82).

2 Determine the source of the AutoYaST profile and the parameter to pass to the
installation routines as described in Section 5.1.2, “Distributing the Profile and
Determining the autoyast Parameter” (page 84).

3 Determine the source of the SUSE Linux Enterprise installation data as described
in Section 5.1.3, “Providing the Installation Data” (page 87).

Automated Installation 81
4 Determine and set up the boot scenario for autoinstallation as described in Sec-
tion 5.1.4, “Setting Up the Boot Scenario” (page 87).

5 Pass the command line to the installation routines by adding the parameters
manually or by creating an info file as described in Section 5.1.5, “Creating
the info File” (page 89).

6 Start the autoinstallation process as described in Section 5.1.6, “Initiating and


Monitoring the Autoinstallation” (page 92).

5.1.1 Creating an AutoYaST Profile


An AutoYaST profile tells AutoYaST what to install and how to configure the installed
system to get a completely ready-to-use system in the end. It can be created in several
different ways:

• Clone a fresh installation from a reference machine to a set of identical machines

• Use the AutoYaST GUI to create and modify a profile to meet your requirements

• Use an XML editor and create a profile from scratch

To clone a fresh reference installation, proceed as follows:

1 Perform a normal installation.

2 After you complete the hardware configuration and read the release notes, check
Clone This Installation for AutoYaST, if it is not yet checked by default. This
creates a ready-to-use profile as /root/autoinst.xml that can be used to
create clones of this particular installation.

To use the AutoYaST GUI to create a profile from an existing system configuration
and modify it to your needs, proceed as follows:

1 As root, start YaST.

2 Select Miscellaneous > Autoinstallation to start the graphical AutoYaST front-


end.

82 Installation and Administration


3 Select Tools > Create Reference Control File to prepare AutoYaST to mirror the
current system configuration into an AutoYaST profile.

4 As well as the default resources, like boot loader, partitioning, and software se-
lection, you can add various other aspects of your system to the profile by
checking the items in the list in Create a Reference Control File.

5 Click Create to have YaST gather all the system information and write it to a
new profile.

6 To proceed, choose one of the following:

• If the profile is complete and matches your requirements, select File > Save
as and enter a filename for the profile, such as autoinst.xml.

• Modify the reference profile by selecting the appropriate configuration aspects


(such as “Hardware/Printer”) from the tree view to the left and clicking
Configure. The respective YaST module starts but your settings are written
to the AutoYaST profile instead of applied to your system. When done, select
File > Save as and enter a suitable name for the profile.

7 Leave the AutoYaST module with File > Exit.

Automated Installation 83
Figure 5.1 Editing an AutoYaST Profile with the AutoYaST Front-End

5.1.2 Distributing the Profile and


Determining the autoyast Parameter
The AutoYaST profile can be distributed in several different ways. Depending on the
protocol used to distribute the profile data, different AutoYaST parameters are used to
make the profile location known to the installation routines on the client. The location
of the profile is passed to the installation routines by means of the boot prompt or an
info file that is loaded upon boot. The following options are available:

Profile Lo- Parameter Description


cation

File autoyast=file:// Makes the installation routines look for


path the control file in specified path (relative
to source root directory—file:///
autoinst.xml if in the top directory
of a CD-ROM).

84 Installation and Administration


Profile Lo- Parameter Description
cation

Device autoyast=device:// Makes the installation routines look for


path the control file on a storage device. Only
the device name is needed—/dev/sda1
is wrong, use sda1 instead.

Floppy autoyast=floppy:// Makes the installation routines look for


path the control file on a floppy in the floppy
drive. This option is especially useful, if
you want to boot from CD-ROM.

If a control file cannot be retrieved from


the floppy disk, AutoYaST automatically
scans any USB device attached to your
machine.

USB autoyast=usb:// This option triggers a search for the con-


(Flash) path trol file on any USB attached device.
Disk

NFS autoyast=nfs:// Has the installation routines retrieve the


server/path control file from an NFS server.

HTTP autoyast=http:// Has the installation routines retrieve the


server/path control file from an HTTP server.

HTTPS autoyast=https:// Has the installation routines retrieve the


server/path control file from an HTTPS server.

TFTP autoyast=tftp:// Has the installation routines retrieve the


server/path control file from a TFTP server.

FTP autoyast=ftp:// Has the installation routines retrieve the


server/path control file from an FTP server.

Replace the server and path placeholders with values matching your actual setup.

Automated Installation 85
AutoYaST includes a feature that allows binding certain profiles to the client's MAC
address. Without having to alter the autoyast= parameter, you can have the same
setup install several different instances using different profiles.

To use this, proceed as follows:

1 Create separate profiles with the MAC address of the client as the filename and
put them on the HTTP server that holds your AutoYaST profiles.

2 Omit the exact path including the filename when creating the autoyast= pa-
rameter, for example:
autoyast=http://192.0.2.91/

3 Start the autoinstallation.

YaST tries to determine the location of the profile in the following way:

1. YaST searches for the profile using its own IP address in uppercase hexadecimal,
for example, 192.0.2.91 is C000025B.

2. If this file is not found, YaST removes one hex digit and tries again. This action
is repeated eight times until the file with the correct name is found.

3. If that still fails, it tries looking for a file with the MAC address of the clients as
the filename. The MAC address of the example client is 0080C8F6484C.

4. If the MAC address–named file cannot be found, YaST searches for a file named
default (in lowercase). An example sequence of addresses where YaST
searches for the AutoYaST profile looks as follows:

C000025B
C000025
C00002
C0000
C000
C00
C0
C
0080C8F6484C
default

86 Installation and Administration


5.1.3 Providing the Installation Data
The installation data can be provided by means of the product CDs or DVDs or using
a network installation source. If the product CDs are used as the installation source,
physical access to the client to install is needed, because the boot process needs to be
initiated manually and the CDs need to be changed.

To provide the installation sources over the network, set up a network installation
server (HTTP, NFS, FTP) as described in Section 4.2.1, “Setting Up an Installation
Server Using YaST” (page 52). Use an info file to pass the server's location to the
installation routines.

5.1.4 Setting Up the Boot Scenario


The client can be booted in several different ways:

Network Boot
As for a normal remote installation, autoinstallation can be initiated with Wake on
LAN and PXE, the boot image and control file can be pulled in via TFTP, and the
installation sources from any network installation server.

Bootable CD-ROM
You can use the original SUSE Linux Enterprise media to boot the system for au-
toinstallation and pull in the control file from a network location or a floppy. Alter-
natively, create your own custom CD-ROM holding both the installation sources
and the AutoYaST profile.

The following sections provide a basic outline of the procedures for network boot or
boot from CD-ROM.

Preparing for Network Boot


Network booting with Wake on LAN, PXE, and TFTP is discussed in Section 4.1.3,
“Remote Installation via VNC—PXE Boot and Wake on LAN” (page 47). To make
the setup introduced there work for autoinstallation, modify the featured PXE Linux
configuration file (/srv/tftp/pxelinux.cfg/default) to contain the
autoyast parameter pointing to the location of the AutoYaST profile. An example
entry for a standard installation looks like this:

Automated Installation 87
default linux

# default label linux


kernel linux append initrd=initrd ramdisk_size=65536 insmod=e100 \
install=http://192.168.0.22/install/suse-enterprise/

The same example for autoinstallation looks like this:

default linux

# default label linux


kernel linux append initrd=initrd ramdisk_size=65536 insmod=e100 \
install=http://192.168.0.22/install/suse-enterprise/ \
autoyast=nfs://192.168.0.23/profiles/autoinst.xml

Replace the example IP addresses and paths with the data used in your setup.

Preparing to Boot from CD-ROM


There are several ways in which booting from CD-ROM can come into play in Auto-
YaST installations. Choose from the following scenarios:

Boot from SUSE Linux Enterprise Media, Get the Profile over the Network
Use this approach if a totally network-based scenario is not possible (for example,
if your hardware does not support PXE) and you have physical access to system
to install during most of the process.

You need:

• The SUSE Linux Enterprise media

• A network server providing the profile data (see Section 5.1.2, “Distributing the
Profile and Determining the autoyast Parameter” (page 84) for details)

• A floppy containing the info file that tells the installation routines where to find
the profile

or

88 Installation and Administration


Access to the boot prompt of the system to install where you manually enter the
autoyast= parameter

Boot and Install from SUSE Linux Enterprise Media, Get the Profile from a Floppy
Use this approach if an entirely network-based installation scenario would not
work. It requires physical access to the system to install for turning on the target
machine, or, in the second case, to enter the profile's location at the boot prompt.
In both cases, you may also need to change media depending on the scope of instal-
lation.

You need:

• The SUSE Linux Enterprise media

• A floppy holding both the profile and the info file

or

Access to the boot prompt of the target to enter the autoyast= parameter

Boot and Install from Custom Media, Get the Profile from the Media
If you just need to install a limited number of software packages and the number
of targets is relatively low, creating your own custom CD holding both the installa-
tion data and the profile itself might prove a good idea, especially if no network is
available in your setup.

5.1.5 Creating the info File


The installation routines at the target need to be made aware of all the different compo-
nents of the AutoYaST framework. This is done by creating a command line containing
all the parameters needed to locate the AutoYaST components, installation sources,
and the parameters needed to control the installation process.

Do this by manually passing these parameters at the boot prompt of the installation or
by providing a file called info that is read by the installation routines (linuxrc). The
former requires physical access to any client to install, which makes this approach un-
suitable for large deployments. The latter enables you to provide the info file on some
media that is prepared and inserted into the clients' drives prior to the autoinstallation.
Alternatively, use PXE boot and include the linuxrc parameters in the pxelinux
.cfg/default file as shown in Section “Preparing for Network Boot” (page 87).

Automated Installation 89
The following parameters are commonly used for linuxrc. For more information, refer
to the AutoYaST package documentation under /usr/share/doc/packages/
autoyast.

IMPORTANT: Separating Parameters and Values

When passing parameters to linuxrc at the boot prompt, use = to separate


parameter and value. When using an info file, separate parameter and value
with :.

Keyword Value

netdevice The network device to use for network setup (for


BOOTP/DHCP requests). Only needed if several network
devices are available.

hostip When empty, the client sends a BOOTP request. Otherwise


the client is configured using the specified data.

netmask Netmask.

gateway Gateway.

nameserver Name server.

autoyast Location of the the control file to use for the automatic in-
stallation, such as
autoyast=http://192.168.2.1/profiles/.

install Location of the installation source, such as


install=nfs://192.168.2.1/CDs/.

vnc If set to 1, enables VNC remote controlled installation.

vncpassword The password for VNC.

usessh If set to 1, enables SSH remote controlled installation.

90 Installation and Administration


If your autoinstallation scenario involves client configuration via DCHP and a network
installation source and you want to monitor the installation process using VNC, your
info would look like this:
autoyast:profile_source install:install_source vnc:1 vncpassword:some_password

If you prefer a static network setup at installation time, your info file would look like
the following:

autoyast:profile_source \
install:install_source \
hostip:some_ip \
netmask:some_netmask \
gateway:some_gateway

The \ indicate that the line breaks have only been added for the sake of readability. All
options must be entered as one continuous string.

The info data can be made available to linuxrc in various different ways:

• As a file in the root directory of a floppy that is in the client's floppy drive at instal-
lation time.

• As a file in the root directory of the initial RAM disk used for booting the system
provided either from custom installation media or via PXE boot.

• As part of the AutoYaST profile. In this case, the AutoYaST file needs to be called
info to enable linuxrc to parse it. An example for this approach is given below.

linuxrc looks for a string (start_linuxrc_conf) in the profile that represents the
beginning of the file. If it is found, it parses the content starting from that string and
finishes when the string end_linuxrc_conf is found. The options are stored in the
profile as follows:
....
<install>
....
<init>
<info_file>
<![CDATA[
#
# Don't remove the following line:
# start_linuxrc_conf
#
install: nfs:server/path

Automated Installation 91
vnc: 1
vncpassword: test
autoyast: file:///info

# end_linuxrc_conf
# Do not remove the above comment
#
]]>

</info_file>
</init>
......
</install>
....

linuxrc loads the profile containing the boot parameters instead of the traditional info
file. The install: parameter points to the location of the installation sources. vnc
and vncpassword indicate the use of VNC for installation monitoring. The
autoyast parameter tells linuxrc to treat info as an AutoYaST profile.

5.1.6 Initiating and Monitoring the


Autoinstallation
After you have provided all the infrastructure mentioned above (profile, installation
source, and info file), you can go ahead and start the autoinstallation. Depending on
the scenario chosen for booting and monitoring the process, physical interaction with
the client may be needed:

• If the client system boots from any kind of physical media, either product media
or custom CDs, you need to insert these into the client's drives.

• If the client is not switched on via Wake on LAN, you need to at least switch on
the client machine.

• If you have not opted for remote controlled autoinstallation, the graphical feedback
from AutoYaST is sent to the client's attached monitor or, if you use a headless
client, to a serial console.

To enable remote controlled autoinstallation, use the VNC or SSH parameters described
in Section 5.1.5, “Creating the info File” (page 89) and connect to the client from
another machine as described in Section 4.5, “Monitoring the Installation Process”
(page 77).

92 Installation and Administration


5.2 Rule-Based Autoinstallation
The following sections introduce the basic concept of rule-based installation using
AutoYaST and provide an example scenario that enables you to create your own custom
autoinstallation setup.

5.2.1 Understanding Rule-Based


Autoinstallation
Rule-based AutoYaST installation allows you to cope with heterogeneous hardware
environments:

• Does your site contain hardware of different vendors?

• Are the machines on your site of different hardware configuration (for example,
using different devices or using different memory and disk sizes)?

• Do you intend to install across different domains and need to distinguish between
them?

What rule-based autoinstallation does is, basically, generate a custom profile to match
a heterogeneous scenario by merging several profiles into one. Each rule describes one
particular distinctive feature of your setup (such as disk size) and tells AutoYaST which
profile to use when the rule matches. Several rules describing different features of your
setup are combined in an AutoYaST rules.xml file. The rule stack is then processed
and AutoYaST generates the final profile by merging the different profiles matching
the AutoYaST rules into one. To illustrate this procedure, refer to Section 5.2.2, “Ex-
ample Scenario for Rule-Based Autoinstallation” (page 95).

Rule-based AutoYaST offers you great flexibility in planning and executing your SUSE
Linux Enterprise deployment. You can:

• Create rules for matching any of the predefined system attributes in AutoYaST

• Combine multiple system attributes (such as disk size and kernel architecture) into
one rule by using logical operators

Automated Installation 93
• Create custom rules by running shell scripts and passing their output to the Auto-
YaST framework. The number of custom rules is limited to five.

NOTE

For more information about rule creation and usage with AutoYaST, refer to
the package's documentation under /usr/share/doc/packages/
autoyast2/html/index.html, Chapter Rules and Classes.

To prepare for a rule-based AutoYaST mass installation, proceed as follows:

1 Create several AutoYaST profiles that contain the installation details needed for
your heterogeneous setup as described in Section 5.1.1, “Creating an AutoYaST
Profile” (page 82).

2 Define rules to match the system attributes of your hardware setup as shown in
Section 5.2.2, “Example Scenario for Rule-Based Autoinstallation” (page 95).

3 Determine the source of the AutoYaST profile and the parameter to pass to the
installation routines as described in Section 5.1.2, “Distributing the Profile and
Determining the autoyast Parameter” (page 84).

4 Determine the source of the SUSE Linux Enterprise installation data as described
in Section 5.1.3, “Providing the Installation Data” (page 87)

5 Pass the command line to the installation routines by adding the parameters
manually or by creating an info file as described in Section 5.1.5, “Creating
the info File” (page 89).

6 Determine and set up the boot scenario for autoinstallation as described in Sec-
tion 5.1.4, “Setting Up the Boot Scenario” (page 87).

7 Start the autoinstallation process as described in Section 5.1.6, “Initiating and


Monitoring the Autoinstallation” (page 92).

94 Installation and Administration


5.2.2 Example Scenario for Rule-Based
Autoinstallation
To get a basic understanding of how rules are created, think of the following example,
depicted in Figure 5.2, “AutoYaST Rules” (page 96). One run of AutoYaST installs
the following setup:

A Print Server
This machine just needs a minimal installation without a desktop environment and
a limited set of software packages.

Workstations in the Engineering Department


These machines need a desktop environment and a broad set of development soft-
ware.

Laptops in the Sales Department


These machines need a desktop environment and a limited set of specialized appli-
cations, such as office and calendaring software.

Automated Installation 95
Figure 5.2 AutoYaST Rules

AutoYaST Directory

Enigineering Department
Computers
rules.xml File

Rule 1

Rule 2 Eng. Profile

Rule 3

Sales Profile

Sales Department
Laptops

Merge Process Print Server


Profile

Print Server

96 Installation and Administration


In a first step, use one of the methods outlined in Section 5.1.1, “Creating an AutoYaST
Profile” (page 82) to create profiles for each use case. In this example, you would
create print.xml, engineering.xml, and sales.xml.

In the second step, create rules to distinguish the three hardware types from one another
and to tell AutoYaST which profile to use. Use an algorithm similar to the following
to set up the rules:

1. Does the machine have an IP of 192.168.27.11? Then make it the print server.

2. Does the machine have PCMCIA hardware and feature an Intel chipset? Then
consider it an Intel laptop and install the sales department software selection.

3. If none of the above is true, consider the machine a developer workstation and install
accordingly.

Roughly sketched, this translates into a rules.xml file with the following content:

<?xml version="1.0"?>
<!DOCTYPE autoinstall SYSTEM "/usr/share/autoinstall/dtd/rules.dtd">
<autoinstall xmlns="http://www.suse.com/1.0/yast2ns"
xmlns:config="http://www.suse.com/1.0/configns">
<rules config:type="list">
<rule>
<hostaddress>
<match>192.168.27.11</match>
<match_type>exact</match_type>
</hostaddress>
<result>
<profile>print.xml</profile>
<continue config:type="boolean">false</continue>
</result>
</rule>
<rule>
<haspcmcia>
<match>1</match>
<match_type>exact</match_type>
</haspcmcia>
<custom1>
<script>
if grep -i intel /proc/cpuinfo > /dev/null; then
echo -n "intel"
else
echo -n "non_intel"
fi;
</script>
<match>*</match>
<match_type>exact</match_type>

Automated Installation 97
</custom1>
<result>
<profile>sales.xml</profile>
<continue config:type="boolean">false</continue>
</result>
<operator>and</operator>
</rule>
<rule>
<haspcmcia>
<match>0</match>
<match_type>exact</match_type>
</haspcmcia>
<result>
<profile>engineering.xml</profile>
<continue config:type="boolean">false</continue>
</result>
</rule>
</rules>
</autoinstall>

When distributing the rules file, make sure that the rules directory resides under the
profiles directory specified in the autoyast=protocol:serverip/
profiles/ URL. AutoYaST looks for a rules subdirectory containing a file named
rules.xml first then loads and merges the profiles specified in the rules file.

The rest of the autoinstallation procedure is carried out as usual.

5.3 For More Information


For in-depth information about the AutoYaST technology, refer to the documentation
installed along with the software. It is located under /usr/share/doc/packages/
autoyast2. The most recent edition of this documentation can be found at http://
www.suse.de/~ug/autoyast_doc/index.html.

98 Installation and Administration


Deploying Customized
Preinstallations
Rolling out customized preinstallations of SUSE Linux Enterprise to a large number
6
of identical machines spares you from installing each one of them separately and provides
a standardized installation experience for the end users. With YaST firstboot, create
customized preinstallation images and determine the workflow for the final personal-
ization steps that involve end user interaction.

Creating a custom installation, rolling it out to your hardware, and personalizing the
final product involves the following steps:

1 Prepare the master machine whose disk should be cloned to the client machines.
For more information, refer to Section 6.1, “Preparing the Master Machine”
(page 100).

2 Customize the firstboot workflow. For more information, refer to Section 6.2,
“Customizing the firstboot Installation” (page 100).

3 Clone the master machine's disk and roll this image out to the clients' disks. For
more information, refer to Section 6.3, “Cloning the Master Installation”
(page 108).

4 Have the end user personalize the instance of SUSE Linux Enterprise. For more
information, refer to Section 6.4, “Personalizing the Installation” (page 109).

Deploying Customized Preinstallations 99


6.1 Preparing the Master Machine
To prepare a master machine for a firstboot workflow, proceed as follows:

1 Insert the installation media into the master machine.

2 Boot the machine.

3 Perform a normal installation including all necessary configuration steps and


wait for the installed machine to boot.

4 To define your own workflow of YaST configuration steps for the end user or
add your own YaST modules to this workflow, proceed to Section 6.2, “Customiz-
ing the firstboot Installation” (page 100). Otherwise proceed directly to Step 5
(page 100).

5 Enable firstboot as root:

5a Create an empty file /etc/reconfig_system to trigger firstboot's exe-


cution. This file is deleted once the firstboot configuration has been success-
fully accomplished. Create this file using the following command:
touch /etc/reconfig_system

5b Enable the firstboot service through the YaST Runlevel Editor.

6 Proceed to Section 6.3, “Cloning the Master Installation” (page 108).

6.2 Customizing the firstboot


Installation
Customizing the firstboot installation may involve several different components. Cus-
tomizing them is optional. If you do not make any changes, firstboot performs the in-
stallation using the default settings. The following options are available:

100 Installation and Administration


• Customizing messages to the user as described in Section 6.2.1, “Customizing
YaST Messages” (page 101).

• Customizing licenses and license actions as described in Section 6.2.2, “Customizing


the License Action” (page 102).

• Customizing the release notes to display as described in Section 6.2.3, “Customizing


the Release Notes” (page 103).

• Customizing the order and number of components involved in the installation as


described in Section 6.2.4, “Customizing the Workflow” (page 103).

• Configuring additional optional scripts as described in Section 6.2.5, “Configuring


Additional Scripts” (page 108).

To customize any of these components, adjust the following configuration files:

/etc/sysconfig/firstboot
Configure various aspects of firstboot, such as release notes, scripts, and license
actions.

/etc/YaST2/firstboot.xml
Configure the installation workflow by enabling or disabling components or adding
custom ones.

6.2.1 Customizing YaST Messages


By default, an installation of SUSE Linux Enterprise contains several default messages
that are localized and displayed at certain stages of the installation process. These include
a welcome message, a license message, and a congratulatory message at the end of in-
stallation. You can replace any of these with your own versions and include localized
versions of them in the installation. To include your own welcome message, proceed
as follows:

1 Log in as root.

2 Open the /etc/sysconfig/firstboot configuration file and apply the


following changes:

Deploying Customized Preinstallations 101


2a Set FIRSTBOOT_WELCOME_DIR to the directory path from to read the
welcome message and the localized versions, as in:
FIRSTBOOT_WELCOME_DIR="/usr/share/firstboot/"

2b If your welcome message has filenames other than welcome.txt and


welcome_locale.txt, specify the filename pattern in
FIRSTBOOT_WELCOME_PATTERNS. For example:
FIRSTBOOT_WELCOME_PATTERNS="mywelcome.txt"

If unset, the default value of welcome.txt is assumed.

2c Apply your changes and close the file.

3 Create the welcome file and the localized versions and place them in the directory
specified in the /etc/sysconfig/firstboot configuration file.

Proceed in a similar way to configure customized license and finish messages. These
variables are FIRSTBOOT_LICENSE_DIR and FIRSTBOOT_FINISH_FILE.

6.2.2 Customizing the License Action


You can customize the way the installation system reacts to a user not accepting the
license agreement. There are three different ways in which the system could react to a
user's failure to accept the license:

halt
The firstboot installation is aborted and the entire system shuts down. This is the
default setting.

continue
The firstboot installation continues.

abort
The firstboot installation is aborted, but the system tries to boot.

Make your choice and set LICENSE_REFUSAL_ACTION to the appropriate value.

102 Installation and Administration


6.2.3 Customizing the Release Notes
Depending on whether you have changed the instance of SUSE Linux Enterprise you
are deploying with firstboot, you probably need to educate the end users about important
aspects of their new operating system. A standard installation uses release notes, dis-
played during one of the final stages of the installation, to provide important information
to the users. To have your own modified release notes displayed as part of a firstboot
installation, proceed as follows:

1 Create your own release notes file. Use the RTF format as in the example file in
/usr/share/doc/release-notes and save the result as
RELEASE-NOTES.lang.rtf.

2 Store optional localized version next to the original version and replace the lang
part of the filename with the actual language code, such as de for German.

3 Open the firstboot configuration file from /etc/sysconfig/firstboot


and set FIRSTBOOT_RELEASE_NOTES_PATH to the actual directory where
the release note files are stored.

6.2.4 Customizing the Workflow


By default, a standard firstboot workflow includes the following components:

• Language Selection

• Welcome

• License Agreement

• Host Name

• Network

• Time and Date

• Desktop

• root Password

Deploying Customized Preinstallations 103


• User Authentication Method

• User Management

• Hardware Configuration

• Finish Setup

This standard layout of a firstboot installation workflow is not mandatory. You can
enable or disable certain components or hook your own modules into the workflow.
To modify the firstboot workflow, manually edit the firstboot configuration file /etc/
YaST2/firstboot.xml. This XML file is a subset of the standard control.xml
file that is used by YaST to control the installation workflow.

The following overview provides you with enough background to modify the firstboot
installation workflow. In it, see the basic syntax of the firstboot configuration file and
how the key elements are configured.

Example 6.1 Configuring the Proposal Screens


<proposals config:type="list">❶
<proposal>❷
<name>firstboot_hardware</name>❸
<mode>installation</mode>❹
<stage>firstboot</stage>❺
<label>Hardware Configuration</label>❻
<proposal_modules config:type="list">❼
<proposal_module>printer</proposal_module>❽
</proposal_modules>
</proposal>
<proposal>

</proposal>
</proposals>

❶ The container for all proposals that should be part of the firstboot workflow.
❷ The container for an individual proposal.
❸ The internal name of the proposal.
❹ The mode of this proposal. Do not make any changes here. For a firstboot instal-
lation, this must be set to installation.

104 Installation and Administration


❺ The stage of the installation process at which this proposal is invoked. Do not
make any changes here. For a firstboot installation, this must be set to
firstboot.
❻ The label to be displayed on the proposal.
❼ The container for all modules that are part of the proposal screen.
❽ One or more modules that are part of the proposal screen.

The next section of the firstboot configuration file consists of the workflow definition.
All modules that should be part of the firstboot installation workflow must be listed
here.

Example 6.2 Configuring the Workflow Section

<workflows config:type="list">
<workflow>
<defaults>
<enable_back>yes</enable_back>
<enable_next>yes</enable_next>
<archs>all</archs>
</defaults>
<stage>firstboot</stage>
<label>Configuration</label>
<mode>installation</mode>
… <!–– list of modules ––>
</modules>
</workflow>
</workflows>

The overall structure of the workflows section is very similar to that of the
proposals section. A container holds the workflow elements and the workflow ele-
ments all include stage, label and mode information just as the proposals introduced in
Example 6.1, “Configuring the Proposal Screens” (page 104). The most notable difference
is the defaults section, which contains basic design information for the workflow
components:

enable_back
Include the Back button in all dialogs.

enable_next
Include the Next button in all dialogs.

Deploying Customized Preinstallations 105


archs
Specify the hardware architectures on which this workflow should be used.

Example 6.3 Configuring the List of Workflow Components

<modules config:type="list">❶
<module>❷
<label>Language</label>❸
<enabled config:type="boolean">false</enabled>❹
<name>firstboot_language</name>❺
</module>
<modules>

❶ The container for all components of the workflow.


❷ The module definition.
❸ The label displayed with the module.
❹ The switch to enable or disable this component in the workflow.
❺ The module name. The module itself must be located under /usr/share/
YaST2/clients and have the .ycp file suffix.

To make changes to the number or order of proposal screens during the firstboot instal-
lation, proceed as follows:

1 Open the firstboot configuration file at /etc/YaST2/firstboot.xml.

2 Delete or add proposal screens or change the order of the existing ones:

• To delete an entire proposal, remove the proposal element including all


its subelements from the proposals section and remove the respective
module element (with subelements) from the workflow.

• To add a new proposal, create a new proposal element and fill in all the
required subelements. Make sure that the proposal exists as a YaST module
in /usr/share/YaST2/clients.

• To change the order of proposals, move the respective module elements


containing the proposal screens around in the workflow. Note that there may
be dependencies to other installation steps that require a certain order of
proposals and workflow components.

106 Installation and Administration


3 Apply your changes and close the configuration file.

You can always change the workflow of the configuration steps when the default does
not meet your needs. Enable or disable certain modules in the workflow or add your
own custom ones.

To toggle the status of a module in the firstboot workflow, proceed as follows:

1 Open the /etc/YaST2/firstboot.xml configuration file.

2 Change the value for the enabled element from true to false to disable
the module or from false to true to enable it again.

<module>
<label>Time and Date</label>
<enabled config:type="boolean">true</enabled>
<name>firstboot_timezone</name>
</module>

3 Apply your changes and close the configuration file.

To add a custom made module to the workflow, proceed as follows:

1 Create your own YaST module and store the module file module_name.ycp
in /usr/share/YaST2/clients.

2 Open the /etc/YaST2/firstboot.xml configuration file.

3 Determine at which point of the workflow your new module should be run. In
doing so, make sure that possible dependencies to other steps in the workflow
are taken into account and resolved.

4 Create a new module element inside the modules container and add the appro-
priate subelements:
<modules config:type="list">

<module>
<label>my_module</label>
<enabled config:type="boolean">true</enabled>
<name>filename_my_module</name>
</module>
</modules>

Deploying Customized Preinstallations 107


4a Enter the label to display on your module in the label element.

4b Make sure that enabled is set to true to have your module included in
the workflow.

4c Enter the filename of your module in the name element. Omit the full path
and the .ycp suffix.

5 Apply your settings and close the configuration file.

TIP: For More Information

For more information about YaST development, refer to http://developer


.novell.com/wiki/index.php/YaST.

6.2.5 Configuring Additional Scripts


firstboot can be configured to execute additional scripts after the firstboot workflow
has been completed. To add additional scripts to the firstboot sequence, proceed as
follows:

1 Open the /etc/sysconfig/firstboot configuration file and make sure


that the path specified for SCRIPT_DIR is correct. The default value is /usr/
share/firstboot/scripts.

2 Create your shell script, store it in the specified directory, and apply the appropri-
ate file permissions.

6.3 Cloning the Master Installation


Clone the master machine's disk using any of the imaging mechanisms available to you
and roll these images out to the target machines.

108 Installation and Administration


6.4 Personalizing the Installation
As soon as the cloned disk image is booted, firstboot starts and the installation proceeds
exactly as laid out in Section 6.2.4, “Customizing the Workflow” (page 103). Only the
components included in the firstboot workflow configuration are started. Any other
installation steps are skipped. The end user adjusts language, keyboard, network, and
password settings to personalize the workstation. Once this process is finished, a firstboot
installed system behaves as any other instance of SUSE Linux Enterprise.

Deploying Customized Preinstallations 109


Advanced Disk Setup
Sophisticated system configurations require particular disk setups. All common parti-
7
tioning tasks can be done with YaST. To get persistent device naming with block devices,
use the block devices below /dev/disk/by-id/. Logical Volume Management
(LVM) is a disk partitioning scheme that is designed to be much more flexible than the
physical partitioning used in standard setups. Its snapshot functionality enables easy
creation of data backups. Redundant Array of Independent Disks (RAID) offers increased
data integrity, performance, and fault tolerance. SUSE® Linux Enterprise Server also
supports multipath I/O. For details, see the chapter about multipath I/O in Storage Ad-
ministration Guide. Starting with SUSE Linux Enterprise 10, there is also the option
to use iSCSI as a networked disk. Read more about iSCSI in Chapter 12, Mass Storage
over IP Networks—iSCSI (page 257).

7.1 LVM Configuration


This section briefly describes the principles behind LVM and its basic features that
make it useful under many circumstances. In Section 7.1.2, “LVM Configuration with
YaST” (page 114), learn how to set up LVM with YaST.

WARNING

Using LVM might be associated with increased risk, such as data loss. Risks also
include application crashes, power failures, and faulty commands. Save your
data before implementing LVM or reconfiguring volumes. Never work without
a backup.

Advanced Disk Setup 111


7.1.1 The Logical Volume Manager
The Logical Volume Manager (LVM) enables flexible distribution of hard disk space
over several file systems. It was developed because sometimes the need to change the
segmentation of hard disk space arises only after the initial partitioning during installation
has already been done. Because it is difficult to modify partitions on a running system,
LVM provides a virtual pool (volume group, VG for short) of memory space from
which logical volumes (LVs) can be created as needed. The operating system accesses
these LVs instead of the physical partitions. Volume groups can span more than only
one disk so that several disks or parts of them may constitute one single VG. This way,
LVM provides a kind of abstraction from the physical disk space that allows its segmen-
tation to be changed in a much easier and safer way than physical repartitioning does.
Background information regarding physical partitioning can be found in Section “Par-
tition Types” (page 151) and Section 8.5.7, “Using the YaST Partitioner” (page 149).

Figure 7.1 Physical Partitioning versus LVM

DISK DISK 1 DISK 2

PART PART PART PART PART PART PART PART

VG 1 VG 2

LV 1 LV 2 LV 3 LV 4

MP MP MP MP MP MP MP

Figure 7.1, “Physical Partitioning versus LVM” (page 112) compares physical partitioning
(left) with LVM segmentation (right). On the left side, one single disk has been divided
into three physical partitions (PART), each with a mount point (MP) assigned so that
the operating system can access them. On the right side, two disks have been divided
into two and three physical partitions each. Two LVM volume groups (VG 1 and VG 2)
have been defined. VG 1 contains two partitions from DISK 1 and one from DISK 2.
VG 2 contains the remaining two partitions from DISK 2. In LVM, the physical disk
partitions that are incorporated in a volume group are called physical volumes (PVs).
Within the volume groups, four logical volumes (LV 1 through LV 4) have been defined,
which can be used by the operating system via the associated mount points. The border

112 Installation and Administration


between different logical volumes need not be aligned with any partition border. See
the border between LV 1 and LV 2 in this example.

LVM features:

• Several hard disks or partitions can be combined in a large logical volume.

• Provided the configuration is suitable, an LV (such as /usr) can be enlarged when


the free space is exhausted.

• Using LVM, it is possible to add hard disks or LVs in a running system. However,
this requires hot-swappable hardware that is capable of such actions.

• It is possible to activate a "striping mode" that distributes the data stream of a logical
volume over several physical volumes. If these physical volumes reside on different
disks, this can improve the reading and writing performance just like RAID 0.

• The snapshot feature enables consistent backups (especially for servers) in the
running system.

With these features, using LVM already makes sense for heavily used home PCs or
small servers. If you have a growing data stock, as in the case of databases, music
archives, or user directories, LVM is just the right thing for you. This would allow file
systems that are larger than the physical hard disk. Another advantage of LVM is that
up to 256 LVs can be added. However, keep in mind that working with LVM is different
from working with conventional partitions. Instructions and further information about
configuring LVM is available in the official LVM HOWTO at http://tldp.org/
HOWTO/LVM-HOWTO/.

Starting from kernel version 2.6, LVM version 2 is available, which is downward-
compatible with the previous LVM and enables the continued management of old volume
groups. When creating new volume groups, decide whether to use the new format or
the downward-compatible version. LVM 2 does not require any kernel patches. It makes
use of the device mapper integrated in kernel 2.6. This kernel only supports LVM ver-
sion 2. Therefore, when talking about LVM, this section always refers to LVM version 2.

Instead of LVM 2, you can use EVMS (Enterprise Volume Management System),
which offers a uniform interface for logical volumes and RAID volumes. Like LVM 2,
EVMS makes use of the device mapper in kernel 2.6.

Advanced Disk Setup 113


7.1.2 LVM Configuration with YaST
The YaST LVM configuration can be reached from the YaST Expert Partitioner (see
Section 8.5.7, “Using the YaST Partitioner” (page 149)). This partitioning tool enables
you to edit and delete existing partitions and create new ones that should be used with
LVM. There, create an LVM partition by first clicking Create > Do not format then
selecting 0x8E Linux LVM as the partition identifier. After creating all the partitions to
use with LVM, click LVM to start the LVM configuration.

Creating Volume Groups


If no volume group exists on your system yet, you are prompted to add one (see Fig-
ure 7.2, “Creating a Volume Group” (page 114)). It is possible to create additional groups
with Add group, but usually one single volume group is sufficient. system is suggested
as a name for the volume group in which the SUSE® Linux Enterprise system files are
located. The physical extent size defines the size of a physical block in the volume
group. All the disk space in a volume group is handled in chunks of this size. This value
is normally set to 4 MB and allows for a maximum size of 256 GB for physical and
logical volumes. The physical extent size should only be increased, for example, to 8,
16, or 32 MB, if you need logical volumes larger than 256 GB.

Figure 7.2 Creating a Volume Group

114 Installation and Administration


Configuring Physical Volumes
Once a volume group has been created, the following dialog lists all partitions with either
the “Linux LVM” or “Linux native” type. No swap or DOS partitions are shown. If a
partition is already assigned to a volume group, the name of the volume group is shown
in the list. Unassigned partitions are indicated with “--”.

If there are several volume groups, set the current volume group in the selection box
to the upper left. The buttons in the upper right enable creation of additional volume
groups and deletion of existing volume groups. Only volume groups that do not have
any partitions assigned can be deleted. All partitions that are assigned to a volume group
are also referred to as a physical volumes (PV).

Figure 7.3 Physical Volume Setup

To add a previously unassigned partition to the selected volume group, first click the
partition then Add Volume. At this point, the name of the volume group is entered next
to the selected partition. Assign all partitions reserved for LVM to a volume group.
Otherwise, the space on the partition remains unused. Before exiting the dialog, every
volume group must be assigned at least one physical volume. After assigning all phys-
ical volumes, click Next to proceed to the configuration of logical volumes.

Advanced Disk Setup 115


Configuring Logical Volumes
After the volume group has been filled with physical volumes, define the logical volumes
the operating system should use in the next dialog. Set the current volume group in a
selection box to the upper left. Next to it, the free space in the current volume group is
shown. The list below contains all logical volumes in that volume group. All normal
Linux partitions to which a mount point is assigned, all swap partitions, and all already
existing logical volumes are listed here. Add, Edit, and Remove logical volumes as
needed until all space in the volume group has been exhausted. Assign at least one
logical volume to each volume group.

Figure 7.4 Logical Volume Management

To create a new logical volume, click Add and fill out the pop-up that opens. As for
partitioning, enter the size, file system, and mount point. Normally, a file system, such
as reiserfs or ext2, is created on a logical volume and is then designated a mount point.
The files stored on this logical volume can be found at this mount point on the installed
system. Additionally it is possible to distribute the data stream in the logical volume
among several physical volumes (striping). If these physical volumes reside on different
hard disks, this generally results in a better reading and writing performance (like
RAID 0). However, a striping LV with n stripes can only be created correctly if the
hard disk space required by the LV can be distributed evenly to n physical volumes.

116 Installation and Administration


If, for example, only two physical volumes are available, a logical volume with three
stripes is impossible.

WARNING: Striping

YaST has no chance at this point to verify the correctness of your entries con-
cerning striping. Any mistake made here is apparent only later when the LVM
is implemented on disk.

Figure 7.5 Creating Logical Volumes

If you have already configured LVM on your system, the existing logical volumes can
be entered now. Before continuing, assign appropriate mount points to these logical
volumes too. With Next, return to the YaST Expert Partitioner and finish your work
there.

Direct LVM Management


If you already have configured LVM and only want to change something, there is an
alternative way to do that. In the YaST Control Center, select System > LVM. Basically
this dialog allows the same actions as described above with the exception of physical

Advanced Disk Setup 117


partitioning. It shows the existing physical volumes and logical volumes in two lists
and you can manage your LVM system using the methods already described.

7.1.3 Storage Management with EVMS


The Enterprise Volume Management System 2 (EVMS2) is a rich, extensible volume
manager with built-in cluster awareness. Its plug-in framework allows plug-ins to add
functionality for support and knowledge of any partition type. Being cluster-aware,
EVMS2 guarantees that managed devices are named identically on each node in the
cluster for easier management.

EVMS2 provides a unified interface (evmsgui and command line) for managing the
following storage resources:

• Physical disks and logical devices on local media and SAN-based media, including
iSCSI

• Software RAIDs 0, 1, 4, and 5 for high availability

• Cluster-aware multipath I/O for fault tolerance

• Cluster storage objects with the Cluster Segment Manager (CSM) plug-in

• Volumes for all file systems that have a file system interface module (FSIM) for
EVMS2

• Snapshots of volumes

In SUSE Linux Enterprise Server 10, new features include the following:

• EVMS2 and CLVM2 (Cluster Linux Volume Manager 2) use the same multidisk
(MD) drivers and device mapper (DM) drivers in the kernel.

• File system plug-ins are available for Heartbeat 2 Cluster Manager and Oracle
Cluster File System 2.

EVMS Devices
The EVMS Administration Utility distinguishes five different levels of devices:

118 Installation and Administration


Disks
This is the lowest level of device. All devices that may be accessed as a physical
disk are treated as disks.

Segments
Segments consist of partitions and other memory regions on a disk, such as the
master boot record (MBR).

Containers
These are the counterparts of volume groups in LVM.

Regions
The available devices are grouped into LVM2 and RAID here.

Volumes
All devices, regardless of whether they are represented by a real partition, a logical
volume, or a RAID device are available with their respective mount points.

If you choose to use EVMS, you must replace your device names with the EVMS device
names. Simple partitions are found in /dev/evms/, logical volumes in /dev/evms/
lvm/, and RAID devices in /dev/evms/md. To activate EVMS at boot time, add
boot.evms to the boot scripts in the YaST runlevel editor. See also Section 19.2.3,
“Configuring System Services (Runlevel) with YaST” (page 382).

For More Information


For information about using EVMS to manage storage resources, see the Storage Ad-
ministration Guide that is available in /usr/share/doc/manual/sles-stor
_evms_en after installing the package sles-stor_evms_en. More common in-
formation about EVMS is also available in EVMS User Guide [http://evms
.sourceforge.net/users_guide/] at the EVMS project [http://evms
.sourceforge.net/], hosted on SourceForge*.

7.2 Soft RAID Configuration


The purpose of RAID (redundant array of independent disks) is to combine several
hard disk partitions into one large virtual hard disk to optimize performance, data secu-
rity, or both. Most RAID controllers use the SCSI protocol because it can address a

Advanced Disk Setup 119


larger number of hard disks in a more effective way than the IDE protocol and is more
suitable for parallel processing of commands. There are some RAID controllers that
support IDE or SATA hard disks. Soft RAID provides the advantages of RAID systems
without the additional cost of hardware RAID controllers. However, this requires some
CPU time and has memory requirements that make it unsuitable for real high perfor-
mance computers.

7.2.1 RAID Levels


SUSE® Linux Enterprise offers the option of combining several hard disks into one
soft RAID system with the help of YaST—a very reasonable alternative to hardware
RAID. RAID implies several strategies for combining several hard disks in a RAID
system, each with different goals, advantages, and characteristics. These variations are
commonly known as RAID levels.

Common RAID levels are:

RAID 0
This level improves the performance of your data access by spreading out blocks
of each file across multiple disk drives. Actually, this is not really a RAID, because
it does not provide data backup, but the name RAID 0 for this type of system has
become the norm. With RAID 0, two or more hard disks are pooled together. The
performance is very good, but the RAID system is destroyed and your data lost if
even one hard disk fails.

RAID 1
This level provides adequate security for your data, because the data is copied to
another hard disk 1:1. This is known as hard disk mirroring. If a disk is destroyed,
a copy of its contents is available on another one. All of them except one could be
damaged without endangering your data. However, if damage is not detected, it
also may happen that damaged data is mirrored to the correct disk and data corrup-
tion happens that way. The writing performance suffers a little in the copying process
compared to when using single disk access (10 to 20 % slower), but read access is
significantly faster in comparison to any one of the normal physical hard disks,
because the data is duplicated so can be parallel scanned. Generally it can be said
that Level 1 provides nearly twice the read transaction rate of single disks and almost
the same write transaction rate as single disks.

120 Installation and Administration


RAID 2 and RAID 3
These are not typical RAID implementations. Level 2 stripes data at the bit level
rather than the block level. Level 3 provides byte-level striping with a dedicated
parity disk and cannot service simultaneous multiple requests. Both levels are only
rarely used.

RAID 4
Level 4 provides block-level striping just like Level 0 combined with a dedicated
parity disk. In the case of a data disk failure, the parity data is used to create a re-
placement disk. However, the parity disk may create a bottleneck for write access.
Nevertheless, Level 4 is sometimes used.

RAID 5
RAID 5 is an optimized compromise between Level 0 and Level 1 in terms of
performance and redundancy. The hard disk space equals the number of disks used
minus one. The data is distributed over the hard disks as with RAID 0. Parity blocks,
created on one of the partitions, are there for security reasons. They are linked to
each other with XOR, enabling the contents to be reconstructed by the corresponding
parity block in case of system failure. With RAID 5, no more than one hard disk
can fail at the same time. If one hard disk fails, it must be replaced as soon as pos-
sible to avoid the risk of losing data.

Other RAID Levels


Several other RAID levels have been developed (RAIDn, RAID 10, RAID 0+1,
RAID 30, RAID 50, etc.), some of them being proprietary implementations created
by hardware vendors. These levels are not very widespread, so are not explained
here.

7.2.2 Soft RAID Configuration with YaST


The YaST soft RAID configuration can be reached from the YaST Expert Partitioner,
described in Section 8.5.7, “Using the YaST Partitioner” (page 149). This partitioning
tool enables you to edit and delete existing partitions and create new ones that should
be used with soft RAID. There, create RAID partitions by first clicking Create > Do
not format then selecting 0xFD Linux RAID as the partition identifier. For RAID 0 and
RAID 1, at least two partitions are needed—for RAID 1, usually exactly two and no
more. If RAID 5 is used, at least three partitions are required. It is recommended to
take only partitions of the same size. The RAID partitions should be stored on different
hard disks to decrease the risk of losing data if one is defective (RAID 1 and 5) and to

Advanced Disk Setup 121


optimize the performance of RAID 0. After creating all the partitions to use with RAID,
click RAID > Create RAID to start the RAID configuration.

In the next dialog, choose between RAID levels 0, 1, and 5 (see Section 7.2.1, “RAID
Levels” (page 120) for details). After Next is clicked, the following dialog lists all parti-
tions with either the “Linux RAID” or “Linux native” type (see Figure 7.6, “RAID
Partitions” (page 122)). No swap or DOS partitions are shown. If a partition is already
assigned to a RAID volume, the name of the RAID device (for example, /dev/md0)
is shown in the list. Unassigned partitions are indicated with “--”.

Figure 7.6 RAID Partitions

To add a previously unassigned partition to the selected RAID volume, first click the
partition then Add. At this point, the name of the RAID device is entered next to the
selected partition. Assign all partitions reserved for RAID. Otherwise, the space on the
partition remains unused. After assigning all partitions, click Next to proceed to the
settings dialog where you can fine-tune the performance (see Figure 7.7, “File System
Settings” (page 123)).

122 Installation and Administration


Figure 7.7 File System Settings

As with conventional partitioning, set the file system to use as well as encryption and
the mount point for the RAID volume. Checking Persistent Superblock ensures that
the RAID partitions are recognized as such when booting. After completing the confi-
guration with Finish, see the /dev/md0 device and others indicated with RAID in the
expert partitioner.

7.2.3 Troubleshooting
Check the file /proc/mdstats to find out whether a RAID partition has been de-
stroyed. In the event of a system failure, shut down your Linux system and replace the
defective hard disk with a new one partitioned the same way. Then restart your system
and enter the command mdadm /dev/mdX --add /dev/sdX. Replace 'X' with
your particular device identifiers. This integrates the hard disk automatically into the
RAID system and fully reconstructs it.

7.2.4 For More Information


Configuration instructions and more details for soft RAID can be found in the HOWTOs
at:

Advanced Disk Setup 123


• http://www.novell.com/documentation/sles10/stor_evms/
data/bookinfo.html

• /usr/share/doc/packages/mdadm/Software-RAID.HOWTO.html

• http://en.tldp.org/HOWTO/Software-RAID-HOWTO.html

Linux RAID mailing lists are also available, such as http://marc.theaimsgroup


.com/?l=linux-raid&r=1&w=2.

124 Installation and Administration


System Configuration with
YaST
In SUSE Linux Enterprise, YaST handles both the installation and configuration of
8
your system. This chapter describes the configuration of system components (hardware),
network access, and security settings, and administration of users. Find a short introduc-
tion to the text-based YaST interface in Section 8.12, “YaST in Text Mode” (page 179).
For a description of manual system configuration, see Section 19.3, “System Configu-
ration via /etc/sysconfig” (page 384).

Configure the system with YaST using various YaST modules. Depending on the
hardware platform and the installed software, there are different ways to access YaST
in the installed system.

In KDE or GNOME, start the YaST Control Center from the main menu. Before YaST
starts, you are prompted to enter the root password, because YaST needs system ad-
ministrator permissions to change the system files.

To start YaST from the command line, enter the commands su (for changing to the
user root) and yast2. To start the text version, enter yast instead of yast2. Also
use the command yast to start the program from one of the virtual consoles.

For hardware platforms that do not support a display device of their own and for remote
administration on other hosts, run YaST remotely. First, open a console on the host on
which to display YaST and enter the command
ssh -X root@<system-to-configure> to log in to the system to configure
as root and redirect the X server output to your terminal. Following the successful
SSH login, enter yast2 to start YaST in graphical mode.

System Configuration with YaST 125


To start YaST in text mode on another system, use
ssh root@<system-to-configure> to open the connection. Then start YaST
with yast.

To save time, the individual YaST modules can be started directly. To start a module,
enter yast2 module_name. View a list of all module names available on your
system with yast2 -l or yast2 --list. Start the network module, for example,
with yast2 lan.

8.1 YaST Language


To change the language of YaST, select System > Language Selection in the YaST
Control Center. Choose a language, exit the YaST Control Center, log out of the system,
then log in again. The next time you start YaST, the new language setting is used. This
also changes the language for the entire system.

If you need work in a different language but do not want to change the system language
setting, run the YaST with the LANG variable set to your preferred language. Use a long
language code in the format langcode_statecode. For example, for American
English, enter LANG="en_US" yast2.

This command starts YaST using the specified language. The language is only valid
for this YaST session. The language settings of the terminal, other users, and your
other sessions remain unchanged.

If you run YaST remotely over SSH, YaST uses the language settings of your local
system.

8.2 The YaST Control Center


When you start YaST in the graphical mode, the YaST Control Center, as shown in
Figure 8.1, “The YaST Control Center” (page 127), opens. The left frame contains the
available categories. When you click a category, its contents are listed in the right frame.
Then select the desired module. For example, if you select Hardware and click Sound
in the right frame, a configuration dialog opens for the sound card. The configuration
of the individual items usually consists of several steps. Press Next to proceed to the
following step.

126 Installation and Administration


The left frame of most modules displays the help text, which offers suggestions for
configuration and explains the required entries. To get help in modules without a help
frame, press F1 or choose Help. After selecting the desired settings, complete the pro-
cedure by pressing Accept on the last page of the configuration dialog. The configuration
is then saved.

Figure 8.1 The YaST Control Center

8.3 Software
8.3.1 Installing and Removing Software
To install, uninstall, and update software on your machine, use Software > Software
Management. This opens a package manager dialog as shown in Figure 8.2, “YaST
Package Manager” (page 128).

System Configuration with YaST 127


Figure 8.2 YaST Package Manager

In SUSE® Linux Enterprise, software is available in the form of RPM packages. Nor-
mally, a package contains everything needed for a program: the program itself, the
configuration files, and all documentation. A list of individual packages is displayed
to the right in the individual package window. The content of this list is determined by
the currently selected filter. If, for example, the Patterns filter is selected, the individual
package window displays all packages of the current selection.

In the package manager, each package has a status that determines what to do with the
package, such as “Install” or “Delete.” This status is shown by a symbol in a status box
at the beginning of the line. Change the status by clicking or selecting the desired status
from the menu that opens when the item is right-clicked. Depending on the current sit-
uation, some of the possible status flags may not be available for selection. For example,
a package that has not yet been installed cannot be set to “Delete.” View the available
status flags with Help > Symbols.

The font color used for various packages in the individual package window provides
additional information. Installed packages for which a newer version is available on
the installation media are displayed in blue. Installed packages whose version numbers
are higher than those on the installation media are displayed in red. However, because
the version numbering of packages is not always linear, the information may not be

128 Installation and Administration


perfect, but should be sufficient to indicate problematic packages. If necessary, check
the version numbers.

Installing Packages
To install packages, select packages for installation and click Accept. Selected packages
should have the Install status icon. The package manager automatically checks the de-
pendencies and selects any other required packages (resolution of dependencies). To
view other packages required for installation before clicking Accept, choose Extras >
Show Automatic Package Changes from the main menu. After installing packages,
continue working with the package manager by clicking Install More or close it by
clicking Finish.

The package manager provides preselected groups for installation. You can select an
entire group instead of single packages. To view these groups, use Filter in the left
frame.

TIP: List of All Available Packages

To display all packages on your installation media, use the filter Package Groups
and select zzz All at the bottom of the tree. SUSE Linux Enterprise contains a
number of packages and it might take some time to display this long list.

Installing and Removing Patterns


The Patterns filter groups the program packages according to application purpose, such
as file or print server. The various groups of the Patterns filter are listed with the installed
packages preselected.

Click the status box at the beginning of a line to install or uninstall this pattern. Select
a status directly by right-clicking the pattern and using the context menu. From the in-
dividual package overview to the right, which displays the packages included in the
current pattern, select and deselect individual packages.

Installing and Removing Language Support


To find language-specific packages, such as translated texts for the user interface of
programs, documentation, and fonts, use the Languages filter. This filter shows a list

System Configuration with YaST 129


of all languages supported by SUSE Linux Enterprise. If you select one of these, the
right frame shows all packages available for this language. Among these, all packages
applying to your current software selection are automatically tagged for installation.

To uninstall a language from your system, select a language from the language list and
uncheck the status box at the beginning of a line.

NOTE

Because language-specific packages may depend on other packages, the package


manager may select additional packages for installation.

Packages and Installation Sources


If you want to find only packages from the specific source, use the Installation Sources
filter. In the default configuration, this filter shows a list of all packages from the selected
source. To restrict the list, use a secondary filter.

To view a list of the all installed packages from the selected installation source, select
the filter Installation Sources then select Installation Summary from Secondary Filters
and deactivate all check boxes except Keep.

The package status in the individual package window can be changed as usual. However,
the changed package may no longer meet the search criteria. To remove such packages
from the list, update the list with Update List.

Installing Source Packages


A package containing the source files for the program is usually available. The sources
are not needed for running the program, but you may want to install the sources to
compile a custom version of the program.

To install sources for selected program, mark the check box in the Source column. If
you cannot see a check box, your installation sources do not contain the source of the
package.

130 Installation and Administration


Saving the Package Selection
If you want to install the same packages on several computers, you can save your con-
figuration to file and use it for other systems. To save your package selection, choose
File > Export from the menu. To import a prepared selection, use File > Import.

IMPORTANT: Hardware Compatibility

Because this function saves the exact package list, it is only reliable when the
hardware is identical on the source and target systems. For more complicated
situations, AutoYaST, described in Chapter 5, Automated Installation (page 81),
may be a better choice.

Removing Packages
To remove packages, assign the correct status to the packages to remove and click Ac-
cept. Selected packages should have the Delete status. If a package required by other
installed packages is marked for deletion, the package manager issues an alert with
detailed information and alternative solutions.

Reinstalling Packages
If you find damaged files that belong to package or you want to reinstall the original
version of a package from your installation media, reinstall the package. To reinstall
packages, select packages for reinstallation and click Accept. Selected packages should
have the Update status. If any dependency issues arise with installed packages, the
package manager issues an alert with detailed information and alternative solutions.

Searching for Packages, Applications, and Files


To find a specific package, use the Search filter. Enter a search string and click Search.
By specifying various search criteria, you can restrict the search to display a few or
even only one package. You can also define special search patterns using wild cards
and regular expressions in Search Mode.

System Configuration with YaST 131


TIP: Quick Search

In addition to the Search filter, all lists of the package manager feature a quick
search. Simply enter a letter to move the cursor to the first package in the list
whose name begins with this letter. The cursor must be in the list (by clicking
the list).

To find a package by name, select Name, enter the name of the package to find in the
search field, and click Search. To find a package by text in the description, select
Summary and Descriptions, enter a search string, and click Search.

To search for the package that contains a certain file, enter the name of the file, select
RPM "Provides", and click Search. To find all packages that depend on a particular
package, select RPM "Requires", enter the name of package, and click Search.

If you are familiar with the package structure of SUSE Linux Enterprise, you can use
the Package Groups filter to find packages by subject. This filter sorts the program
packages by subjects, such as applications, development, and hardware, in a tree
structure to the left. The more you expand the branches, the more specific the selection
is. This means fewer packages are displayed in the individual package window.

Installation Summary
After selecting the packages for installation, update, or deletion, view the installation
summary with Installation Summary. It shows how packages will be affected when you
click Accept. Use the check boxes to the left to filter the packages to view in the indi-
vidual package window. For example, to check which packages are already installed,
deactivate all check boxes except Keep.

The package status in the individual package window can be changed as usual. However,
the respective package may no longer meet the search criteria. To remove such packages
from the list, update the list with Update List.

Information about Packages


Get information about the selected package with the tabs in the bottom right frame. If
another version of the package is available, you get information about both versions.

132 Installation and Administration


The Description tab with the description of the selected package is automatically active.
To view information about package size, version, installation media, and other technical
details, select Technical Data. Information about provided and required files is in De-
pendencies. To view available versions with their installation sources, click Versions.

Disk Usage
During the selection of the software, the resource window at the bottom left of the
module displays the prospective disk usage of all mounted file systems. The colored
bar graph grows with every selection. As long as it remains green, there is sufficient
space. The bar color slowly changes to red as you approach the limit of disk space. If
you select too many packages for installation, an alert is displayed.

Checking Dependencies
Some packages depend on other packages. This means that the software of the package
only works properly if another package is also installed. There are some packages with
identical or similar functionality. If these packages use the same system resource, they
should not be installed at the same time (package conflict).

When the package manager starts, it examines the system and displays installed pack-
ages. When you select to install and remove packages, the package manager can auto-
matically check the dependencies and select any other required packages (resolution
of dependencies). If you select or deselect conflicting packages, the package manager
indicates this and submits suggestions for solving the problem (resolution of conflicts).

To activate the automatic dependency check, select Autocheck, located under the infor-
mation window. With Autocheck activated, any change of a package status triggers an
automatic check. This is a useful feature, because the consistency of the package selec-
tion is monitored permanently. However, this process consumes resources and can slow
down the package manager. For this reason, the automatic check is not activated by
default. Regardless of the state of Autocheck, a consistency check is performed when
you confirm your selection with Accept.

If you click Check, located under the information window, the package manager checks
if the current package selection results in any unresolved package dependencies or
conflicts. In the event of unresolved dependencies, the required additional packages
are selected automatically. For package conflicts, the package manager opens a dialog
that shows the conflict and offers various options for solving the problem.

System Configuration with YaST 133


For example, sendmail and postfix may not be installed concurrently. Figure 8.3,
“Conflict Management of the Package Manager” (page 134) shows the conflict message
prompting you to make a decision. postfix is already installed. Accordingly, you
can refrain from installing sendmail, remove postfix, or take the risk and ignore
the conflict.

WARNING: Handling Package Conflicts

Unless you are very experienced, follow the suggestions of YaST when handling
package conflicts, because otherwise the stability and functionality of your
system could be endangered by the existing conflict.

Figure 8.3 Conflict Management of the Package Manager

Installing -devel Packages


The package manager provides functions for quick and easy installation of devel and
debug packages. To install all devel packages for your installed system, choose Extras
> Install All Matching — -devel Packages. To install all debug packages for your in-
stalled system, choose Extras > Install All Matching — -debuginfo Packages.

134 Installation and Administration


8.3.2 Installing Add-On Products
Add-on products are extensions for your system. You can install a third party add-on
product or a special extension of your SUSE Linux Enterprise, for example, the SDK
add-on or a CD with binary drivers. To install a new add-on, use Software > Add-On
Product. You can select various types of product media, like CD, FTP or local directory.
You can work also directly with ISO files. To add an add-on as ISO file media, select
Local Directory then choose ISO Images.

After successfully adding the add-on media, the package manager window appears. If
the add-on provides a new pattern, see the new item in the Patterns filter. To view the
list of all packages from the selected installation source, select the filter Installation
Sources and choose the installation source to view. To view packages from a selected
add-on by package groups, select the secondary filter Package Groups.

TIP: Creating Custom Add-On Products

Create your own add-on products with YaST Add-On Creator. Read about the
YaST add-on creator at http://developer.novell.com/wiki/index
.php/Creating_Add-On_Media_with_YaST. Find technical background
information at http://developer.novell.com/wiki/index.php/
Creating_Add-Ons.

8.3.3 Selecting the Installation Source


You can use multiple installation sources of several types. Select them and enable their
use for installation or update using Software > Installation Source. For example, you
can specify SUSE Software Development Kit as an installation source. When started,
it displays a list of all previously registered sources. Following a normal installation
from CD, only the installation CD is listed. Click Add to include additional sources in
this list. Sources can be CDs, DVDs, or network sources, such as NFS and FTP servers.
Even directories on the local hard disk can be selected as the installation medium. See
the detailed YaST help text for more details.

All registered sources have an activation status in the first column of the list. Enable
or disable individual installation sources by clicking Activate or Deactivate. During
the installation of software packages or updates, YaST selects a suitable entry from the
list of activated installation sources. When you exit the module with Close, the current

System Configuration with YaST 135


settings are saved and applied to the configuration modules Software Management and
System Update.

8.3.4 Registering SUSE Linux Enterprise


To get technical support and product updates, your system must be registered and acti-
vated. If you skipped the registration during installation, register with the help of the
Novell Customer Center Configuration module from Software. This dialog is the same
as that described in Section 3.11.4, “Customer Center” (page 35).

8.3.5 YaST Online Update


Install important updates and improvements with YaST Online Update. The current
patches for your SUSE Linux Enterprise product are available from the SUSE Linux
Enterprise catalogs. To add or remove catalogs, use the Software > Installation Source
module, described in Section 8.3.3, “Selecting the Installation Source” (page 135).

NOTE

Before starting the update of SUSE Linux Enterprise, configure the Novell Cus-
tomer Center. This is described in Section 3.11.4, “Customer Center” (page 35).

To install updates and improvements with YaST, run Software > Online Update. All
new patches (except the optional ones) that are currently available for your system are
already marked for installation. Clicking Accept automatically installs these patches.
After the installation has completed, confirm with Finish. Your system is now up-to-
date.

TIP

YaST Online Update has been integrated into the YaST software management
module. This ensures that the newest version of a package is always installed.
It is no longer necessary to run an online update after installing new packages.

136 Installation and Administration


Installing Patches Manually
The Online Update window consists of five sections. The list of all patches available
is on the left. Find the description of the selected patch displayed below the list of
patches. The disk usage is displayed at the bottom of the left column. The right column
lists the packages included in the selected patch (a patch can consist of several packages)
and, below, a detailed description of the selected package.

Figure 8.4 YaST Online Update

The patch display lists all patches available for SUSE Linux Enterprise. A list entry
consists of a symbol and the patch name. For a list of possible symbols, press Shift +
F1. New patches that are not yet installed are marked with a small arrow in front of the
symbol. Patches that are already installed are marked with the Keep symbol. Patches
on packages that are not installed are marked with an empty box.

The patches are sorted by security level. The color of the patch name and a tool tip in-
dicate the security status of the patch: Security (red), Recommended (blue), or
Optional (black).

Selected new patches are marked with the symbol Install (if this is the first patch
with this name) or Update (when previous patches with this name already have been
installed). To change the status, right-click a patch and choose an action from the list.

System Configuration with YaST 137


Most patches include updates for several packages. To change actions for single pack-
ages, right-click a package in the package window and choose an action. Once you
have marked all patches and packages as desired, proceed with Accept.

Another alternative for updating software is the ZENworks updater applet for KDE and
GNOME. The ZENworks updater helps monitor new patches. It also provides a quick
update function. For more information, refer to Section 9.2, “Managing Packages with
the ZEN Tools” (page 197).

8.3.6 Automatic Online Update


YaST also offers the possibility to set up an automatic update. Select Software > Auto-
matic Online Update. Configure a Daily or a Weekly update. Some patches, such as
kernel updates, require user interaction, which would cause the automatic update pro-
cedure to stop. Check Skip Interactive Patches for the update procedure to proceed au-
tomatically. In this case, run a manual Online Update from time to install patches that
require interaction.

When Only Download Patches is checked, the patches are downloaded at the specified
time but not installed. They must be installed manually. The patches are downloaded
to the rug cache directory, /var/cache/zmd/web, by default. Use the command
rug get-prefs cache-directory to get the current rug cache directory. For
more information about rug, see Section 9.1, “Managing Packages from the Command
Line with rug” (page 194).

8.3.7 Updating from a Patch CD


The Patch CD Update module from the Software section installs patches from CD, not
from an FTP server. The advantage lies in a much faster update with CD. After the
patch CD is inserted, all patches on the CD are displayed in the dialog. Select the desired
packages for installation from the list of patches. The module issues an error message
if no patch CD is present. Insert the patch CD then restart the module.

8.3.8 Updating the System


Update the version of SUSE Linux Enterprise installed on your system with Software
> System Update. During operation, you can only update application software, not the

138 Installation and Administration


base system. To update the base system, boot the computer from an installation medium,
such as CD. When selecting the installation mode in YaST, select Update.

The procedure for updating the system is similar to a new installation. Initially, YaST
examines the system, determines a suitable update strategy, and presents the results in
a suggestion dialog. Click Change or the individual items to change any details.

Update Options
Set the update method for your system. Two options are available.

Update with Installation of New Software and Features Based on the Selection
To update the entire system to the latest versions of software, select one of the
predefined selections. These selections ensure that packages that did not exist pre-
viously are also installed.

Only Update Installed Packages


This option merely updates packages that already exist on the system. No new
features are installed.

Additionally, you can use Delete Outdated Packages to remove packages that do not
exist in the new version. By default, this option is preselected to prevent outdated
packages from unnecessarily occupying hard disk space.

Packages
Click Packages to start the package manager and select or deselect individual packages
for update. Any package conflicts should be resolved with the consistency check. The
use of the package manager is covered in detail in Section 8.3.1, “Installing and Remov-
ing Software” (page 127).

Backup
During the update, the configuration files of some packages may be replaced by those
of the new version. Because you may have modified some of the files in your current
system, the package manager normally makes backup copies of the replaced files. With
this dialog, determine the scope of these backups.

System Configuration with YaST 139


IMPORTANT: Scope of the Backup

This backup does not include the software. It only contains configuration files.

Language
Primary and other languages currently installed on the system are listed here. Change
them by clicking Language in the displayed configuration or with Change > Language.
Optionally, adapt the keyboard layout and time zone to the region where the primary
language is spoken. Find more about language selection in Section 8.5.15, “Language
Selection” (page 158).

Important Information about Updates


The system update is a very complex procedure. For each program package, YaST must
first check which version is installed on the computer then determine what needs to be
done to replace the old version with the new version correctly. YaST also tries to adopt
any personal settings of the installed packages.

In most cases, YaST replaces old versions with new ones without problems. A backup
of the existing system should be performed prior to updating to ensure that existing
configurations are not lost during the update. Conflicts can then be resolved manually
after the update has finished.

8.3.9 Installing into a Directory


This YaST module allows you to install packages into a directory specified by you.
Select where to place the root directory, how to name directories, and the type of system
and software to install. After entering this module, YaST determines the system settings
and lists the default directory, installation instructions, and software to install. Edit
these settings by clicking Change. All changes must be confirmed by clicking Accept.
After changes have been made, click Next until informed that the installation is complete.
Click Finish to exit the dialog.

140 Installation and Administration


8.3.10 Checking Media
If you encounter any problems using the SUSE Linux Enterprise installation media,
you can check the CDs or DVDs with Software > Media Check. Media problems are
more likely to occur with media you burn yourself. To check that a SUSE Linux Enter-
prise CD or DVD is error-free, insert the medium into the drive and run this module.
Click Start for YaST to check the MD5 checksum of the medium. This may take several
minutes. If any errors are detected, you should not use this medium for installation.

8.4 Hardware
New hardware must first be installed or connected as directed by the vendor. Turn on
external devices and start the appropriate YaST module. Most devices are automatically
detected by YaST and the technical data is displayed. If the automatic detection fails,
YaST offers a list of devices (model, vendor, etc.) from which to select the suitable
device. Consult the documentation enclosed with your hardware for more information.

IMPORTANT: Model Designations

If your model is not included in the device list, try a model with a similar des-
ignation. However, in some cases the model must match exactly, because sim-
ilar designations do not always indicate compatibility.

8.4.1 Infrared Device


Configure an infrared device with Hardware > Infrared Device. Click Start IrDa to
begin configuration. You can configure Port and Limit Baud Rate here.

8.4.2 Graphics Card and Monitor


Configure graphics cards and monitors with Hardware > Graphics Card and Monitor.
It uses the the SaX2 interface, described in Section 8.14, “SaX2” (page 186).

System Configuration with YaST 141


8.4.3 Printer
Configure a printer with Hardware > Printer. If a printer is properly connected to the
system, it should be detected automatically. Find detailed instructions for configuring
printers with YaST in Section 23.4, “Setting Up a Printer” (page 439).

8.4.4 Hard Disk Controller


Normally, the hard disk controller of your system is configured during the installation.
If you add controllers, integrate these into the system with Hardware > Disk Controller.
You can also modify the existing configuration, but this is generally not necessary.

The dialog presents a list of detected hard disk controllers and enables assignment of
the suitable kernel module with specific parameters. Use Test Loading of Module to
check if the current settings work before they are saved permanently in the system.

WARNING: Configuration of the Hard Disk Controller

It is advised to test the settings before making them permanent in the system.
Incorrect settings can prevent the system from booting.

8.4.5 Hardware Information


Display detected hardware and technical data using Hardware > Hardware Information.
Click any node of the tree for more information about a device. This module is especially
useful, for example, when submitting a support request for which you need information
about your hardware.

Save the hardware information displayed to a file by clicking Save to File. Select the
desired directory and filename then click Save to create the file.

8.4.6 IDE DMA Mode


Activate and deactivate the DMA mode for your IDE hard disks and your IDE CD and
DVD drives in the installed system with Hardware > IDE DMA Mode. This module

142 Installation and Administration


does not have any effect on SCSI devices. DMA modes can substantially increase the
performance and data transfer speed in your system.

During installation, the current SUSE Linux Enterprise kernel automatically activates
DMA for hard disks but not for CD drives, because default DMA activation for all
drives often causes problems with CD drives. Use the DMA module to activate DMA
for your drives. If the drive supports the DMA mode without any problems, the data
transfer rate of your drive can be increased by activating DMA.

NOTE

DMA (direct memory access) means that your data can be transferred directly
to the RAM, bypassing the processor control.

8.4.7 IBM System z: DASD Devices


To add a DASD to the installed system, there are two possibilities:

YaST
To add a DASD to an installed system, use the YaST DASD module (Hardware
> DASD). In the first screen, select the disks to make available to your Linux instal-
lation and click Perform Action. Select Activate then leave the dialog with Next.

Command Line
Issue the following command:

dasd_configure 0.0.0150 1 0

Replace 0.0.0150 with the actual channel number to which the DASD is attached.
The last zero of the command line should be 1 if the DASD should be accessed in
DIAG mode.

NOTE

In either case, you must run the commands

mkinitrd
zipl

System Configuration with YaST 143


to make the changes persistent.

8.4.8 IBM System z: ZFCP


To add further FCP-attached SCSI devices to the installed system, use the YaST ZFCP
module (Hardware > ZFCP). Select Add to add an additional device. Select the Channel
Number (adapter) from the list and specify both WWPN and FCP-LUN. Finalize the
setup by selecting Next and Close. Verify that the device has been added by checking
the output of cat /proc/scsi/scsi.

NOTE

To make the changes persistent through a reboot, run the following commands:

mkinitrd
zipl

8.4.9 Joystick
Configure a joystick connected to the sound card with Hardware > Joystick. Select
your joystick type in the list provided. If your joystick is not listed, select Generic
Analog Joystick. After selecting your joystick, make sure that it is connected then click
Test to test the functionality. Click Continue and YaST installs the required files. After
the Joystick Test window appears, test the joystick by moving it in all directions and
pressing all buttons. Each movement should be displayed in the window. If you are
satisfied with the settings, click OK to return to the module and Finish to complete
configuration.

If you have a USB device, this configuration is not necessary. Plug in the joystick and
start using it.

8.4.10 Keyboard Layout


To configure the keyboard for the console, run YaST in text mode then use Hardware
> Keyboard Layout. After clicking the module, the current layout is displayed. To

144 Installation and Administration


choose another keyboard layout, select the desired layout from the list provided. Test
the layout in Test by pressing keys on the keyboard.

Fine-tune the settings by clicking Expert Settings. Adjust the key repeat rate and delay
and configure the start-up state by choosing the desired settings in Start-Up States. For
Devices to Lock, enter a space-separated list of devices to which to apply the Scroll
Lock, Num Lock, and Caps Lock settings. Click OK to complete the fine-tuning. Finally,
after all selections have been made, click Accept for your changes to take effect.

To set up the keyboard for the graphical environment, run the graphical YaST then select
Keyboard Layout. Find information about the graphical configuration in Section 8.14.3,
“Keyboard Properties” (page 190).

8.4.11 Mouse Model


When configuring the mouse for the graphical environment, click Mouse Model to access
the SaX2 mouse configuration. Refer to Section 8.14.2, “Mouse Properties” (page 189)
for details.

To configure your mouse for the text environment, use YaST in text mode. After entering
text mode and selecting Hardware > Mouse Model, use the keyboard arrow keys to
choose your mouse from the provided list. Then click Accept to save the settings and
exit the module.

8.4.12 Sound
Most sound cards are detected automatically and configured with reasonable values
during initial installation. To install a card added later or modify settings, use Hardware
> Sound. It is also possible to switch the sequence of the cards.

System Configuration with YaST 145


Figure 8.5 Sound Configuration

If YaST cannot detect your sound card automatically, proceed as follows:

1 Click Add to open a dialog in which to select a sound card vendor and model.
Refer to your sound card documentation for the information required. Find a
reference list of sound cards supported by ALSA with their corresponding sound
modules in /usr/share/doc/packages/alsa/cards.txt and at
http://www.alsa-project.org/alsa-doc/. After making your se-
lection, click Next.

2 In Sound Card Configuration, choose the configuration level in the first setup
screen:

Quick automatic setup


You are not required to go through any of the further configuration steps
and no sound test is performed. The sound card is configured automatically.

Normal setup
Adjust the output volume and play a test sound.

Advanced setup with possibility to change options


Customize all settings manually.

146 Installation and Administration


In this dialog, there is also a shortcut to the joystick configuration. Click Joystick
configuration and select the joystick type in the following dialog to configure a
joystick. Click Next to continue.

3 In Sound Card Volume, test your sound configuration and make adjustments to
the volume. You should start at about ten percent to avoid damage to your hearing
or the speakers. A test sound should be audible when you click Test. If you cannot
hear anything, increase the volume. Press Next > Finish to complete the sound
configuration.

To change the configuration of a sound card, go to the Sound Configuration dialog,


select a displayed Card Model, and click Edit. Use Delete to remove a sound card
completely.

Click Other to customize one of the following options manually:

Volume
Use this dialog for setting the volume.

Start Sequencer
For playback of MIDI files, check this option.

Set as Primary Card


Click Set as Primary Card to adjust the sequence of your sound cards. The sound
device with index 0 is the default device used by the system and the applications.

The volume and configuration of all sound cards installed are saved when you click
Finish in the YaST sound module. The mixer settings are saved to the file /etc/
asound.conf and the ALSA configuration data is appended to the end of the files
/etc/modprobe.d/sound and /etc/sysconfig/hardware.

8.5 System
This group of modules is designed to help you manage your system. All modules in
this group are system-related and serve as valuable tools for ensuring that your system
runs properly and your data is managed efficiently.

System Configuration with YaST 147


TIP: IBM System z: Continuing

For IBM System z, continue with Section 8.5.3, “Boot Loader Configuration”
(page 149).

8.5.1 Backup
Create a backup of both your system and data using System > System Backup. However,
the backup created by the module does not include the entire system. The system is
backed up by saving important storage areas on your hard disk that may be crucial when
trying to restore a system, such as the partition table or master boot record (MBR). It
can also include the XML configuration acquired from the installation of the system,
which is used for AutoYaST. Data is backed up by saving changed files of packages
accessible on installation media, entire packages that are unaccessible (such as online
updates), and files not belonging to packages, such as many of the configuration files
in /etc or the directories under /home.

8.5.2 Restoration
With System > System Restoration, restore your system from a backup archive created
with System Backup. First, specify where the archives are located (removable media,
local hard disks, or network file systems). Click Next to view the description and contents
of the individual archives and select what to restore from the archives.

You can also uninstall packages that were added since the last backup and reinstall
packages that were deleted since the last backup. These two steps enable you to restore
the exact system state at the time of the last backup.

WARNING: System Restoration

Because this module normally installs, replaces, or uninstalls many packages


and files, use it only if you have experience with backups. Otherwise you may
lose data.

148 Installation and Administration


8.5.3 Boot Loader Configuration
To configure booting for systems installed on your computer, use the System > Boot
Loader module. A detailed description of how to configure the boot loader with YaST
is available in Section 20.3, “Configuring the Boot Loader with YaST” (page 398).

8.5.4 Clustering
Find information about Heartbeat and high availability configuration with YaST in
Heartbeat Guide.

8.5.5 LVM
The logical volume manager (LVM) is a tool for custom partitioning of hard disks with
logical drives. Find information about LVM in Section 7.1, “LVM Configuration”
(page 111).

8.5.6 EVMS
The enterprise volume management system (EVMS) is, like LVM, a tool for custom
partitioning and grouping of hard disks into virtual volumes. It is flexible, extensible,
and can be tailored using a plug-in model to individual needs of various volume man-
agement systems.

EVMS is compatible with existing memory and volume management systems, like
DOS, Linux LVM, GPT (GUID partition table), IBM System z, Macintosh, and BSD
partitions. More information is provided at http://evms.sourceforge.net/.

8.5.7 Using the YaST Partitioner


With the expert partitioner, shown in Figure 8.6, “The YaST Partitioner” (page 150),
manually modify the partitioning of one or several hard disks. Partitions can be added,
deleted, resized, and edited. Also access the soft RAID, EVMS, and LVM configuration
from this YaST module.

System Configuration with YaST 149


WARNING: Repartitioning the Running System

The risk of making a mistake that causes data loss is very high. Before modifying
partitions in the installed system, back up your data.

Figure 8.6 The YaST Partitioner

TIP: IBM System z: Device Names

IBM System z recognize only DASD and SCSI hard disks. IDE hard disks are not
supported. This is why these devices appear in the partition table as dasda or
sda for the first recognized device.

All existing or suggested partitions on all connected hard disks are displayed in the list
of the YaST Expert Partitioner dialog. Entire hard disks are listed as devices without
numbers, such as /dev/hda or /dev/sda (or /dev/dasda). Partitions are listed
as parts of these devices, such as /dev/hda1 or /dev/sda1 (or /dev/dasda1,
respectively). The size, type, file system, and mount point of the hard disks and their
partitions are also displayed. The mount point describes where the partition appears in
the Linux file system tree.

150 Installation and Administration


If you run the expert dialog during installation, any free hard disk space is also listed
and automatically selected. To provide more disk space to SUSE Linux Enterprise®,
free the needed space starting from the bottom toward the top of the list (starting from
the last partition of a hard disk toward the first). For example, if you have three partitions,
you cannot use the second exclusively for SUSE Linux Enterprise and retain the third
and first for other operating systems.

Partition Types
TIP: IBM System z: Hard Disks

On the IBM System z platforms, SUSE Linux Enterprise Server supports SCSI
hard disks as well as DASDs (direct access storage devices). While SCSI disks
can be partitioned as described here, DASDs can have no more than three
partition entries in their partition tables.

Every hard disk has a partition table with space for four entries. An entry in the partition
table can correspond to a primary partition or an extended partition. Only one extended
partition entry is allowed, however.

A primary partition simply consists of a continuous range of cylinders (physical disk


areas) assigned to a particular operating system. With primary partitions only, you are
limited to four partitions per hard disk, because more do not fit in the partition table.
This is why extended partitions are used. Extended partitions are also continuous ranges
of disk cylinders, but an extended partition may itself be subdivided into logical parti-
tions. Logical partitions do not require entries in the partition table. In other words, an
extended partition is a container for logical partitions.

If you need more than four partitions, create an extended partition as the fourth partition
or earlier. This extended partition should span the entire remaining free cylinder range.
Then create multiple logical partitions within the extended partition. The maximum
number of logical partitions is 15 on SCSI, SATA, and FireWire disks and 63 on (E)IDE
disks. It does not matter which types of partitions are used for Linux. Primary and log-
ical partitions both work fine.

TIP: Hard Disks with a GPT Disk Label

For architectures using the GPT disk label, the number of primary partitions is
not restricted. Consequently, there are no logical partitions.

System Configuration with YaST 151


Creating a Partition
To create a partition from scratch, proceed as follows:

1 Select Create. If several hard disks are connected, a selection dialog appears in
which to select a hard disk for the new partition.

2 Specify the partition type (primary or extended). Create up to four primary parti-
tions or up to three primary partitions and one extended partition. Within the
extended partition, create several logical partitions (see Section “Partition Types”
(page 151)).

3 Select the file system to use and a mount point. YaST suggests a mount point
for each partition created. Refer to Chapter 25, File Systems in Linux (page 469)
for details on the various file systems.

4 Specify additional file system options if your setup require them. For details of
the options available, refer to Section “Editing a Partition” (page 152).

5 Click OK > Apply to apply your partitioning setup and leave the partitioning
module.

If you created the partition during installation, you are returned to the installation
overview screen.

Editing a Partition
When you create a new partition or modify an existing partition, set various parameters.
For new partitions, suitable parameters are set by YaST and usually do not require any
modification. To edit your partition setup manually, proceed as follows:

1 Select the partition.

2 Click Edit to edit the partition and set the parameters:

File System ID
Even if you do not want to format the partition at this stage, assign it a file
system ID to ensure that the partition is registered correctly. Possible values
include Linux, Linux swap, Linux LVM, Linux EVMS, and Linux RAID. For

152 Installation and Administration


LVM and RAID details, refer to Section 7.1, “LVM Configuration” (page 111)
and Section 7.2, “Soft RAID Configuration” (page 119).

File System
Change the file system or format the partition here. File system changes or
partition reformats irreversibly delete all data from the partition. For details
of the various file systems, refer to Chapter 25, File Systems in Linux
(page 469).

File System Options


Set various parameters for the selected file system here. The defaults are
acceptable for most situations.

Encrypt File System


If you activate the encryption, all data is written to the hard disk in encrypted
form. This increases the security of sensitive data, but slightly reduces the
system speed, because the encryption takes some time. More information
about the encryption of file systems is provided in Chapter 47, Encrypting
Partitions and Files (page 861).

Fstab Options
Here, specify various parameters for the administration file of the file systems
(/etc/fstab). For example, change the file system identification from
the device name, which is default, to a volume label. In the volume label,
you can use all characters except / and space.

Mount Point
Specify the directory at which the partition should be mounted in the file
system tree. Select from various YaST proposals or enter any other name.

3 Select OK > Apply to activate the partition.

Expert Options
Expert opens a menu containing the following commands:

Reread Partition Table


Rereads the partitioning from disk. For example, you need this after manual parti-
tioning in the text console.

System Configuration with YaST 153


Delete Partition Table and Disk Label
This completely overwrites the old partition table. For example, this can be helpful
if you have problems with unconventional disk labels. Using this method, all data
on the hard disk is lost.

More Partitioning Tips


If the partitioning is performed by YaST and other partitions are detected in the system,
these partitions are also entered in the file /etc/fstab to enable easy access to this
data. This file contains all partitions in the system with their properties, such as the file
system, mount point, and user permissions.

Example 8.1 /etc/fstab: Partition Data

/dev/sda1 /data1 auto noauto,user 0 0


/dev/sda5 /data2 auto noauto,user 0 0
/dev/sda6 /data3 auto noauto,user 0 0

The partitions, regardless of whether they are Linux or FAT partitions, are specified
with the options noauto and user. This allows any user to mount or unmount these
partitions as needed. For security reasons, YaST does not automatically enter the exec
option here, which is needed for executing programs from the location. However, to
run programs from there, you can enter this option manually. This measure is necessary
if you encounter system messages such as “bad interpreter” or “Permission denied”.

Partitioning and LVM


From the expert partitioner, access the LVM configuration with LVM (see Section 7.1,
“LVM Configuration” (page 111)). However, if a working LVM configuration already
exists on your system, it is automatically activated as soon as you enter the LVM con-
figuration for the first time in a session. In this case, any disks containing a partition
belonging to an activated volume group cannot be repartitioned because the Linux
kernel cannot reread the modified partition table of a hard disk when any partition on
this disk is in use. However, if you already have a functioning LVM configuration on
your system, physical repartitioning should not be necessary. Instead, change the con-
figuration of the logical volumes.

At the beginning of the physical volumes (PVs), information about the volume is written
to the partition. To reuse such a partition for other non-LVM purposes, it is advisable

154 Installation and Administration


to delete the beginning of this volume. For example, in the VG system and PV /dev/
sda2, do this with the command dd if=/dev/zero of=/dev/sda2 bs=512
count=1.

WARNING: File System for Booting

The file system used for booting (the root file system or /boot) must not be
stored on an LVM logical volume. Instead, store it on a normal physical partition.

8.5.8 PCI Device Drivers


TIP: IBM System z: Continuing

For IBM System z, continue with Section 8.5.12, “System Services (Runlevel)”
(page 157).

Each kernel driver contains a list of device IDs of all devices it supports. If a new device
is not in any driver's database, the device is treated as unsupported, even if it can be
used with an existing driver. With this YaST module from System section, you can add
PCI IDs. Only advanced users should attempt to use this YaST module.

System Configuration with YaST 155


Figure 8.7 Adding a PCI ID

To add an ID, click Add and select how to assign it: by selecting a PCI device from a
list or by manually entering PCI values. In the first option, select the PCI device from
the provided list then enter the driver or directory name. If the directory is left empty,
the driver name is used as the directory name. When assigning PCI ID values manually,
enter the appropriate data to set up a PCI ID. Click OK to save your changes.

To edit a PCI ID, select the device driver from the list and click Edit. Edit the information
and click OK to save your changes. To delete an ID, select the driver and click Delete.
The ID immediately disappears from the list. When finished, click OK.

8.5.9 Power Management


The System > Power Management module helps you work with saving energy technolo-
gies. It is especially important on laptops to extend their operational time. Find detailed
information about using this module in Section 28.6, “The YaST Power Management
Module” (page 524).

156 Installation and Administration


8.5.10 Powertweak Configuration
Powertweak is a SUSE Linux utility for tweaking your system to peak performance by
tuning some kernel and hardware configurations. It should be used only by advanced
users. After starting it with System > Powertweak, it detects your system settings and
lists them in tree form in the left frame of the module. You can also use Search to find
a configuration variable. Select the option to tweak to display it on the screen along
with its directory and settings. To save the settings, click Finish then confirm it by
clicking OK.

8.5.11 Profile Manager


Create, manage, and switch among system configurations with System > Profile Man-
agement, the YaST system configuration profile management (SCPM) module. This
is especially useful for mobile computers that are used in different locations (in different
networks) and by different users. Nevertheless, this feature is useful even for stationary
machines, because it enables the use of various hardware components or test configura-
tions.

8.5.12 System Services (Runlevel)


Configure runlevels and the services that start in them with System > System Services
(Runlevel). For more information about the runlevels in SUSE Linux Enterprise and a
description of the YaST runlevel editor, refer to Section 19.2.3, “Configuring System
Services (Runlevel) with YaST” (page 382).

8.5.13 /etc/sysconfig Editor


The directory /etc/sysconfig contains the files with the most important settings
for SUSE Linux Enterprise. Use System > /etc/sysconfig Editor to modify the values
and save them to the individual configuration files. Generally, manual editing is not
necessary, because the files are automatically adapted when a package is installed or a
service is configured. More information about /etc/sysconfig and the YaST
sysconfig editor is available in Section 19.3.1, “Changing the System Configuration
Using the YaST sysconfig Editor” (page 384).

System Configuration with YaST 157


8.5.14 Time and Date Configuration
The time zone is initially set during installation, but you can change it with System >
Date and Time. Also use this to change the current system date and time.

To change the time zone, select the region in the left column and the location or time
zone in the right column. With Hardware Clock Set To, set whether the system clock
should use Local Time or UTC (Coordinated Universal Time). UTC is often used in
Linux systems. Machines with additional operating systems, such as Microsoft Windows,
mostly use local time.

Set the current system time and date with Change. In the dialog that opens, modify the
time and date by entering new values or adjusting them with the arrow buttons. Press
Apply to save the changes.

8.5.15 Language Selection


The primary and secondary languages for your system are set during installation.
However, they can be changed at any time using System > Language. The primary
language set in YaST applies to the entire system, including YaST and the desktop en-
vironment. This is the language you expect to use most of the time. Secondary languages
are languages that are sometimes needed by users for a variety of purposes, such as
desktop language or word processing.

158 Installation and Administration


Figure 8.8 Setting the Language

Select the main language to use for your system in Primary Language. To adjust the
keyboard or time zone to this setting, enable Adapt Keyboard Layout or Adapt Time
Zone.

Set how locale variables are set for the root user with Details. Also use Details to set
the primary language to a dialect not available in the main list. These settings are written
into the file /etc/sysconfig/language.

8.6 Network Devices


All network devices connected to the system must be initialized before they can be used
by a service. The detection and configuration of these devices is done in the module
group Network Devices.

8.6.1 DSL, ISDN, Modem, or Network Card


To configure a DSL, ISDN, or network interface or a modem, select the appropriate
module from the Network Devices section. For a device that is detected automatically,

System Configuration with YaST 159


select it from the list then click Edit. If your device has not been detected, click Add
and select it manually. To edit an existing device, select it then click Edit. For more
detailed information, see Section 30.4, “Configuring a Network Connection with YaST”
(page 560). For wireless network interfaces, see Chapter 29, Wireless Communication
(page 529).

TIP: CDMA and GPRS Modems

You can configure supported CDMA and GPRS modems as regular modems in
the YaST modem module.

8.7 Network Services


This group contains tools to configure all kinds of services in the network. These include
name resolution, user authentication, and file services.

8.7.1 Mail Transfer Agent


You can configure your mail settings in Network Services > Mail Transfer Agent if you
send your e-mail with sendmail, postfix, or the SMTP server of your provider. You can
fetch mail via the fetchmail program, for which you can also enter the details of the
POP3 or IMAP server of your provider. Alternatively, use a mail program of your
choice, such as KMail or Evolution, to set your access data. In this case, you do not
need this module.

To configure your mail with YaST, specify the type of your connection to the Internet
in the first dialog. Choose one of the following options:

Permanent
Select this option if you have a dedicated line to the Internet. Your machine is online
permanently, so no dial-up is required. If your system is part of a local network
with a central e-mail server, select this option to ensure permanent access to your
e-mail messages.

Dial-Up
This item is relevant for users who have a computer at home, are not located in a
network, and occasionally connect to the Internet.

160 Installation and Administration


No Connection
If you do not have access to the Internet and are not located in a network, you
cannot send or receive e-mail.

Activate virus scanning for your incoming and outgoing e-mail with AMaViS by select-
ing that option. The package is installed automatically as soon as you activate the mail
filtering feature. In the following dialogs, specify the outgoing mail server (usually the
SMTP server of your provider) and the parameters for incoming mail. Set the diverse
POP or IMAP servers for mail reception by various users. Using this dialog, you can
also assign aliases, use masquerading, or set up virtual domains. Click Finish to exit
the mail configuration.

8.7.2 Mail Server


IMPORTANT: LDAP-Based Mail Server Configuration

The mail server module of SUSE Linux Enterprise only works if the users, groups,
and the DNS and DHCP services are managed with LDAP.

The mail server module allows configuration of SUSE Linux Enterprise as a mail
server. YaST assists with the following steps of the configuration process:

Global Settings
Configures the identification of the local mail server and the maximum size of in-
coming or outgoing messages and the type of mail transport.

Local Delivery
Configures the type of local mail delivery.

Mail Transport
Configures special transport routes for mail depending on its target address.

SPAM Prevention
Configures the SPAM protection settings of the mail server. This activates the tool
AMaViS. Set up the type and strictness of the SPAM check.

Mail Server Relaying


Determines from which networks the mail server cannot be used for sending non-
local mail.

System Configuration with YaST 161


Fetching Mail
Configures mail pick-up from external mail accounts over various protocols.

Mail Server Domains


This determines for which domains the mail server should be responsible. At least
one master domain must be configured if the server should not run as a null client
used exclusively for sending mail without receiving any.

Distinguish among three domain types:

main
Main or master domain of the local mail server

local
All users who can receive mail in a master domain can also receive mail in a
local domain. In the case of a message within the local domain, only the portion
before the @ is evaluated.

virtual
Only users with an explicit address within a virtual domain receive mail. Vir-
tual mail addresses are set up in the user management module of YaST.

8.7.3 Other Available Services


Many other network modules are available in YaST Network Services.

DHCP Server
Use this to set up a custom DHCP server in only a few steps. Chapter 34, DHCP
(page 635) provides basic knowledge about the subject and a step-by-step description
of the configuration process.

DNS Server
Configuring a DNS server that is responsible for name resolution is recommended
for larger networks. You can use DNS Server for this as described in Section 33.2,
“Configuration with YaST” (page 610). Chapter 33, The Domain Name System
(page 609) provides background information about DNS.

DNS and Hostname


Use this module to configure the hostname and DNS if these settings were not al-
ready made while configuring the network devices. Also use it to change the host-

162 Installation and Administration


name and domain name. If the provider has been configured correctly for DSL,
modem, or ISDN access, the list of name servers contains the entries that were ex-
tracted automatically from the provider data. If you are located in a local network,
you might receive your hostname via DHCP, in which case you should not modify
the name.

HTTP Server
To run your own Web server, configure Apache in HTTP Server. Find more infor-
mation in Chapter 40, The Apache HTTP Server (page 737).

Hostnames
When booting and in small networks, you can use Hostnames for hostname resolu-
tion instead of DNS. The entries in this module reflect the data of the file /etc/
hosts. For more information, read Section “ /etc/hosts ” (page 586).

Kerberos Client
If you have a Kerberos server in your network for network authentication, use
Kerberos Client. A detailed description of the client configuration with YaST is
available in Section 46.6, “Configuring a Kerberos Client with YaST” (page 849).

LDAP Client
If using LDAP for user authentication in the network, configure the client in LDAP
Client. Information about LDAP and a detailed description of the client configuration
with YaST are available in Section 36.6, “Configuring an LDAP Client with YaST”
(page 681).

LDAP Server
The LDAP server can keep various data in a central directory and distribute it to
all clients in your network. Mostly it is used to store shared contact information
but its function is not limited to that. An LDAP server can be used also for authen-
tication. Information about LDAP and a detailed description of the server configu-
ration with YaST are available in Chapter 36, LDAP—A Directory Service
(page 661).

NFS Client
With NFS client, mount directories provided by NFS server in your own file trees.
Use NFS Client to configure your system to access an NFS server in the network.
A description of the YaST module and background information about NFS are
provided in Chapter 38, Sharing File Systems with NFS (page 711).

System Configuration with YaST 163


NFS Server
With NFS, run a file server that all members of your network can access. This file
server can be used to make certain applications, files, and storage space available
to users. In NFS Server, you can configure your host as an NFS server and determine
the directories to export for general use by the network users. All users with the
appropriate permissions can mount these directories in their own file trees. A de-
scription of the YaST module and background information about NFS are provided
in Chapter 38, Sharing File Systems with NFS (page 711).

NIS Client
If you run NIS server to administer user data on a central place and distribute it to
the clients, configure the client here. Detailed information about NIS client and
configuration with YaST is available in Section 35.2, “Configuring NIS Clients”
(page 659).

NIS Server
If you run more than one system, local user administration (using the files /etc/
passwd and /etc/shadow) is impractical and requires a lot of maintenance.
In this case, administer user data on a central server and distribute it to the clients
from there. NIS is one option for this. Detailed information about NIS and its
configuration with YaST is available in Section 35.1.1, “Configuring a NIS Master
Server” (page 654).

NTP Client
NTP (network time protocol) is a protocol for synchronizing hardware clocks over
a network. Information about NTP and instructions for configuring it with YaST
are available in Chapter 32, Time Synchronization with NTP (page 603).

Network Services (xinetd)


Configure the network services (such as finger, talk, and ftp) to start when SUSE
Linux Enterprise boots using Network Services. These services enable external
hosts to connect to your computer. Various parameters can be configured for every
service. By default, the master service that manages the individual services (inetd
or xinetd) is not started.

When this module starts, choose whether to start inetd or xinetd. The selected
daemon can be started with a standard selection of services. Alternatively, compose
your own selection of services with Add, Delete, and Edit.

164 Installation and Administration


WARNING: Configuring Network Services (xinetd)

The composition and adjustment of network services on a system is a


complex procedure that requires a comprehensive understanding of the
concept of Linux services. The default settings are usually sufficient.

Proxy
Configure Internet proxy client settings in Proxy. Click Enable Proxy then enter
the desired proxy settings. You can test these settings by clicking Test Proxy Set-
tings. A small window informs you whether your proxy settings work correctly.
After your settings have been entered and tested, save them by clicking Accept.

Remote Administration
To administer your machine remotely from another machine, use Remote Adminis-
tration. To maintain your system remotely, use a VNC client, such as krdc, or a
Java-enabled browser. Although remote administration using VNC is simple and
fast, it is less secure than using SSH, so you should always keep this in mind when
using a VNC server. Find detailed information about installing with a VNC client
in Section 4.1.1, “Simple Remote Installation via VNC—Static Network Configu-
ration” (page 44).

Allow remote administration by selecting Allow Remote Administration in Remote


Administration Settings. Selecting Do Not Allow Remote Administration disables
this function. Click Open Port in Firewall to allow access to your computer.
Clicking Firewall Details displays network interfaces with open ports in the firewall.
Select the desired interface and click OK to return to the main dialog. Click Accept
to complete the configuration.

The YaST Remote Administration module is highly recommended for configuring


VNC on your machine. Although the SaX2 interface also allows you to set remote
access properties, it is not a substitute for YaST. It only enables you to configure
your X server as a host for VNC sessions. For more information, refer to Sec-
tion 8.14.6, “Remote Access Properties” (page 192).

Routing
Use Routing to configure the paths data takes over the network. In most cases, only
enter the IP address of the system through which to send all data in Default Gateway.
To create more complicated configurations, use Expert Configuration.

System Configuration with YaST 165


Samba Server
In a heterogeneous network consisting of Linux and Windows hosts, Samba controls
the communication between the two worlds. Information about Samba and the
configuration of servers is provided in Chapter 37, Samba (page 695).

SLP Server
With service location protocol (SLP), you can configure clients in your network
without knowledge of server names and services that these servers provide. Detailed
information about SLP servers and configuration with YaST are described in
Chapter 31, SLP Services in the Network (page 599).

TFTP Server
A TFTP server in not an FTP server. While an FTP server uses the File Transfer
Protocol (FTP), a TFTP server uses the much simpler Trivial File Transfer Protocol
(TFTP) without security features. TFTP servers are usually used to boot diskless
workstations, X terminals, and routers. Detailed information about TFTP servers
and configuration with YaST are described in Section 4.3.2, “Setting Up a TFTP
Server” (page 64).

WOL
WOL (wake on LAN) refers to the possibility of waking up a computer from
standby mode over the network using special packages. It only works with mother-
boards that support this functionality in their BIOS. WOL configuration with YaST
is described in Section 4.3.7, “Wake on LAN” (page 71).

Windows Domain Membership


In a heterogeneous network consisting of Linux and Windows hosts, Samba controls
the communication between the two worlds. With the Samba Client module, you
can configure your computer as member of a Windows domain. Find information
about Samba and the configuration of clients in Chapter 37, Samba (page 695).

iSCSI Target
iSCSI technology provides an easy and reasonably inexpensive solution for con-
necting Linux computers to central storage systems. To configure the server side,
use Miscellaneous > iSCSI Target. Find more information about configuration of
iSCSI with YaST in Chapter 12, Mass Storage over IP Networks—iSCSI (page 257).

166 Installation and Administration


iSCSI Initiator
To configure a connection to central storage, use Miscellaneous > iSCSI Initiator.
Find more information about configuration of iSCSI with YaST in Chapter 12,
Mass Storage over IP Networks—iSCSI (page 257).

8.8 AppArmor
Novell AppArmor is designed to provide easy-to-use application security for both
servers and workstations. Novell AppArmor is an access control system that lets you
specify which files each program may read, write, and execute. To enable or disable
Novell AppArmor on your system, use AppArmor Control Panel. Information about
Novell AppArmor and a detailed description of the configuration with YaST are
available in Novell AppArmor Administration Guide (↑Novell AppArmor Administration
Guide).

8.9 Security and Users


A basic aspect of Linux is its multiuser capability. Consequently, several users can
work independently on the same Linux system. Each user has a user account identified
by a login name and a personal password for logging in to the system. All users have
their own home directories where personal files and configurations are stored.

8.9.1 User Management


Create and edit users with Security and Users > User Management. It provides an
overview of users in the system, including NIS, LDAP, Samba, and Kerberos users if
requested. If you are part of an extensive network, click Set Filter to list all users cate-
gorically. You can also customize the filter settings by clicking Customize Filter.

TIP: Applying Configuration Changes without Closing the Module

Whenever you need to make multiple configuration changes and want to avoid
restarting the user and group configuration module for every single one of
these changes, use Write Changes Now to save your changes without exiting
the configuration module.

System Configuration with YaST 167


Adding Users
To add a new user, proceed as follows:

1 Click Add.

2 Enter the necessary data for User Data. If you do not need to adjust any more
detailed settings for this new user, proceed to Step 5 (page 168).

3 To change a user's ID, home directory name, default home, group, group mem-
berships, directory permissions, or login shell, open the Details tab and change
the default values.

4 To adjust user's password expiration, length, and expiration warnings, use the
Password Settings tab.

5 Write the user account configuration by clicking Accept.

The new user can immediately log in with the created login name and password.

Deleting Users
To delete a user, proceed as follows:

1 Select the user from the list.

2 Click Delete.

3 Determine whether to delete or keep the home directory of the user to delete.

4 Click Yes to apply your settings.

Changing the Login Configuration


To change the login configuration, proceed as follows:

1 Select the user from the list.

2 Click Edit.

168 Installation and Administration


3 Adjust the settings under User Data, Details, and Password Settings.

4 Save the user account configuration by clicking Accept.

Managing Encrypted Home Directories


You can create an encrypted home directory as part of the user account creation. To
create an encrypted home directory for a user, proceed as follows:

1 Click Add.

2 Enter the required data for User Data.

3 In the Details tab, activate Use Encrypted Home Directory.

4 Apply your settings with Accept.

To create an encrypted home for an existing user, proceed as follows:

1 Select a user from the list and click Edit.

2 In the Details tab, enable Use Encrypted Home Directory.

3 Enter the password of the selected user.

4 Apply your settings with Accept.

To disable the encryption of home directories, proceed as follows:

1 Select a user from the list and click Edit.

2 In the Details tab, disable Use Encrypted Home Directory.

3 Enter the password of the selected user.

4 Apply your settings with Accept.

For more information about encrypted homes, see Section 47.2, “Using Encrypted
Home Directories” (page 865).

System Configuration with YaST 169


Auto Login
WARNING: Using Auto Login

Using the auto login feature on any system that can be physically accessed by
more than one person is a potential security risk. Any user accessing this system
can manipulate the data on it. If your system contains confidential data, do
not use the auto login functionality.

If you are the only user of your system, you can configure auto login. It automatically
logs a user into the system after start. Only one selected user can use the auto login
function. Auto login works only with KDM or GDM.

To activate auto login, select the user from the list of users and click Expert Options >
Login Settings. Then choose Auto Login and click OK.

To deactivate this functionality, select the user and click Expert Options > Login Settings.
Then uncheck Auto Login and click OK.

Login without a Password


WARNING: Allowing Login without a Password

Using the passwordless login feature on any system that can be physically ac-
cessed by more than one person is a potential security risk. Any user accessing
this system can manipulate the data on it. If your system contains confidential
data, do not use this functionality.

Login without a password automatically logs a user into the system after the user enters
the username in the login manager. It is available to multiple users on a system and
works only with KDM or GDM.

To activate the function, select the user from the list of users and click Expert Options
> Login Settings. Then choose Passwordless Login and click OK.

To deactivate this function, select the user for whom to disable this functionality from
the list of users and click Expert Options > Login Settings. Then uncheck Passwordless
Login and click OK.

170 Installation and Administration


Disabling User Login
To create a system user that should not be able to log in to the system but under whose
identity several system-related tasks should be managed, disable the user login when
creating the user account. Proceed as follows:

1 Click Add.

2 Enter the required data for User Data.

3 Check Disable User Login.

4 Apply your settings with Accept.

To disable login for an existing user, proceed as follows:

1 Select the user from the list and click Edit.

2 Check Disable User Login in User Data.

3 Apply your settings with Accept.

Enforcing Password Policies


On any system with multiple users, it is a good idea to enforce at least basic password
security policies. Users should change their passwords regularly and use strong pass-
words that cannot easily be exploited. For information about how to enforce stricter
password rules, refer to Section 8.9.3, “Local Security” (page 174). To enforce password
rotation, create a password expiration policy.

To configure the password expiration policy for a new user, proceed as follows:

1 Click Add.

2 Enter the required data in User Data.

3 Adjust the values in Password Settings.

4 Apply your settings with Accept.

System Configuration with YaST 171


To change the password expiration policy for an existing user, proceed as follows:

1 Select the user from the list and click Edit.

2 Adjust the values in Password Settings.

3 Apply your settings with Accept.

You can limit the lifetime of any user account by specifying a date of expiration for
this particular account. Specify the Expiration Date in the YYYY-MM-DD format and
leave the user configuration. If no Expiration Date is given, the user account never
expires.

Changing the Default Settings for New Users


When creating new local users, several defaults settings are used by YaST. You can
change these default settings to meet your requirements:

1 Select Expert Options > Defaults for New Users.

2 Apply your changes to any or all of the following items:

• Default Group

• Secondary Groups

• Default Login Shell

• Path Prefix for Home Directory

• Skeleton for Home Directory

• Umask for Home Directory

• Default Expiration Date

• Days after Password Expiration Login is Usable

3 Apply your changes with Accept.

172 Installation and Administration


Several other security-related default settings can be changed using the Local Security
module. Refer to Section 8.9.3, “Local Security” (page 174) for information.

Changing the Password Encryption


NOTE

Changes in password encryption apply only to local users.

SUSE Linux Enterprise can use DES, MD5, or Blowfish for password encryption. The
default password encryption method is Blowfish. The encryption method is set during
installation of the system, as described in Section 3.11.1, “Root Password” (page 32).
To change the password encryption method in the installed system, select Expert Options
> Password Encryption.

Changing the Authentication and User Sources


The user administration method (such as NIS, LDAP, Kerberos, or Samba) is set during
installation, as described in Section 3.11.7, “Users” (page 38). To change the user au-
thentication method in the installed system, select Expert Options > Authentication and
User Sources. The module provides a configuration overview and the option to configure
the client. Advanced client configuration is also possible using this module.

8.9.2 Group Management


To create and edit groups, select Security and Users > Group Management or click
Groups in the user administration module. Both dialogs have the same functionality,
allowing you to create, edit, or delete groups.

The module gives an overview of all groups. As in the user management dialog, change
filter settings by clicking Set Filter.

To add a group, click Add and enter the appropriate data. Select group members from
the list by checking the corresponding box. Click Accept to create the group. To edit a
group, select the group to edit from the list and click Edit. Make all necessary changes
then save them with Accept. To delete a group, simply select it from the list and click
Delete.

System Configuration with YaST 173


Click Expert Options for advanced group management. Find more about these options
in Section 8.9.1, “User Management” (page 167).

8.9.3 Local Security


To apply a set of security settings to your entire system, use Security and Users > Local
Security. These settings include security for booting, login, passwords, user creation,
and file permissions. SUSE Linux Enterprise offers three preconfigured security sets:
Home Workstation, Networked Workstation, and Network Server. Modify the defaults
with Details. To create your own scheme, use Custom Settings.

The detailed or custom settings include:

Password Settings
To have new passwords checked by the system for security before they are accepted,
click Check New Passwords and Test for Complicated Passwords. Set the minimum
password length for newly created users. Define the period for which the password
should be valid and how many days in advance an expiration alert should be issued
when the user logs in to the text console.

Boot Settings
Set how the key combination Ctrl + Alt + Del should be interpreted by selecting
the desired action. Normally, this combination, when entered in the text console,
causes the system to reboot. Do not modify this setting unless your machine or
server is publicly accessible and you are afraid someone could carry out this action
without authorization. If you select Stop, this key combination causes the system
to shut down. With Ignore, this key combination is ignored.

If you use the KDE login manager (KDM), set permissions for shutting down the
system in Shutdown Behavior of KDM. Give permission to Only root (the system
administrator), All Users, Nobody, or Local Users. If Nobody is selected, the system
can only be shut down from the text console.

Login Settings
Typically, following a failed login attempt, there is a waiting period lasting a few
seconds before another login is possible. This makes it more difficult for password
sniffers to log in. Optionally activate Record Successful Login Attempts. If you
suspect someone is trying to discover your password, check the entries in the system
log files in /var/log. To grant other users access to your graphical login screen

174 Installation and Administration


over the network, enable Allow Remote Graphical Login. Because this access
possibility represents a potential security risk, it is inactive by default.

User Addition
Every user has a numerical and an alphabetical user ID. The correlation between
these is established using the file /etc/passwd and should be as unique as pos-
sible. Using the data in this screen, define the range of numbers assigned to the
numerical part of the user ID when a new user is added. A minimum of 500 is
suitable for users. Automatically generated system users start with 1000. Proceed
in the same way with the group ID settings.

Miscellaneous Settings
To use predefined file permission settings, select Easy, Secure, or Paranoid. Easy
should be sufficient for most users. The setting Paranoid is extremely restrictive
and can serve as the basic level of operation for custom settings. If you select
Paranoid, remember that some programs might not work correctly or even at all,
because users no longer have permission to access certain files.

Also set which user should launch the updatedb program, if installed. This pro-
gram, which automatically runs on a daily basis or after booting, generates a
database (locatedb) in which the location of each file on your computer is stored.
If you select Nobody, any user can find only the paths in the database that can be
seen by any other (unprivileged) user. If root is selected, all local files are indexed,
because the user root, as superuser, may access all directories. Make sure that
the options Current Directory in root's Path and Current Directory in Path of
Regular Users are deactivated. Only advanced users should consider using these
options because these settings may pose a significant security risk if used incorrectly.
To have some control over the system even if it crashes, click Enable Magic SysRq
Keys.

Click Finish to complete your security configuration.

8.9.4 Certificate Management


Certificates are used for communication and can also be found, for example, on company
ID cards. To manage them or import a common server certificate, use Security and
Users > CA Management. Detailed information about certificates, their technologies,
and management with YaST are provided in Chapter 42, Managing X.509 Certification
(page 801).

System Configuration with YaST 175


8.9.5 Firewall
SuSEfirewall2 can protect your machine against attacks from the Internet. Configure
it with Security and Users > Firewall. Find detailed information about SuSEfirewall2
in Chapter 43, Masquerading and Firewalls (page 817).

TIP: Automatic Activation of the Firewall

YaST automatically starts a firewall with suitable settings on every configured


network interface. Start this module only if you want to reconfigure the firewall
with custom settings or deactivate it.

8.10 Virtualization
Virtualization makes it possible to run several operating systems on one physical ma-
chine. The hardware for the different systems is provided virtually. Virtualization YaST
modules provide configuration for the Xen virtualization system. For detailed information
about Xen, see Chapter 22, Virtualization (page 421).

The following modules are available in the Virtualization section:

Installing Hypervisor and Tools


Before you start using Xen, install a kernel with Xen support and related tools. To
install them, use Virtualization > Install Hypervisor and Tools. After installation
reboot your system to use the Xen kernel.

Creating Virtual Machines


After you successfully installed the Xen hypervisor and tools, you can install virtual
machines on your virtual server. To install a virtual machine, use Virtualization >
Create Virtual Machines.

8.11 Miscellaneous
The YaST Control Center has several modules that cannot easily be classified into the
first six module groups. They can be used for things like viewing log files and installing
drivers from a vendor CD.

176 Installation and Administration


8.11.1 Custom Installation CD Creation
With Miscellaneous > CD Creator, you can create a customized installation CD from
your original installation set. To start creation, click Add. Use the package manager to
select the packages or an AutoYaST control file to use a preconfigured AutoYaST
profile for creation.

8.11.2 Installation Server Configuration


For network installation, an installation server is required. To configure such a server,
use Miscellaneous > Installation Server. Find more information about the configuration
of an installation server with YaST in Section 4.2.1, “Setting Up an Installation Server
Using YaST” (page 52).

8.11.3 Autoinstallation
The AutoYaST tool is intended for automated installation. In Miscellaneous > Autoin-
stallation, prepare profiles for this tool. Find detailed information about automated in-
stallation with AutoYaST in Chapter 5, Automated Installation (page 81). The informa-
tion about using the Autoinstallation module is in Section 5.1.1, “Creating an AutoYaST
Profile” (page 82).

8.11.4 Support Query


Miscellaneous > Support Query offers the possibility to collect all system information
needed by the support team to find your problem so you can get help to solve it as soon
is possible. Regarding your query, select the problem category in the following window.
When all information is gathered, attach it to your support request.

8.11.5 Release Notes


The release notes are an important source about installation, update, configuration, and
technical issues. The release notes are continuously updated and published through
online update. Use Miscellaneous > Release Notes to view the release notes.

System Configuration with YaST 177


8.11.6 Start-Up Log
View information concerning the start-up of the computer in Miscellaneous > Start-Up
Log. This is one of the first places you might want to look when encountering problems
with the system or when troubleshooting. It shows the boot log /var/log/boot
.msg, which contains the screen messages displayed when the computer starts. Viewing
the log can help determine if the computer started properly and if all services and
functions were started correctly.

8.11.7 System Log


Use Miscellaneous > System Log to view the system log that keeps track of the operations
of your computer in var/log/messages. Kernel messages, sorted according to
date and time, are also recorded here. View the status of certain system components
using the box at the top. The following options are possible from the system log and
boot log modules:

/var/log/messages
This is the general system log file. Here, view kernel messages, users logging in
as root, and other useful information.

/proc/cpuinfo
This displays processor information, including its type, make, model, and perfor-
mance.

/proc/dma
This shows which DMA channels are currently being used.

/proc/interrupts
This shows which interrupts are in use and how many of each have been in use.

/proc/iomem
This displays the status of input/output memory.

/proc/ioports
This shows which I/O ports are in use at the moment.

/proc/meminfo
This displays memory status.

178 Installation and Administration


/proc/modules
This displays the individual modules.

/proc/mounts
This displays devices currently mounted.

/proc/partitions
This shows the partitioning of all hard disks.

/proc/version
This displays the current version of Linux.

/var/log/YaST2/y2log
This displays all YaST log messages.

/var/log/boot.msg
This displays information concerning the start-up of the system.

/var/log/faillog
This displays login failures.

/var/log/warn
This displays all system warnings.

8.11.8 Vendor Driver CD


Install device drivers from a Linux driver CD that contains drivers for SUSE Linux
Enterprise with Miscellaneous > Vendor Driver CD. When installing SUSE Linux En-
terprise from scratch, use this YaST module to load the required drivers from the vendor
CD after the installation.

8.12 YaST in Text Mode


This section is intended for system administrators and experts who do not run an X
server on their systems and depend on the text-based installation tool. It provides basic
information about starting and operating YaST in text mode.

System Configuration with YaST 179


When YaST is started in text mode, the YaST Control Center appears first. See Fig-
ure 8.9, “Main Window of YaST in Text Mode” (page 180). The main window consists
of three areas. The left frame, which is surrounded by a thick white border, features the
categories to which the various modules belong. The active category is indicated by a
colored background. The right frame, which is surrounded by a thin white border, pro-
vides an overview of the modules available in the active category. The bottom frame
contains the buttons for Help and Exit.

Figure 8.9 Main Window of YaST in Text Mode

When the YaST Control Center is started, the category Software is selected automati-
cally. Use ↓ and ↑ to change the category. To start a module from the selected category,
press →. The module selection now appears with a thick border. Use ↓ and ↑ to select
the desired module. Keep the arrow keys pressed to scroll through the list of available
modules. When a module is selected, the module title appears with a colored background
and a brief description is displayed in the bottom frame.

Press Enter to start the desired module. Various buttons or selection fields in the module
contain a letter with a different color (yellow by default). Use Alt + yellow_letter to
select a button directly instead of navigating there with Tab. Exit the YaST Control
Center by pressing the Exit button or by selecting Exit in the category overview and
pressing Enter.

180 Installation and Administration


8.12.1 Navigation in Modules
The following description of the control elements in the YaST modules assumes that
all function keys and Alt key combinations work and are not assigned different global
functions. Read Section 8.12.2, “Restriction of Key Combinations” (page 182) for infor-
mation about possible exceptions.

Navigation among Buttons and Selection Lists


Use Tab and Alt + Tab or Shift + Tab to navigate among the buttons and the frames
containing selection lists.

Navigation in Selection Lists


Use the arrow keys (↑ and ↓) to navigate among the individual elements in an active
frame containing a selection list. If individual entries within a frame exceed its
width, use Shift + → or Shift + ← to scroll horizontally to the right and left. Alter-
natively, use Ctrl + E or Ctrl + A. This combination can also be used if using → or
← would result in changing the active frame or the current selection list, as in the
Control Center.

Buttons, Radio Buttons, and Check Boxes


To select buttons with empty square brackets (check boxes) or empty parentheses
(radio buttons), press Space or Enter. Alternatively, radio buttons and check boxes
can be selected directly with Alt + yellow_letter. In this case, you do not need to
confirm with Enter. If you navigate to an item with Tab, press Enter to execute the
selected action or activate the respective menu item.

Function Keys
The F keys (F1 to F12) enable quick access to the various buttons. Which function
keys are actually mapped to which buttons depends on the active YaST module,
because the different modules offer different buttons (Details, Info, Add, Delete,
etc.). Use F10 for OK, Next, and Finish. Press F1 to access the YaST help, which
shows the functions mapped to the individual F keys.

System Configuration with YaST 181


Figure 8.10 The Software Installation Module

8.12.2 Restriction of Key Combinations


If your window manager uses global Alt combinations, the Alt combinations in YaST
might not work. Keys like Alt or Shift can also be occupied by the settings of the termi-
nal.

Replacing Alt with Esc


Alt shortcuts can be executed with Esc instead of Alt. For example, Esc + H replaces
Alt + H.

Backward and Forward Navigation with Ctrl + F and Ctrl + B


If the Alt and Shift combinations are occupied by the window manager or the ter-
minal, use the combinations Ctrl + F (forward) and Ctrl + B (backward) instead.

Restriction of Function Keys


The F keys are also used for functions. Certain function keys might be occupied
by the terminal and may not be available for YaST. However, the Alt key combina-
tions and function keys should always be fully available on a pure text console.

182 Installation and Administration


8.13 Managing YaST from the
Command Line
When a task only needs to be done once, the graphical or ncurses interface is usually
the best solution. If a task needs to be done repeatedly, it might be easier to use the
YaST command line interface. Custom scripts can also use this interface for automating
tasks.

View a list of all module names available on your system with yast -l or yast
--list. To display the available options of a module, enter yast module_name
help. If a module does not have a command line mode, a message informs you of this.

To display help for a module's command options, enter yast module_name


command help. To set the option value, enter yast module_name command
option=value.

Some modules do not support the command line mode because command line tools
with the same functionality already exist. The modules concerned and the command
line tools available are:

sw_single
sw_single provides package management and system update functionality. Use
rug instead of YaST in your scripts. Refer to Section 9.1, “Managing Packages
from the Command Line with rug” (page 194).

online_update_setup
online_update_setup configures automatic updating of your system. This
can be configured with cron.

inst_suse_register
With inst_suse_register, register your SUSE Linux Enterprise. For more
information about the registration, see Section 8.3.4, “Registering SUSE Linux
Enterprise” (page 136).

hwinfo
hwinfo provides information about the hardware of your system. The command
hwinfo does the same.

System Configuration with YaST 183


GenProf, LogProf, SD_AddProfile, SD_DeleteProfile, SD_EditProfile, SD_Report,
and subdomain
These modules control or configure AppArmor. AppArmor has its own command
line tools.

8.13.1 Managing Users


The YaST commands for user management, unlike traditional commands, considers
the configured authentication method and default user management settings of your
system when creating, modifying, or removing users. For example, you do not need
create home directory or copy skel files during or after the user addition. If you enter
the username and password, all other settings are made automatically in accordance
with default configuration. The functionality provided by the command line is the same
as in the graphical interface.

The YaST module users is used for user management. To display the command op-
tions, enter yast users help.

To add multiple users, create a /tmp/users.txt file with a list of users to add.
Enter one username per line and use the following script:

Example 8.2 Adding Multiple Users

#!/bin/bash
#
# adds new user, the password is same as username
#

for i in `cat /tmp/users.txt`;


do
yast users add username=$i password=$i
done

Similarly to adding, you can delete users defined in /tmp/users.txt:

184 Installation and Administration


Example 8.3 Removing Multiple Users

#!/bin/bash
#
# the home will be not deleted
# to delete homes, use option delete_home
#

for i in `cat /tmp/users.txt`;


do
yast users delete username=$i
done

8.13.2 Configuring the Network and Firewall


Network and firewall configuration commands are often wanted in scripts. Use yast
lan for network configuration and yast firewall.

To display the YaST network card configuration options, enter yast lan help. To
display the YaST firewall card configuration options, enter yast firewall help.
The network and firewall configurations with YaST are persistent. After reboot, it is
not necessary to execute scripts again.

To display a configuration summary for the network, use yast lan list. The first
item in the output of Example 8.4, “Sample Output of yast lan list” (page 185)
is a device ID. To get more information about the configuration of the device, use yast
lan show id=<number>. In this example, the correct command is yast lan
show id=0.

Example 8.4 Sample Output of yast lan list

0 Digital DECchip 21142/43, DHCP

The command line interface of the YaST firewall configuration is a fast and easy way
to enable or disable services, ports, or protocols. To display allowed services, ports,
and protocols, use yast firewall services show. For examples of how to
enable a service or port, use yast firewall services help. To enable mas-
querading, enter yast firewall masquerade enable.

System Configuration with YaST 185


8.14 SaX2
Configure the graphical environment of your system with Hardware > Graphics Card
and Monitor. This opens the SUSE Advanced X11 Configuration interface (SaX2),
where you can configure devices such as your mouse, keyboard, or display devices.
This interface can also accessed from the GNOME main menu with Computer > More
Applications > System > Sax2 or the KDE main menu with System > Configuration >
SaX2.

8.14.1 Card and Monitor Properties


Adjust the settings for your graphics card and display device in Card and Monitor
Properties. If you have more than one graphics card installed, each device is shown in
a separate dialog reachable by a tab. At the top of the dialog, see the current settings
for the selected graphics card and the monitor that is attached to it. If more than one
screen can be connected to the card (dual head), the monitor on the primary output is
shown. Normally, the card and display device are detected automatically by the system
during installation. However, you can tune many parameters manually or even change
the display device completely.

Figure 8.11 Card and Monitor Properties

186 Installation and Administration


TIP: Autodetecting New Display Hardware

If you change your display hardware after installation, use sax2 -r on the
command line to cause SaX2 to detect your hardware. You must be root to
run SaX2 from the command line.

Graphics Card
It is not possible to change the graphics card because only known models are supported
and these are detected automatically. However, you can change many options that affect
the behavior of the card. Normally, this should not be necessary because the system
already has set them up appropriately during installation. If you are an expert and want
to tweak some of the options, click Options next to the graphics card and select the
option to change. To assign a value needed to a certain option, enter this value in the
dialog that appears after selecting that option. Click OK to close the options dialog.

Monitor
To change the current settings for the monitor, click Change next to the monitor. A
new dialog opens in which to adjust various monitor-specific settings. This dialog has
several tabs for various aspects of monitor operation. Select the first tab to manually
select the vendor and model of the display device in two lists. If your monitor is not
listed, you can choose one of the VESA or LCD modes that suit your needs or, if you
have a vendor driver disk or CD, click Utility Disk and follow the instructions on the
screen to use it. Check Activate DPMS to use display power management signaling.
Display Size, with the geometrical properties of the monitor, and Sync Frequencies,
with the ranges for the horizontal and vertical sync frequencies of your monitor, are
normally set up correctly by the system, but you can modify these values manually.
After making all adjustments, click OK to close this dialog.

WARNING: Changing Monitor Frequencies

Although there are safety mechanisms, you should still be very careful when
changing the allowed monitor frequencies manually. Incorrect values might
destroy your monitor. You should always refer to the monitor's manual before
changing frequencies.

System Configuration with YaST 187


Resolution and Color Depth
The resolution and color depth can be chosen directly from two lists in the middle of
the dialog. The resolution you select here marks the highest resolution to use. All
common resolutions down to 640x480 are also added to the configuration automatically.
Depending on the graphical desktop used, you can switch to any of these later without
the need for reconfiguration.

Dual Head
If you have a graphics card with two outputs installed in your computer, you can connect
two screens to your system. Two screens that are attached to the same graphics card
are referred to as dual head. SaX2 automatically detects multiple display devices in the
system and prepares the configuration accordingly. To use the dual head mode of a
graphics card, check Activate Dual Head Mode at the bottom of the dialog and click
Configure to set the dual head options and the arrangement of the screens in the dual
head dialog.

The tabs in the row at the top of the dialog each correspond to a graphics card in your
system. Select the card to configure and set its multihead options in the dialog below.
In the upper part of the multihead dialog, click Change to configure the additional
screen. The possible options are the same as for the first screen. Choose the resolution
to use for this screen from the list. Select one of three possible multihead modes.

Cloned Multihead
In this mode, all monitors display the same contents. The mouse is only visible on
the main screen.

Xinerama Multihead
All screens combine to form a single large screen. Program windows can be posi-
tioned freely on all screens or scaled to a size that fills more than one monitor.

NOTE

Linux currently does not offer 3D support for Xinerama multihead environ-
ments. In this case, SaX2 deactivates the 3D support.

The arrangement of the dual head environment describes the sequence of the individual
screens. By default, SaX2 configures a standard layout that follows the sequence of the

188 Installation and Administration


detected screens, arranging all screens in a row from left to right. In the Arrangement
part of the dialog, determine the way the monitors are arranged by selecting one of the
sequence buttons. Click OK to close the dialog.

TIP: Using a Beamer with Laptop Computers

To connect a beamer to a laptop computer, activate dual head mode. In this


case, SaX2 configures the external output with a resolution of 1024x768 and
a refresh rate of 60 Hz. These values suit most beamers very well.

Multihead
If you have more than one graphics card installed in your computer, you can connect
more than one screen to your system. Two or more screens that are attached to different
graphics cards are referred to as multihead. SaX2 automatically detects multiple
graphics cards in the system and prepares the configuration accordingly. By default,
SaX2 configures a standard layout that follows the sequence of the detected graphics
cards, arranging all screens in a row from left to right. The additional Arrangement tab
allows for changing this layout manually. Drag the icons representing the individual
screens in the grid and click OK to close the dialog.

Testing the Configuration


Click OK in the main window after completing the configuration of your monitor and
your graphics card, then test your settings. This ensures that your configuration is suitable
for your devices. If the image is not steady, terminate the test immediately by pressing
Ctrl+Alt+Backspace and reduce the refresh rate or the resolution and color depth.

NOTE

Regardless of whether you run a test, all modifications are only activated when
you restart the X server.

8.14.2 Mouse Properties


Adjust the settings for your mouse in Mouse Properties. If you have more than one
mouse with different drivers installed, each driver is shown in a separate tab. Multiple

System Configuration with YaST 189


devices operated by the same driver are shown as one mouse. Activate or deactivate
the currently selected mouse with the check box at the top of the dialog. Below the
check box, see the current settings for that mouse. Normally, the mouse is detected
automatically, but you can change it manually if the automatic detection fails. Refer to
the documentation for your mouse for a description of the model. Click Change to select
the vendor and model from two lists then click OK to confirm your selection. In the
options part of the dialog, set various options for operating your mouse.

Activate 3-Button Emulation


If your mouse has only two buttons, a third button is emulated when you click both
buttons simultaneously.

Activate Mouse Wheel


Check this box to use a scroll wheel.

Invert X-Axis and Invert Y-Axis


If one of these options is selected, the mouse pointer moves in the opposite direction.
For touch pads, this feature is sometimes useful.

Emulate Wheel with Mouse Button


If your mouse does not have a scroll wheel but you want to use similar functional-
ity, you can assign an additional button for this. Select the button to use. While
pressing this button, any movement of the mouse is translated into scroll wheel
commands. This feature is especially useful with trackballs.

When you are satisfied with your settings, click OK to confirm your changes.

NOTE

Any changes you make here take effect only after you restart the X server.

8.14.3 Keyboard Properties


Use this dialog to adjust the settings for operating your keyboard in the graphical envi-
ronment. In the upper part of the dialog, select the type, language layout, and variant.
Use the test field at the bottom of the dialog to check if special characters are displayed
correctly. Select additional layouts and variants to use from the list in the middle. De-
pending on the type of your desktop, these may be switched in the running system

190 Installation and Administration


without the need for reconfiguration. After you click OK, the changes are applied im-
mediately.

8.14.4 Tablet Properties


Use this dialog to configure a graphics tablet attached to your system. Click the
Graphics Tablet tab to select vendor and model from the lists. Currently, only a limited
number of graphics tablets is supported. To activate the tablet, check Activate This
Tablet at the top of the dialog.

In the Port and Mode dialog, configure the connection to the tablet. SaX2 enables the
configuration of graphics tablets connected to the USB port or the serial port. If your
tablet is connected to the serial port, verify the port. /dev/ttyS0 refers to the first
serial port. /dev/ttyS1 refers to the second. Additional ports use similar notation.
Choose appropriate Options from the list and select the Primary Tablet Mode suitable
for your needs.

If your graphics tablet supports electronic pens, configure them in Electronic Pens.
Add eraser and pen and set their properties after clicking Properties.

When you are satisfied with the settings, click OK to confirm your changes.

8.14.5 Touchscreen Properties


Use this dialog to configure touchscreens attached to your system. If you have more
than one touchscreen installed, each device is shown in a separate dialog reachable by
a tab. To activate the currently selected touchscreen, check Assign a Touchscreen to
Display at the top of the dialog. Select vendor and model from the lists below and set
an appropriate Connection Port at the bottom. You can configure touchscreens connected
to the USB port or the serial port. If your touchscreen is connected to the serial port,
verify the port. /dev/ttyS0 refers to the first serial port. /dev/ttyS1 refers to the
second. Additional ports use similar notation. When you are satisfied with your settings,
click OK to confirm your changes.

System Configuration with YaST 191


8.14.6 Remote Access Properties
VNC (Virtual Network Computing) is a client-server solution that gives access a remote
X server with a slim and easy-to-use client. This client is available for a variety of op-
erating systems, including Microsoft Windows, Apple's MacOS, and Linux. Find addi-
tional information about VNC at http://www.realvnc.com/.

Use this dialog to configure your X server as a host for VNC sessions. If you want VNC
clients to connect to your X server, check Allow Access to Display Using VNC Protocol.
Set a password to restrict access to your VNC-enabled X server. Check Allow Multiple
VNC Connections if more than one VNC client should connect to the X server at the
same time. Allow HTTP access by checking Activate HTTP Access and setting the port
to be use in HTTP Port.

When you are satisfied with your settings, click OK to save your changes.

8.15 Troubleshooting
All error messages and alerts are logged in the directory /var/log/YaST2. The
most important file for finding YaST problems is y2log.

8.16 For More Information


More information about YaST can be found on the following Web sites and directories:

• /usr/share/doc/packages/yast2—Local YaST development documen-


tation

• http://www.opensuse.org/YaST_Development—The YaST project


page in the openSUSE wiki

• http://forge.novell.com/modules/xfmod/project/
?yast—Another YaST project page

192 Installation and Administration


Managing Software with
ZENworks
SUSE Linux Enterprise is ready for integration into an environment administrated by
9
Novell ZENworks Linux Management. It includes an open source ZENworks manage-
ment agent, back-end daemon, and user space software management tools. Novell
ZENworks package management tools use a ZENworks Linux Management server to
download packages and updates. If no ZENworks Linux Management server is available
in your local network, your system can get updates from the Novell Customer Center,
which is described in Section 3.11.4, “Customer Center” (page 35).

The back-end daemon for the Novell ZENworks Linux Management Agent is the
ZENworks Management Daemon (ZMD). ZMD performs software management func-
tions. The daemon is started automatically during boot.

Check the status of the daemon with rczmd status. To start the daemon, enter
rczmd start. To restart it, use rczmd restart. Deactivate it with rczmd
stop.

ZMD can also be started with special options to control its behavior. To have ZMD
always start with some special options permanently, set ZMD_OPTIONS in /etc/
sysconfig/zmd then run SuSEconfig. The available options are:

-n, --no-daemon
Do not run the daemon in the background.

-m, --no-modules
Do not load any modules.

Managing Software with ZENworks 193


-s, --no-services
Do not load initial services.

-r, --no-remote
Do not start remote services.

ZMD configuration is stored in /etc/zmd/zmd.conf. You can change the configu-


ration manually or with rug. The URL for the ZENworks service that zmd uses at
initial start-up and a registration key are stored in /var/lib/zmd. Updates are
downloaded to the ZMD cache in /var/cache/zmd.

ZMD is the back-end only. The software management tasks are initiated through the
command line tool rug or the graphical Software Updater applet.

9.1 Managing Packages from the


Command Line with rug
rug works with the zmd daemon to install, update, and remove software according to
the commands given. It can install software from local files or from servers. You can
use one or more installation sources, known as services. Supported services are mount
for local files and yum or ZENworks for servers.

rug sorts software from services into catalogs (also known as channels), groups of
similar software. For example, one catalog might contain software from an update
server and another some software from a third-party software vendor. Subscribe to in-
dividual catalogs to control the display of available packages and prevent the accidental
installation of unwanted software. Operations are normally performed only on software
from catalogs to which you are subscribed.

9.1.1 Obtaining Information from rug


rug provides a wide range of useful information. Check the status of zmd with rug,
view registered services and catalogs, or see information about available patches.

If the zmd daemon is not used for a certain period of time, it can be switched to sleep
mode. To check the zmd status and reactivate the daemon, use rug ping. The command
wakes up zmd and logs status information of the daemon.

194 Installation and Administration


To see your registered services, use rug sl. If you want to add a new service and you
are not sure which services are supported on your system, use rug st.

To check for available patches, use rug pch. To view information about a patch, enter
rug patch-info patch.

9.1.2 Subscribing to rug Services


By default, a newly installed system is subscribed to several services. To add a new
service, use rug sa URI service_name. Replace service_name with a
meaningful and unique string that identifies the new service. Information about addi-
tional installation sources is provided at http://en.opensuse.org/
Installation_Sources.

9.1.3 Installing and Removing Software with


rug
To install a package from any subscribed catalogs, use rug in package_name.
To install from a selected catalog only, add --entire-catalog and the catalog to
install use to the command. View information about a package with rug if
package_name.

To remove a package, use rug rm package_name. If other packages depend on


this package, rug displays their names, versions, and types. Confirm removal of the
package.

9.1.4 rug User Management


One of the biggest advantages of rug is user management. Normally only root can
update or install new packages. With rug, you can distribute the right to update the
system to other users and restrict them, for example, only to updating without the pos-
sibility to remove software. Privileges you can grant are:

install
The user may install new software

Managing Software with ZENworks 195


lock
The user may set package locks

remove
The user may remove software

subscribe
The user may change channel subscriptions

trusted
The user is considered trusted, so may install packages without package signatures

upgrade
The user may update software packages

view
This allows the user to see which software is installed on the machine and which
software is in available channels. The option is relevant only to remote users. Local
users are normally permitted to view installed and available packages.

superuser
Permits all rug commands except user management and settings, which must be
done locally.

To give a user permission to update the system, use the command rug ua username
upgrade. Replace username with the name of the user. To revoke the privileges of
a user, use command rug ud username. To list users with their rights, use rug ul.

To change the current privileges of a user, use rug ue username. Replace username
with the name of the desired user.

The edit command is interactive. It lists privileges of the selected user and gives a
prompt. Enter the plus (+) or minus (-) symbol and the name of the privilege. Then
press Enter. For example, to permit the user to delete software, enter +remove. To
save and quit, press Enter at a blank prompt.

9.1.5 Scheduling Updates


Using rug, the system can be updated automatically (for example, by scripts). The
simplest example is a fully automatic update. To do this, configure a cron job as root

196 Installation and Administration


that executes rug up -y. The up -y option downloads and installs the patches from
your catalogs without confirmation.

If you instead want only to download the patches then select the patches for installation
at a later time, use rug up -dy. The up -dy option downloads the patches from
your catalogs without confirmation and saves them to the rug cache. The default location
of the rug cache is /var/cache/zmd.

9.1.6 Configuring rug


rug is customized through a set of preferences. Some of them are preconfigured during
installation. To list the preferences available, use rug get. To edit a preference, enter
rug set preference. For example, adjust settings if you need to update your
system through a proxy. Before downloading the updates, send your username and
password to the proxy server. To do so, use the commands:
rug set proxy-url url_path
rug set proxy-username name
rug set proxy-password password

Replace url_path with the name of your proxy server. Replace name with your
username. Replace password with your password.

9.1.7 For More Information


For more information about updating from the command line, enter rug --help or
see the rug(1) man page. The --help option is also available for all rug commands.
If, for example, you need help for rug update, enter rug update --help. For
examples and detailed information, see http://en.opensuse.org/Using_rug.

9.2 Managing Packages with the ZEN


Tools
The ZEN tools serve as graphical front-ends for the ZENworks Management Daemon
(zmd), allowing you easily to install or remove software, apply security updates, and
manage services and catalogs with just a few clicks.

Managing Software with ZENworks 197


9.2.1 Getting Permissions
Managing packages on a Linux system requires root privileges. The ZEN tools and
rug have their own user management system that allows users to install software up-
dates. When a user first invokes an action that requires special privileges in the ZEN
tools, a prompt for the root password appears. When the password has been verified,
The ZEN tools automatically add the user's account to the user management system
with update permissions. To review or change these settings, use the rug user manage-
ment commands (see Section 9.1.4, “rug User Management” (page 195) for information).

9.2.2 Obtaining and Installing Software


Updates
Software Updater resides in the notification area (GNOME) or the system tray (KDE)
of your panel as an icon depicting a globe. It changes color and appearance depending
on the availability of a network link and new updates. Once a day, Software Updater
automatically checks whether updates for your system are available (right-click the
application icon and choose Refresh to force an immediate check). The Software Updater
applet in the panel changes from a globe to an exclamation mark on an orange back-
ground when new updates are available.

Left-click the panel icon to open the updater window. It displays a list of patches and
new package versions available. Each entry has a short description and, if applicable,
a category icon: Security patches are marked with a yellow shield. Optional patches
are marked with a light blue circle. Recommended patches are not marked with an icon.
Security patches are listed first, then recommended patches, optional patches, and finally
new package versions. Use the links All, Packages, and Patches to filter the list of
packages displayed.

NOTE: Packages versus Patches

Officially released updates from Novell show up as Patches. New package ver-
sions from other sources show up as Packages.

To get details about a certain entry, mark it with the mouse and click the Details link
under the list window. To select an entry for installation, mark the entry's check box.

198 Installation and Administration


Use the links All and None to select or deselect all patches. Clicking Update installs
the selected programs.

Figure 9.1 Selecting the Software Updates

9.2.3 Installing Software


To install software packages, start Install Software from the menu or run
zen-installer. The interface is almost identical to Software Updater (see Sec-
tion 9.2.2, “Obtaining and Installing Software Updates” (page 198)). The only difference
is a search panel you can use to search for packages or to filter the list. Mark the check
box of packages that should be installed then press Install to start the package installation.
Possible dependencies on other packages are automatically resolved by the installer.

Managing Software with ZENworks 199


9.2.4 Remove Software
Start Remove Software from the menu or run zen-remover to uninstall software
packages. The list of packages can be narrowed with the links Products (uninstalls the
complete products), Patterns (see Section “Installing and Removing Patterns” (page 129)
for details on patterns), Packages, and Patches. Mark the check box of a list entry that
should be removed then press Remove to start the package uninstallation. If other
packages depend on the ones marked by you, these are also removed. You must confirm
the removal of additional packages. If you click Cancel in the confirmation dialog, no
packages are uninstalled.

9.2.5 Configuring the Software Updater


To configure the ZEN tools, click Configure in the application window. A window with
three tabs opens: Services, Catalogs, and Preferences.

Services and Catalogs


Services are basically sources that provide software packages and information about
these packages. Each service can offer one or more catalogs.

The service tab lists all services available together with type and status information (if
you cannot see the latter two, adjust the window size). Use Remove Service or Add
Service to add or remove services. The following service types are available:

YUM
An HTTP, HTTPS, or FTP server using the RPM-MD format for the package data.

ZYPP
ZYPP services are the YaST installation sources added with Software > Installation
Source in YaST. Use Software Updater or YaST to add installation sources. The
source from which you initially installed (DVD or CD-ROM in most cases) is
preconfigured. If you change or delete this source, replace it with another valid
installation source (ZYPP service), because otherwise you cannot install new soft-
ware.

200 Installation and Administration


NOTE: Terminology

The terms YaST installation source, YaST package repository, and ZYPP
service are the same name for a source from which you can install software.

Mount
With Mount, embed a directory mounted on your machine. This is useful, for ex-
ample, in a network that regularly mirrors the Novell YUM server and exports its
content to the local network. To add the directory, provide the full path to the direc-
tory in Service URI.

NU
NU stands for Novell Update. Novell provides updates for SUSE Linux Enterprise
exclusively as NU services. If you configured update during installation, the official
Novell NU server is already present in the list.

If you skipped the update configuration during installation, run suse_register


on the command line or the YaST module Software > Product Registration as user
root. The Novell Update server is automatically added to Software Updater.

RCE and ZENworks


Opencarpet, Red Carpet Enterprise, or ZENworks services are only available if
your company or organization has set up these services within your internal network.
This may, for example, be the case if your organization is using third-party software
for which updates are deployed on a single server.

After SUSE Linux Enterprise is installed, two services are preconfigured: your installa-
tion source (DVD, CD-ROM, or network resource) as a ZYPP service and a SUSE
Linux Enterprise update server as a NU service, which was added during product reg-
istration. Normally there is no need to change these settings. If you do not see a NUYUM
service, open a root shell and execute the command suse_register. A service
is added automatically.

Catalogs
Services are able to provide packages for different pieces of software or for different
software versions (typically RCE or ZENworks services do so). These are organized
in different categories called catalogs. Subscribe or unsubscribe from a catalog by
marking or unmarking the check box in front of it.

Managing Software with ZENworks 201


At the moment, the SUSE Linux services (YUM and ZYPP) do not provide different
catalogs. Each service only has one catalog. If Software Updater was configured during
installation or with suse_register, it subscribes to the YUM and ZYPP catalogs
automatically. If you manually add a service, you must subscribe to its catalogs.

WARNING: Unsubscribing from Catalogs

To install packages from a catalog, you must be subscribed to this catalog. If


you unsubscribe, the packages from this catalog are still listed in the update
window, but you cannot install them.

Preferences
On the Preferences tab, specify whether Software Updater should be launched at start-
up or not. As user root, you can also modify the Software Updater settings. As an
unprivileged user, you can only view the settings. Refer to the rug man page for an
explanation of the settings.

9.3 For More Information


Find more information about ZENworks Linux Management and ZMD at http://
www.novell.com/products/zenworks/linuxmanagement/index.html.

202 Installation and Administration


Updating SUSE Linux
Enterprise
SUSE® Linux Enterprise provides the option of updating an existing system to the new
10
version without completely reinstalling it. No new installation is needed. Old data, such
as home directories and system configuration, is kept intact. During the life cycle of
the product, you can apply Service Packs to increase system security and correct software
defects. Install from a local CD or DVD drive or from a central network installation
source.

10.1 Updating SUSE Linux Enterprise


Software tends to “grow” from version to version. Therefore, take a look at the available
partition space with df before updating. If you suspect you are running short of disk
space, secure your data before updating and repartition your system. There is no general
rule of thumb regarding how much space each partition should have. Space requirements
depend on your particular partitioning profile and the software selected.

10.1.1 Preparations
Before updating, copy the old configuration files to a separate medium, such as
streamer, removable hard disk, USB stick, or ZIP drive, to secure the data. This primar-
ily applies to files stored in /etc as well as some of the directories and files in /var
and /opt. You may also want to write the user data in /home (the HOME directories)
to a backup medium. Back up this data as root. Only root has read permission for
all local files.

Updating SUSE Linux Enterprise 203


Before starting your update, make note of the root partition. The command df / lists
the device name of the root partition. In Example 10.1, “List with df -h” (page 204),
the root partition to write down is /dev/hda3 (mounted as /).

Example 10.1 List with df -h

Filesystem Size Used Avail Use% Mounted on


/dev/hda3 74G 22G 53G 29% /
tmpfs 506M 0 506M 0% /dev/shm
/dev/hda5 116G 5.8G 111G 5% /home
/dev/hda1 39G 1.6G 37G 4% /windows/C
/dev/hda2 4.6G 2.6G 2.1G 57% /windows/D

10.1.2 Possible Problems


If you update a default system from the previous version to this version, YaST works
out necessary changes and performs them. Depending on your customizations, some
steps or the entire update procedure may fail and you must resort to copying back your
backup data. Check the following issues before starting the system update.

Checking passwd and group in /etc


Before updating the system, make sure that /etc/passwd and /etc/group do not
contain any syntax errors. For this purpose, start the verification utilities pwck and
grpck as root and eliminate any reported errors.

PostgreSQL
Before updating PostgreSQL (postgres), dump the databases. See the manual page
of pg_dump. This is only necessary if you actually used PostgreSQL prior to your
update.

10.1.3 Updating with YaST


Following the preparation procedure outlined in Section 10.1.1, “Preparations”
(page 203), you can now update your system:

204 Installation and Administration


1 Optionally, prepare an installation server. For background information, see Sec-
tion 4.2.1, “Setting Up an Installation Server Using YaST” (page 52).

2 Boot the system as for the installation, described in Section 3.2, “System Start-
Up for Installation” (page 18). In YaST, choose a language and select Update
in the Installation Mode dialog. Do not select New Installation.

3 YaST determines whether there are multiple root partitions. If there is only one,
continue with the next step. If there are several, select the right partition and
confirm with Next (/dev/hda3 was selected in the example in Section 10.1.1,
“Preparations” (page 203)). YaST reads the old fstab on this partition to analyze
and mount the file systems listed there.

4 In the Installation Settings dialog, adjust the settings according to your require-
ments. Normally, you can leave the default settings untouched, but if you intend
to enhance your system, check the packages offered in the Software Selection
submenus or add support for additional languages.

4a Click Update Options to update only software that is already installed (Only
Update Installed Packages) or to add new software and features to the system
according to selected patterns. It is advisable to accept the suggestion. You
can adjustment it later with YaST.

4b You also have the possibility to make backups (Backup) of various system
components. Selecting backups slows down the update process. Use this
option if you do not have a recent system backup.

5 Click Accept to start the software installation process.

10.2 Installing Service Packs


Use Service Packs to update a SUSE Linux Enterprise installation. There are several
different ways in which you can apply a Service Pack. You can either update the existing
installation or start a whole new installation using the Service Pack media. Possible
scenarios for updating the system and setting up a central network installation source
are described here.

Updating SUSE Linux Enterprise 205


TIP: Installation Changes

Read the installation instructions on the Service Pack media for further changes.

10.2.1 Setting Up a Network Installation


Source for Service Pack Media
As with the initial installation of SUSE Linux Enterprise, it is much more efficient
having a central installation source on your network to serve all clients rather than in-
stalling all of them separately using a set of physical media.

Configuring a Network Installation Source on SUSE


Linux Enterprise Using YaST
Basically, follow the procedure outlined in Section 4.2, “Setting Up the Server Holding
the Installation Sources” (page 52). Just add another installation source called SLE-10-
SP-x-arch, SLES-10-SP-x-arch, or SLED-10-SP-x-arch (where x is the number
of the Service Pack and arch is the name of your hardware architecture) and make it
available via NFS, HTTP, or FTP.

10.2.2 Installing a Service Pack


NOTE

To update an existing SUSE Linux Enterprise 10 system to a SUSE Linux Enterprise


10 Service Pack (SP), see Section 10.2.3, “Updating to a Service Pack” (page 209).

Installing a SUSE Linux Enterprise Service Pack is very similar to installing the original
SUSE Linux Enterprise media. As with the original installation, you can choose to install
from a local CD or DVD drive or from a central network installation source.

Installing from a Local CD or DVD Drive


Before starting a new installation of a SUSE Linux Enterprise SP, ensure that all of the
Service Pack installation media (CDs or DVD) are available.

206 Installation and Administration


Procedure 10.1 Booting from the Service Pack Medium

1 Insert the first SUSE Linux Enterprise SP medium (CD 1 or DVD 1) and boot
your machine. A boot screen similar to the original installation of SUSE Linux
Enterprise 10 is displayed.

2 Select Installation and continue as outlined in the YaST installation instructions


in Chapter 3, Installation with YaST (page 17).

Network Installation
Before starting a network installation of an SUSE Linux Enterprise SP, make sure that
the following requirements are met:

• A network installation source set up according to Section 10.2.1, “Setting Up a


Network Installation Source for Service Pack Media” (page 206).

• A working network connection both on the installation server and the target machine
that includes a name service, DHCP (optional, but needed for PXE boot), and
OpenSLP (optional).

• The SUSE Linux Enterprise SP CD 1 or DVD 1 to boot the target system or a target
system set up for PXE boot according to Section 4.3.5, “Preparing the Target System
for PXE Boot” (page 71).

Network Installation—Boot from CD or DVD


To perform a network installation using the SP CD or DVD as the boot medium, proceed
as follows:

1 Insert the SUSE Linux Enterprise SP CD 1 or DVD 1 and boot your machine.
A boot screen similar to the original installation of SUSE Linux Enterprise 10
is displayed.

2 Select Installation to boot the SP kernel then use F3 to select a type of network
installation source (FTP, HTTP, NFS, or SMB).

3 Provide the appropriate path information or select SLP as the installation source.

Updating SUSE Linux Enterprise 207


4 Select the appropriate installation server from those offered or use the boot options
prompt to provide the type of installation source and its actual location as in
Section 3.2.4, “Installing from a Network Source without SLP” (page 19). YaST
starts.

Finish the installation as outlined in Chapter 3, Installation with YaST (page 17).

Network Installation—PXE Boot


To perform a network installation of a SUSE Linux Enterprise Service Pack via network,
proceed as follows:

1 Adjust the setup of your DHCP server to provide the address information needed
for PXE boot according to Section 4.3.5, “Preparing the Target System for PXE
Boot” (page 71).

2 Set up a TFTP server to hold the boot image needed for PXE boot.

Use the first CD or DVD of your SUSE Linux Enterprise Service Pack for this
and otherwise follow the instructions in Section 4.3.2, “Setting Up a TFTP
Server” (page 64).

3 Prepare PXE boot and Wake-on-LAN on the target machine.

4 Initiate the boot of the target system and use VNC to remotely connect to the
installation routine running on this machine. See Section 4.5.1, “VNC Installation”
(page 77) for more information.

5 Accept the license agreement then select a language, default desktop, and other
installation settings.

6 Click Yes, Install to start the installation.

7 Continue as usual with the installation (entering a password for root, completing
the network configuration, testing your Internet connection, activating the Online
Update service, selecting the user authentication method, and entering a username
and password).

For detailed instructions for installing SUSE Linux Enterprise, see Chapter 3,
Installation with YaST (page 17).

208 Installation and Administration


10.2.3 Updating to a Service Pack
There are two ways to update the system to the Service Pack (SP) feature level. One
way is to boot from the SP medium. The alternative is to run zen-updater or YaST
Online Update and select the optional Update to Service Pack 1 patch. By updating to
the new feature level, additional features like new drivers or software enhancements
are available to your system. If you stay with the GA release level, only bug fixes and
security updates are available.

Booting from the SP Medium for the Update


Boot from the SP medium and choose Update as the installation mode in YaST. For
more detailed information and finishing the update, see Section 10.1.3, “Updating with
YaST” (page 204).

Starting with YaST Online Update


Before initiating the YaST Online Update to update to the SP feature level, make sure
that the following requirements are met:

• The system must be online throughout the entire update process, because this process
requires access to the Novell registration server.

• If your setup involves third party software or add-on software, test this procedure
on another machine to make sure that the dependencies are not broken by the update.

• Make sure that the entire process is completed successfully. Otherwise the system
becomes inconsistent.

Updating SUSE Linux Enterprise 209


Figure 10.1 Update to Service Pack 1

1 In a running SUSE Linux Enterprise system, select Computer > YaST > Software
> Online Update.

If you are not logged in as root, enter the root password when prompted.

2 The Online Update dialog appears. Scroll down the patch list and select Update
to Service Pack 1 as shown in Figure 10.1, “Update to Service Pack 1” (page 210).
In the pop-up window, click Accept to confirm the start of the update procedure
to the service pack feature level.

3 The Patch Download and Installation dialog tracks the progress log of the migra-
tion patch installation. When Total Progress reaches 100%, click Finish.

4 Run the online update a second time. Once done, in the Patch Download and
Installation click Close. During this second run YaST installs the kernel and all
the other software.

210 Installation and Administration


5 Click Finish when you see Installation Finished reported near the end of the
progress log.

6 To finish the update, manually reboot the system to activate the new kernel.

10.3 Software Changes from Version


9 to Version 10
The individual aspects changed from version 9 to version 10 are outlined in the following
in detail. This summary indicates, for example, whether basic settings have been com-
pletely reconfigured, whether configuration files have been moved to other places, or
whether common applications have been significantly changed. Significant modifications
that affect the daily use of the system at either the user level or the administrator level
are mentioned here.

NOTE: Software Changes from SLES 10 to SLES 10 SP 1

For a detailed list of software and configuration changes from SUSE Linux En-
terprise Server 10 to SUSE Linux Enterprise Server 10 SP1, refer to the release
notes of the service pack. View them in the installed system using the YaST
release notes module.

10.3.1 Multiple Kernels


It is possible to install multiple kernels side by side. This feature is meant to allow ad-
ministrators to upgrade from one kernel to another by installing the new kernel, verifying
that the new kernel works as expected, then uninstalling the old kernel. While YaST
does not yet support this feature, kernels can easily be installed and uninstalled from
the shell using rpm -i package.rpm.

The default boot loader menus contain one kernel entry. Before installing multiple
kernels, it is useful to add an entry for the extra kernels, so they can be selected easily.
The kernel that was active before installing the new kernel can be accessed as vmlinuz
.previous and initrd.previous. By creating a boot loader entry similar to the
default entry and having this entry refer to vmlinuz.previous and initrd
.previous instead of vmlinuz and initrd, the previously active kernel can be

Updating SUSE Linux Enterprise 211


accessed. Alternatively, GRUB and LILO support wild card boot loader entries. Refer
to the GRUB info pages (info grub) and to the lilo.conf(5) manual page for
details.

10.3.2 Changes with Kernel Modules


The following kernel modules are no longer available:

• km_fcdsl—AVM Fritz!Card DSL

• km_fritzcapi—AVM FRITZ! ISDN Adapters

The following kernel module package was changed internally:

• km_wlan—Various drivers for wireless LAN cards. The madwifi driver for
Atheros WLAN cards from km_wlan was removed.

For technical reasons, it was necessary to drop support for Ralink WLAN cards. The
following modules were not part of the distribution and will not be added in the future:

• ati-fglrx—ATI FireGL Graphics Cards

• nvidia-gfx—NVIDIA gfx driver

• km_smartlink-softmodem—Smart Link Soft Modem

10.3.3 Console Number Change and Serial


Devices
As of 2.6.10, serial devices on ia64 are named based on the order of ACPI and PCI
enumeration. The first device in the ACPI name space (if any) becomes /dev/ttyS0,
the second becomes /dev/ttyS1, etc., and PCI devices are named sequentially
starting after the ACPI devices.

On HP systems, you must reconfigure the EFI console then you can drop the console
parameter from the kernel boot command. As a work-around, you can try
console=ttyS1... as a boot parameter instead of console=ttyS0....

212 Installation and Administration


Find details in /usr/src/linux/Documentation/ia64/serial.txt, which is part of the
kernel-source software package.

10.3.4 LD_ASSUME_KERNEL Environment


Variable
Do not set the LD_ASSUME_KERNEL environment variable any longer. In the past,
it was possible to use it to enforce LinuxThreads support, which was dropped. If you
set LD_ASSUME_KERNEL=2.4.x in SUSE Linux Enterprise 10, everything breaks
because ld.so looks for glibc and related tools in a path that does not exist.

10.3.5 Stricter tar Syntax


The tar usage syntax is stricter now. The tar options must come before the file or
directory specifications. Appending options, like --atime-preserve or
--numeric-owner, after the file or directory specification makes tar fail. Check
your backup scripts. Commands such as the following no longer work:
tar czf etc.tar.gz /etc --atime-preserve

See the tar info pages for more information.

10.3.6 Apache 2 Replaced with Apache 2.2


The Apache Web server (version 2) has been replaced with version 2.2. For Apache
version 2.2, Chapter 40, The Apache HTTP Server (page 737) was completely reworked.
In addition, find generic upgrade information at http://httpd.apache.org/
docs/2.2/upgrading.html and the description of new features at http://
httpd.apache.org/docs/2.2/new_features_2_2.html.

10.3.7 Kerberos for Network Authentication


Kerberos is the default for network authentication instead of heimdal. Converting
an existing heimdal configuration automatically is not possible. During a system update,
backup copies of configuration files are created as shown in Table 10.1, “Backup Files”
(page 214).

Updating SUSE Linux Enterprise 213


Table 10.1 Backup Files

Old File Backup File

/etc/krb5.conf /etc/krb5.conf.heimdal

/etc/krb5.keytab /etc/krb5.keytab.heimdal

The client configuration (/etc/krb5.conf) is very similar to the one of heimdal.


If nothing special was configured, it is enough to replace the parameter
kpasswd_server with admin_server.

It is not possible to copy the server-related (kdc and kadmind) data. After the system
update, the old heimdal database is still available under /var/heimdal. MIT kerberos
maintains the database under /var/lib/kerberos/krb5kdc. For more informa-
tion, see Chapter 45, Network Authentication—Kerberos (page 833) and Chapter 46,
Installing and Administering Kerberos (page 841).

10.3.8 Hotplug Events Handled by the udev


Daemon
Hotplug events are now completely handled by the udev daemon (udevd). The event
multiplexer system in /etc/hotplug.d and /etc/dev.d is no longer used. Instead,
udevd calls all hotplug helper tools directly according to its rules. Udev rules and
helper tools are provided by udev and various other packages.

10.3.9 Firewall Activation During the


Installation
To increase security, the enclosed firewall solution SuSEFirewall2 is activated at the
end of the installation in the proposal dialog. This means that all ports are closed initially
and can be opened in the proposal dialog if necessary. By default, you cannot log in
from remote systems. It also interferes with network browsing and multicast applications,
such as SLP, Samba ("Network Neighborhood"), and some games. You can fine-tune
the firewall settings using YaST.

214 Installation and Administration


If network access is required during the installation or configuration of a service, the
respective YaST module opens the needed TCP and UDP ports of all internal and ex-
ternal interfaces. If this is not desired, close the ports in the YaST module or specify
other detailed firewall settings.

10.3.10 KDE and IPv6 Support


By default, IPv6 support is not enabled for KDE. You can enable it using the /etc/
sysconfig editor of YaST. The reason for disabling this feature is that IPv6 addresses
are not properly supported by all Internet service providers and, as a consequence, this
would lead to error messages while browsing the Web and delays while displaying Web
pages.

10.3.11 Online Update and Delta Packages


Online Update now supports a special kind of RPM package that only stores the binary
difference from a given base package. This technique significantly reduces the package
size and download time at the expense of higher CPU load for reassembling the final
package. See /usr/share/doc/packages/deltarpm/README for technical
details.

10.3.12 Print System Configuration


At the end of the installation (proposal dialog), the ports needed for the print system
must be open in the firewall configuration. Port 631/TCP and port 631/UDP are needed
for CUPS and should not be closed for normal operation. Port 515/TCP (for the old
LPD protocol) and the ports used by Samba must also be open for printing via LPD or
SMB.

10.3.13 Change to X.Org


The change from XFree86 to X.Org is facilitated by compatibility links that enable access
to important files and commands with the old names.

Updating SUSE Linux Enterprise 215


Table 10.2 Commands

XFree86 X.Org

XFree86 Xorg

xf86config xorgconfig

xf86cfg xorgcfg

Table 10.3 Log Files in /var/log

XFree86 X.Org

XFree86.0.log Xorg.0.log

XFree86.0.log.old Xorg.0.log.old

In the course of the change to X.Org, the packages were renamed from XFree86* to
xorg-x11*.

10.3.14 X.Org Configuration File


The configuration tool SaX2 writes the X.Org configuration settings into /etc/X11/
xorg.conf. During an installation from scratch, no compatibility link from
XF86Config to xorg.conf is created.

10.3.15 XView and OpenLook Support


Dropped
The packages xview, xview-devel, xview-devel-examples, olvwm, and
xtoolpl were dropped. In the past, only the XView (OpenLook) base system was
provided. The XView libraries are no longer provided after the system update. Even
more important, OLVWM (OpenLook Virtual Window Manager) is no longer available.

216 Installation and Administration


10.3.16 Terminal Emulators for X11
A number of terminal emulators were removed because they are either no longer
maintained or do not work in the default environment, especially by not supporting
UTF-8. SUSE Linux Enterprise Server offers standard terminals, such as xterm, the
KDE and GNOME terminals, and mlterm (Multilingual Terminal Emulator for X),
which might be a replacement for aterm and eterm.

10.3.17 OpenOffice.org (OOo)


Directories
OOo is now installed in /usr/lib/ooo-2.0 instead of /opt/OpenOffice
.org. The default directory for user settings is now ~/.ooo-2.0 instead of ~/
OpenOffice.org1.1.

Wrapper
There are some new wrappers for starting the OOo components. The new names
are shown in Table 10.4, “Wrapper” (page 217).

Table 10.4 Wrapper

Old New

/usr/X11R6/bin/OOo-calc /usr/bin/oocalc

/usr/X11R6/bin/OOo-draw /usr/bin/oodraw

/usr/X11R6/bin/OOo-impress /usr/bin/ooimpress

/usr/X11R6/bin/OOo-math /usr/bin/oomath

/usr/X11R6/bin/OOo-padmin /usr/sbin/oopadmin

/usr/X11R6/bin/OOo-setup –

/usr/X11R6/bin/OOo-template /usr/bin/oofromtemplate

/usr/X11R6/bin/OOo-web /usr/bin/ooweb

Updating SUSE Linux Enterprise 217


Old New

/usr/X11R6/bin/OOo-writer /usr/bin/oowriter

/usr/X11R6/bin/OOo /usr/bin/ooffice

/usr/X11R6/bin/OOo-wrapper /usr/bin/ooo-wrapper

The wrapper now supports the option --icons-set for switching between KDE
and GNOME icons. The following options are no longer supported:
--default-configuration, --gui, --java-path, --skip-check,
--lang (the language is now determined by means of locales),
--messages-in-window, and --quiet.

KDE and GNOME Support


KDE and GNOME extensions are available in the OpenOffice_org-kde and
OpenOffice_org-gnome packages.

10.3.18 Sound Mixer kmix


The sound mixer kmix is preset as the default. For high-end hardware, there are other
mixers, like QAMix. KAMix, envy24control (only ICE1712), or hdspmixer (only RME
Hammerfall).

10.3.19 DVD Burning


In the past, a patch was applied to the cdrecord binary from the cdrecord package
to support burning DVDs. Instead, a new binary cdrecord-dvd is installed that has
this patch.

The growisofs program from the dvd+rw-tools package can now burn all DVD
media (DVD+R, DVD-R, DVD+RW, DVD-RW, DVD+RL). Try using that one instead
of the patched cdrecord-dvd.

218 Installation and Administration


10.3.20 Starting Manual Installation at the
Kernel Prompt
The Manual Installation mode is gone from the boot loader screen. You can still get
linuxrc into manual mode using manual=1 at the boot prompt. Normally this is not
necessary because you can set installation options at the kernel prompt directly, such
as textmode=1 or a URL as the installation source.

10.3.21 JFS: Not Supported Anymore


Due to technical problems with JFS, it is no longer supported. The kernel file system
driver is still there, but YaST does not offer partitioning with JFS.

10.3.22 AIDE as a Tripwire Replacement


As an intrusion detection system, use AIDE (package name aide), which is released
under the GPL. Tripwire is no longer available on SUSE Linux.

10.3.23 PAM Configuration


New Configuration Files (containing comments for more information)

common-auth
Default PAM configuration for auth section

common-account
Default PAM configuration for account section

common-password
Default PAM configuration for password changing

common-session
Default PAM configuration for session management

You should include these default configuration files from within your application-spe-
cific configuration file, because it is easier to modify and maintain one file instead of

Updating SUSE Linux Enterprise 219


the approximately forty files that used to exist on the system. If you install an application
later, it inherits the already applied changes and the administrator is not required to re-
member to adjust the configuration.

The changes are simple. If you have the following configuration file (which should be
the default for most applications):
#%PAM-1.0
auth required pam_unix2.so
account required pam_unix2.so
password required pam_pwcheck.so
password required pam_unix2.so use_first_pass use_authtok
#password required pam_make.so /var/yp
session required pam_unix2.so

you can change it to:


#%PAM-1.0
auth include common-auth
account include common-account
password include common-password
session include common-session

10.3.24 Becoming the Superuser Using su


By default, calling su to become root does not set the PATH for root. Either call
su - to start a login shell with the complete environment for root or set
ALWAYS_SET_PATH to yes in /etc/default/su if you want to change the default
behavior of su.

10.3.25 Changes in the powersave Package


The configuration files in /etc/sysconfig/powersave have changed:

Table 10.5 Split Configuration Files in /etc/sysconfig/powersave

Old Now Split Into

/etc/sysconfig/powersave/ common
common

220 Installation and Administration


Old Now Split Into

cpufreq

events

battery

sleep

thermal

/etc/powersave.conf has become obsolete. Existing variables have been moved


to the files listed in Table 10.5, “Split Configuration Files in /etc/sysconfig/powersave”
(page 220). If you changed the “event” variables in /etc/powersave.conf, these
must now be adapted in /etc/sysconfig/powersave/events.

The names of sleep states have changed from:

• suspend (ACPI S4, APM suspend)

• standby (ACPI S3, APM standby)

To:

• suspend to disk (ACPI S4, APM suspend)

• suspend to ram (ACPI S3, APM suspend)

• standby (ACPI S1, APM standby)

10.3.26 Powersave Configuration Variables


Names of the powersave configuration variables are changed for consistency, but the
sysconfig files are still the same. Find more information in Section 28.5.1, “Configuring
the powersave Package” (page 516).

Updating SUSE Linux Enterprise 221


10.3.27 PCMCIA
cardmgr no longer manages PC cards. Instead, as with Cardbus cards and other sub-
systems, a kernel module manages them. All necessary actions are executed by
hotplug. The pcmcia start script has been removed and cardctl is replaced by
pccardctl. For more information, see /usr/share/doc/packages/
pcmciautils/README.SUSE.

10.3.28 Setting Up D-BUS for Interprocess


Communication in .xinitrc
Many applications now rely on D-BUS for interprocess communication (IPC). Calling
dbus-launch starts dbus-daemon. The systemwide /etc/X11/xinit/
xinitrc uses dbus-launch to start the window manager.

If you have a local ~/.xinitrc file, you must change it accordingly. Otherwise ap-
plications like f-spot, banshee, tomboy, or Network Manager banshee might fail. Save
your old ~/.xinitrc. Then copy the new template file into your home directory
with:

cp /etc/skel/.xinitrc.template ~/.xinitrc

Finally, add your customizations from the saved .xinitrc.

10.3.29 NTP-Related Files Renamed


For reasons of compatibility with LSB (Linux Standard Base), most configuration files
and the init script were renamed from xntp to ntp. The new filenames are:

• /etc/slp.reg.d/ntp.reg

• /etc/init.d/ntp

• /etc/logrotate.d/ntp

• /usr/sbin/rcntp

222 Installation and Administration


• /etc/sysconfig/ntp

10.3.30 File System Change Notification for


GNOME Applications
For proper functionality, GNOME applications depend on file system change notification
support. For local-only file systems, install the gamin package (preferred) or run the
FAM daemon. For remote file systems, run FAM on both the server and client and open
the firewall for RPC calls by FAM.

GNOME (gnome-vfs2 and libgda) contains a wrapper that picks gamin or fam to provide
file system change notification:

• If the FAM daemon is not running, gamin is preferred (Rationale: Inotify is support-
ed only by gamin and it is more efficient for local file systems).

• If the FAM daemon is running, FAM is preferred (Rationale: If FAM is running,


you probably want remote notification, which is supported only by FAM).

10.3.31 Starting an FTP Server (vsftpd)


By default, xinetd no longer starts the vsftpd FTP server. It is now a stand-alone
daemon and you must configure it with the YaST runtime editor.

10.3.32 Firefox 1.5: The URL Open Command


With Firefox 1.5, the method for applications to open a Firefox instance or window has
changed. The new method was already partly available in former versions where the
behavior was implemented in the wrapper script.

If your application does not use mozilla-xremote-client or firefox


-remote, you do not need to change anything. Otherwise the new command to open
a URL is firefox url and it does not matter whether Firefox is already running or
not. If it is already running, it follows the preference configured in Open links from
other applications in.

Updating SUSE Linux Enterprise 223


From the command line, you can influence the behavior by using firefox
-new-window url or firefox -new-tab url.

224 Installation and Administration


Part II. Administration
OpenWBEM
Novell® has embraced the open standard strategies of Web-Based Enterprise Manage-
11
ment (WBEM) proposed by the Distributed Management Task Force (DMTF)
[http://www.dmtf.org/home]. Implementing these strategies can substantially
reduce the level of complexity associated with managing disparate systems in your
network.

The following information describes a few of the components proposed by the DMTF
standards. Understanding what these are and how they relate to each other can help you
understand what OpenWBEM is and how you most effectively use it in your network.

• Web-Based Enterprise Management (WBEM) is a set of management and Internet


standard technologies developed to unify the management of enterprise computing
environments. WBEM provides the ability for the industry to deliver a well-inte-
grated set of standards-based management tools leveraging the emerging Web
technologies. The DMTF has developed a core set of standards that make up WBEM:

• A data model: the Common Information Model (CIM) standard

• An encoding specification: CIM-XML Encoding Specification

• A transport mechanism: CIM operations over HTTP

• The Common Information Model (CIM) is a conceptual information model that


describes management and is not bound to a particular implementation. This allows
for the interchange of management information between management systems and
applications. This can be either agent-to-manager or manager-to-manager commu-

OpenWBEM 227
nications that provide for distributed system management. There are two parts to
CIM: the CIM Specification and the CIM Schema.

The CIM Specification describes the language, naming, and meta schema. The
meta schema is a formal definition of the model. It defines the terms used to express
the model and their usage and semantics. The elements of the meta schema are
Classes, Properties, and Methods. The meta schema also supports Indications and
Associations as types of Classes, and References as types of Properties.

The CIM Schema provides the actual model descriptions. The CIM Schema supplies
a set of classes with properties and associations that provide a well understood
conceptual framework within which it is possible to organize the available informa-
tion about the managed environment.

• The Common Information Model Object Manager (CIMOM) is a CIM object


manager or, more specifically, an application that manages objects according to
the CIM standard.

• CIMOM providers are software that performs specific tasks within the CIMOM
that are requested by client applications. Each provider instruments one or more
aspects of the CIMOM's schema.

SUSE® Linux Enterprise Server contains the open source CIMOM from the Open-
WBEM project [http://openwbem.org].

The Web-Based Enterprise Management software selection includes a set of packages


that contain basic Novell providers, including some sample providers, and a base set
of accompanying Novell schemas.

As Novell moves forward with OpenWBEM and development of specific providers, it


will provide tools that offer the following important features:

• Efficient monitoring of network systems

• Recording of alterations within existing management configurations

• Hardware inventory and asset management

Understanding how the OpenWBEM CIMOM is set up and how to configure it can
help you monitor and manage disparate systems in your network with more confidence
and ease.

228 Installation and Administration


11.1 Setting Up OpenWBEM
To set up OpenWBEM, select the Web-Based Enterprise Management software selection
or pattern in YaST when you install SUSE Linux Enterprise Server or select it as a
component to install on a server that is already running SUSE Linux Enterprise Server.
This software selection includes the following packages:

• cim-schema, Common Information Model (CIM) Schema: This package


contains the Common Information Model (CIM). CIM is a model for describing
overall management information in a network or enterprise environment. CIM
consists of a specification and a schema. The specification defines the details for
integration with other management models. The schema provides the actual model
descriptions.

• openwbem, Web Based Enterprise Management (WBEM) Implementation:


This package contains an implementation of OpenWBEM. OpenWBEM is a set of
software components that help facilitate the deployment of the Distributed Manage-
ment Task Force (DMTF) CIM and WBEM technologies. If you are not familiar
with the DMTF and its technologies, you can visit the DMTF Web site [http://
www.dmtf.org].

• openwbem-base-providers: This package contains a Novell Linux instrumen-


tation of base operating system components such as computer, system, operating
system, and processes for the OpenWBEM CIMOM.

• openwbem-smash-providers: This package contains a Novell Linux instrumen-


tation of the Systems Management Architecture for Server Hardware (SMASH)
providers for the OpenWBEM CIMOM.

• yast2-cim, YaST2 - CIM Bindings: This package adds CIM bindings to YaST2
(YaST2 is the Graphical User Interface of the SUSE System Tools Manager). These
bindings provide a client interface to the Common Information Model Object
Manager (CIMOM).

This section includes the following information:

• Section 11.1.1, “Starting, Stopping, or Checking Status for owcimomd” (page 230)

• Section 11.1.2, “Ensuring Secure Access” (page 230)

OpenWBEM 229
• Section 11.1.3, “Setting Up Logging” (page 233)

11.1.1 Starting, Stopping, or Checking


Status for owcimomd
When Web-Based Enterprise Management software is installed, the daemon, owcimomd,
is started by default. The following table explains how to start, stop, and check status
for owcimomd.

Table 11.1 Commands for Managing owcimomd

Task Linux Command

Start owcimomd As root in a console shell, enter rcowcimomd


start.

Stop owcimomd As root in a console shell, enter rcowcimomd


stop.

Check owcimomd status As root in a console shell, enter rcowcimomd


status.

11.1.2 Ensuring Secure Access


The default setup of OpenWBEM is relatively secure. However, you might want to re-
view the following to ensure access to OpenWBEM components is as secure as desired
for your organization.

• Section “Certificates” (page 231)

• Section “Ports” (page 231)

• Section “Authentication” (page 233)

230 Installation and Administration


Certificates
Secure Socket Layers (SSL) transports require a certificate for secure communications
to occur. When OES is installed, OpenWBEM has a self-signed certificate generated
for it.

If desired, you can replace the path for the default certificate with a path to a commercial
certificate that you have purchased or with a different certificate that you have generated
in the http_server.SSL_cert = path_filename setting in the openwbem
.conf file.

The default generated certificate is in the following location:

/etc/openwbem/servercert.pem

If you want to generate a new certificate, use the following command. Running this
command replaces the current certificate, so Novell recommends making a copy of the
old certificate before generating a new one.

As root in a console shell, enter sh/etc/openwbem/owgencert.

If you want to change the certificate that OpenWBEM uses, see Section 11.2.2,
“Changing the Certificate Configuration” (page 242).

Ports
OpenWBEM is configured by default to accept all communications through a secure
port, 5989. The following table explains the port communication setup and recommended
configuration.

Table 11.2 Port Communication Setup and Recommended Configurations

Port Type Notes and Recommendations

5989 Secure The secure port that OpenWBEM communications use via HTTPS
services.

This is the default configuration.

OpenWBEM 231
Port Type Notes and Recommendations

With this setting, all communications between the CIMOM and


client applications are encrypted when sent over the Internet be-
tween servers and workstations. Users must authenticate through
the client application to view this information.

Novell recommends that you maintain this setting in the configura-


tion file.

In order for the OpenWBEM CIMOM to communicate with the


necessary applications, this port must be open in routers and fire-
walls if they are present between the client application and the
nodes being monitored.

5988 Unse- The unsecure port that OpenWBEM communications use via HTTP
cure services.

This setting is disabled by default.

With this setting, all communications between the CIMOM and


client applications are open for review when sent over the Internet
between servers and workstations by anyone without any authenti-
cation.

Novell recommends that you use this setting only when attempting
to debug a problem with the CIMOM. As soon as the problem is
resolved, set the non-secure port option back to Disabled.

In order for the OpenWBEM CIMOM to communicate with the


necessary applications that require non-secure access, this port
must be open in routers and firewalls if they are present between
the client application and the nodes being monitored.

If you want to change the default port assignments, see Section 11.2.3, “Changing the
Port Configuration” (page 243).

232 Installation and Administration


Authentication
The following authentication settings are set and enabled as the default for OpenWBEM
in SUSE Linux Enterprise Server.

You can change any of the default settings. See Section 11.2.1, “Changing the Authen-
tication Configuration” (page 234).

• http_server.allow_local_authentication = true

• http_server.ssl_client_verification = disabled

• http_server.use_digest = false

• owcimomd.allow_anonymous = false

• owcimomd.allowed_users = root

• owcimomd.authentication_module =
/usr/lib/openwbem/authentication/libpamauthentication.so

The OpenWBEM CIMOM is PAM enabled by default; therefore the local root user
can authenticate to the OpenWBEM CIMOM with local root user credentials.

11.1.3 Setting Up Logging


You can change any of the default settings. For more information, see Section 11.2.4,
“Changing the Default Logging Configuration” (page 244).

By default, logging for OpenWBEM is set up as follows.

• log.main.components = *

• log.main.level = ERROR

• log.main.type = syslog

This means that owcimomd logging is set up to go to the /var/log/messages file


or to other files depending on the configuration of syslogd. It logs all errors for all
components (owcimomd).

OpenWBEM 233
11.2 Changing the OpenWBEM
CIMOM Configuration
When OpenWBEM CIMOM (owcimomd) starts, it reads it run-time configuration from
the openwbem.conf file. The openwbem.conffile is located in the /etc/
openwbem directory.

Any setting that has the options commented out with a semicolon (;) or pound sign (#)
uses the default setting.

When making changes to this file, you can use any text editor that saves the file in a
format that is native to the platform you are using.

You can change any of the settings in the openwbem.conf file. This section discusses
the following configuration settings:

• Section 11.2.1, “Changing the Authentication Configuration” (page 234)

• Section 11.2.2, “Changing the Certificate Configuration” (page 242)

• Section 11.2.3, “Changing the Port Configuration” (page 243)

• Section 11.2.4, “Changing the Default Logging Configuration” (page 244)

• Section 11.2.5, “Configuring Debug Logging” (page 252)

• Section 11.2.6, “Configuring Additional Logs” (page 253)

11.2.1 Changing the Authentication


Configuration
When changing the Authentication configuration, there are several things that you can
control:

• Who can access the CIMOM

• What authentication module is used

234 Installation and Administration


See the following settings:

• Section “http_server.allow_local_authentication ” (page 235)

• Section “http_server.digest_password_file ” (page 236)

• Section “http_server.ssl_client_verification ” (page 236)

• Section “http_server.ssl_trust_store ” (page 237)

• Section “http_server.use_digest” (page 238)

• Section “owcimomd.ACL_superuser” (page 239)

• Section “owcimomd.allow_anonymous” (page 239)

• Section “owcimomd.allowed_users” (page 240)

• Section “owcimomd.authentication_module” (page 241)

• Section “simple_auth.password_file” (page 241)

http_server.allow_local_authentication
Purpose
Directs the http_server to allow local authentication without supplying a password, re-
lying on local system file permissions.

You can use this setting with the Basic or Digest settings.

Syntax
http_server.allow_local_authentication = option

Option Description

true Enables local authentication.

This is the default setting.

OpenWBEM 235
Option Description

false Disables local authentication.

Example
http_server.allow_local_authentication = true

http_server.digest_password_file
Purpose
Specifies a location for the password file. This is required if the http_server.use_digest
setting is enabled.

Syntax
http_server.digest_password_file = path_filename

The following is the default path and filename for the digest password file:

/etc/openwbem/digest_auth.passwd

Example
http_server.digest_password_file =
/etc/openwbem/digest_auth.passwd

http_server.ssl_client_verification
Purpose
Determines whether the server should attempt to authenticate clients with SSL Client
Certificate verification.

This setting is disabled by default.

236 Installation and Administration


Syntax:
http_server.ssl_client_verification = option

Option Description

autoupdate Specifies the same functionality as the Optional option; however,


previously unknown client certificates that pass HTTP authenti-
cation are added to a trust store so that subsequent client connec-
tions with the same certificate do not require HTTP authentica-
tion.

disabled Disables client certificate checking.

This is the default setting.

optional Allows a trusted certificate to be authenticated (no HTTP authen-


tication is necessary).

Also allows an untrusted certificate to pass the SSL handshake


if the client passes the HTTP authentication.

required Requires a trusted certificate for the SSL handshake to succeed.

Example
http_server.ssl_client_verification = disabled

http_server.ssl_trust_store
Purpose
Specifies a directory containing the OpenSSL trust store.

Syntax
http_server.ssl_trust_store = path

The following is the default path for the trust store file.

OpenWBEM 237
/etc/openwbem/truststore

Example
http_server.ssl_trust_store = /etc/openwbem/truststore

http_server.use_digest
Purpose
Directs the HTTP server to use Digest authentication, which bypasses the Basic authen-
tication mechanism. To use digest, you must set up the digest password file using
owdigestgenpass.

Digest doesn’t use the authentication module specified by the owcimomd.authentica-


tion_module configuration setting.

Syntax
http_server.use_digest = option

Option Description

false Enables the Basic authentication mechanism.

This is the default setting.

true Disables the Basic authentication mechanism.

Example
http_server.use_digest = false

238 Installation and Administration


owcimomd.ACL_superuser
Purpose
Specifies the username of the user that has access to all Common Information Model
(CIM) data in all namespaces maintained by the owcimomd. This user can be used to
administer the /root/security name space, which is where all ACL user rights
are stored.

ACL processing is not enabled until the OpenWBEM_Acl1.0.mof file has been im-
ported.

Syntax
owcimomd.ACL_superuser = username

Example
owcimomd.ACL_superuser = root

owcimomd.allow_anonymous
Purpose
Enables or disables anonymous logins to owcimomd.

Syntax
owcimomd.allow_anonymous = option

Option Description

false Requires login with a username and password to access owci-


momd data.

This is the default and recommended setting.

true Allows anonymous logins to owcimomd.

OpenWBEM 239
Option Description

This disables authentication. No username or password is required


to access owcimomd data.

Example
owcimomd.allowed_anonymous = false

owcimomd.allowed_users
Purpose
Specifies a list of users who are allowed to access owcimomd data.

Syntax
owcimomd.allowed_users = option

Option Description

username Specifies one or more users who are allowed to access the owci-
momd data.

Separate each username with a space.

* Allows all users to authenticate (for example, if you choose to


control access with ACLs instead).

This option is enforced for all authentication methods unless


owcimomd.allow_anonymous is set to True.

This is the default setting.

Example
owcimomd.allowed_users = bcwhitely jkcarey jlanderson

240 Installation and Administration


owcimomd.authentication_module
Purpose
Specifies the authentication module that is used by owcimomd. This setting should be
an absolute path to the shared library containing the authentication module.

Syntax
owcimomd.authentication_module = path_filename

The following is the default path and filename for the authentication modules:

/usr/lib/openwbem/authentication/libpamauthentication.so

Example
owcimomd.authentication_module =
/usr/lib/openwbem/authentication/libpamauthentication.so

simple_auth.password_file
Purpose
Specifies the path to the password file when the simple authentication module is used.

This setting is disabled by default.

Syntax
simple_auth.password_file = path_filename

Example
simple_auth.password_file =
/etc/openwbem/simple_auth.passwd

OpenWBEM 241
11.2.2 Changing the Certificate
Configuration
The http_server.SSL_cert and the http_server.SSL_key settings specify the location of
the file or files that contains the host's private key and the certificate that is used by
OpenSSL for HTTPS communications.

The .pem files are located in the following default location:

/etc/openwbem/servercert.pem

/etc/openwbem/serverkey.pem

Syntax
http_server.SSL_cert = path_filename

or

http_server.SSL_key = path_filename

NOTE

Both the key and certificate can be in the same file. In this case, the values of
http_server.SSL_cert and http_server.SSL_key would be the same.

Examples
http_server.SSL_cert = /etc/openwbem/servercert.pem

http_server.SSL_key = /etc/openwbem/servercert.pem

http_server.SSL_key = /etc/openwbem/serverkey.pem

242 Installation and Administration


11.2.3 Changing the Port Configuration
The http_server.http_port and server.https_port settings specify the port number that
owcimomd listens on for all HTTP and HTTPS communications.

Syntax
http_server.http_port = option

or

http_server.https_port = option

Option Description

Specific_port_number Specify the specific port for HTTP or HTTPS com-


munications.

For HTTP, the default port is 5988.

For HTTPS, the default port is 5989.

-1 Disables HTTP or HTTPS connections (for example,


if you only want to support HTTPS connections).

0 Dynamically assigns a port number at runtime.

Example
These settings disable the HTTP port and enable port 5989 for HTTPS communications:

http_server.http_port = -1

http_server.https_port = 5989

OpenWBEM 243
11.2.4 Changing the Default Logging
Configuration
The following log settings in the owcimomd.conf file let you specify where and how
much logging occurs, the type of errors logged, and the log size, filename, and format:

• Section “log.main.categories” (page 244)

• Section “log.main.components” (page 245)

• Section “log.main.format” (page 246)

• Section “log.main.level” (page 249)

• Section “log.main.location” (page 250)

• Section “log.main.max_backup_index” (page 250)

• Section “log.main.max_file_size” (page 251)

• Section “log.main.type” (page 251)

If you want to set up debug logging, see Section 11.2.5, “Configuring Debug Logging”
(page 252).

If you want to set up additional logs, see Section 11.2.6, “Configuring Additional Logs”
(page 253).

log.main.categories
Purpose
Specifies the categories the log outputs.

Syntax
log.main.categories = option

244 Installation and Administration


Option Description

category_name Specifies the categories to be logged using a space delimited


list.

The categories used in owcimomd are:

• DEBUG

• ERROR

• FATAL

• INFO

For more information about these options, see Section


“log.main.level” (page 249).

If specified in this option, the predefined categories are not


treated as levels, but as independent categories. No default is
available; and if a category is not set, no categories are logged
and the log.main.level setting is used.

* All categories are logged.

This is the default setting.

Example
log.main.categories = FATAL ERROR INFO

log.main.components
Purpose
Specifies the components that the log outputs.

OpenWBEM 245
Syntax
log.main.components = option

Option Description

component_name Specifies the components to be logged (such as owcimomd)


using a space-delimited list.

Providers can use their own components.

* Specifies that all components are logged.

This is the default setting.

Example
log.main.components = owcimomd nssd

log.main.format
Purpose
Specifies the format (text mixed with printf() style conversion specifiers) of the log
messages.

Syntax
log.main.format = conversion_specifier

Option Specifies

%% %

%c Component (such as owcimomd)

%d Date

246 Installation and Administration


Option Specifies

Can be followed by a date format specifier enclosed between


braces. For example, %d{%H:%M:%S} or %d{%d %b %Y
%H:%M:%S}. If no date format specifier is given, then ISO
8601 format is assumed.

The only addition is %Q, which is the number of milliseconds.

For more information about the date format specifiers, see the
documentation for the strftime() function found in the <ctime>
header.

%e Message as XML CDATA. This includes the “<![CDATA[“


and ending “]]>”

%F Filename

%l Filename and line number. For example, file.cpp(100)

%L Line number

%M Method name where the logging request was issued (only works
on C++ compilers which support __PRETTY_FUNCTION__
or C99’s __func__).

%m Message

%n Platform-dependent line separator character (\n) or characters


(\r\n).

%p Category, also known as level or priority.

%r Number of milliseconds elapsed between the start of the appli-


cation and the creation of the logging event.

%t Thread ID

\n New line

OpenWBEM 247
Option Specifies

\t Tab

\r Line feed

\\ \

\x<hexDigits> Character represented in hexadecimal

It is possible to change the minimum field width, the maximum field width, and justifi-
cation. The optional format modifier is placed between the percent sign (%) and the
conversion character. The first optional format modifier is the left justification flag,
which is the minus (-) character. The optional minimum field width modifier follows,
which is an integer that represents the minimum number of characters to output. If the
data item requires fewer characters, it is padded with spaces on either the left or the
right, according to the justification flag. If the data item is larger than the minimum
field width, the field is expanded to accommodate the data.

The maximum field width modifier is designated by a period (.) followed by a decimal
constant. If the data item is longer than the maximum field, then the extra characters
are removed from the beginning of the data item (by default) or from the end (if the
left justification flag was specified).

Examples
Log4j TTCC layout:

"%r [%t] %-5p %c - %m"

Similar to TTCC but with some fixed-size fields:

"%-6r [%15.15t] %-5p %30.30c - %m"

XML output conforming to log4j.dtd 1.2, which can be processed by Chainsaw (if used,
this must be on one line; it is split up here for readability):

"<log4j:event logger="%c" timestamp="%d{%s%Q}" level="%p"


thread="%t"> <log4j:message>%e</log4j:message>

248 Installation and Administration


<log4j:locationInfo class="" method="" file="%F"
line="%L"/></log4j:event>"

The following is the default:

log.main.format = [%t]%m

log.main.level
Purpose
Specifies the level the log outputs. If set, the log outputs all predefined categories at
and above the specified level.

Syntax
log.main.level = option

Option Description

DEBUG Logs all Debug, Info, Error, and Fatal error messages.

ERROR Logs all Error and Fatal error messages.

This is the default setting.

FATAL Logs only Fatal error messages.

INFO Logs all Info, Error, and Fatal error messages.

Example
log.main. level = ERROR

OpenWBEM 249
log.main.location
Purpose
Specifies the location of the log file owcimomd uses when the log.main.type setting
option specifies that logging is sent to a file.

Syntax
log.main.location = path_filename

Example
log.main.location = /system/cimom/var/owcimomd.log

log.main.max_backup_index
Purpose
Specifies the amount of backup logs that are kept before the oldest is erased.

Syntax
log.main.backup_index = option

Option Description

unsigned_integer_above_0 Specifies the number of backup logs kept.

The default setting is 1 log file.

0 No backup logs are made and the log is trun-


cated when it reaches the maximum file size.

Example
log.main.max_backup_index = 1

250 Installation and Administration


log.main.max_file_size
Purpose
Specifies the maximum size (in KB) that the owcimomd log can grow to.

Syntax
log.main.max_file_size = option

Option Description

unsigned Limits the log to a certain size in KB.


_integer_in_KB

0 Lets the log grow to an unlimited size.

This is the default setting.

Example
log.main.max_file_size = 0

log.main.type
Purpose
Specifies the type of main log owcimomd uses.

Syntax
log.main.type = option

Option Description

file Sends all messages to a file that is identified in the


log.main.location configuration setting.

OpenWBEM 251
Option Description

null Disables logging.

syslog Sends all messages to the syslog interface.

This is the default setting.

Example
log.main.type = syslog

11.2.5 Configuring Debug Logging


If owcimomd is run in debug mode, then the debug log is active with the following
settings:

• log.debug.categories = *

• log.debug.components = *

• log.debug.format = [%t] %m

• log.debug.level = *

• log.debug.type = stderr

Debug Log with Color


If you want a color version of the debug log, use the following ASCII escape codes:

log.debug.format =
\x1b[1;37;40m[\x1b[1;31;40m%-.6t\x1b[1;37;40m]\x1b[1;32;40m
%m\x1b[0;37;40m

If you want to use additional colors, use the following codes with the log.debug.format
command:

252 Installation and Administration


Table 11.3 Additional Color Codes for the log.debug.format Command

Color Codes

red \x1b[1;31;40m

dark red \x1b[0;31;40m

green \x1b[1;32;40m

dark green \x1b[0;32;40m

yellow \x1b[1;33;40m

dark yellow \x1b[0;33;40m

blue \x1b[1;34;40m

dark blue \x1b[0;34;40m

purple \x1b[1;35;40m

dark purple \x1b[0;35;40m

cyan \x1b[1;36;40m

dark cyan \x1b[0;36;40m

white \x1b[1;37;40m

dark white \x1b[0;37;40m

gray \x1b[0;37;40m

reset color \x1b[0;37;40m

11.2.6 Configuring Additional Logs


If you want to create additional logs, list the log names under this setting:

OpenWBEM 253
owcimomd.additional_logs = logname

Separate multiple lognames spaces.

Syntax
owcimomd.additional_logs = logname

For each log, the following settings apply:

• log.log_name.categories

• log.log_name.components

• log.log_name.format

• log.log_name.level

• log.log_name.location

• log.log_name.max_backup_index

• log.log_name.max_file_size

Example
owcimomd.additional_logs = errorlog1 errorlog2 errorlog3

11.3 For More Information


For more information about OpenWBEM, see the following information:

• Documents in usr/share/doc/packages/openwbem on the local server


filesystem:

• readme

• openwbem-faq.html

254 Installation and Administration


• A Novell Cool Solutions Article: An Introduction to WBEM and OpenWBEM in
SUSE Linux [http://www.novell.com/coolsolutions/feature/
14625.html]

• OpenWBEM Web site [http://www.openwbem.org]

• DMTF Web site [http://www.dmtf.org]

OpenWBEM 255
Mass Storage over IP
Networks—iSCSI
One of the central tasks in computer centers and when operating servers is providing
12
hard disk capacity for server systems. Fiber channel is often used for this purpose in
the mainframe sector. So far, UNIX computers and the majority of servers are not
connected to central storage solutions.

linux-iSCSI provides an easy and reasonably inexpensive solution for connecting Linux
computers to central storage systems. In principle, iSCSI represents a transfer of SCSI
commands on the IP level. If a program starts an inquiry for such a device, the operating
system produces the necessary SCSI commands. These are then embedded in IP packages
and encrypted as necessary by software that is commonly known as an iSCSI initiator.
The packages are then transferred to the corresponding iSCSI remote station, also called
iSCSI target.

Many storage solutions provide access over iSCSI, but it is also possible to run a Linux
server that provides an iSCSI target. In this case, it is important to set up the Linux
server optimized for file system services. The iSCSI target just accesses block devices
in Linux. Therefore it is possible to use RAID solutions to increase disk space as well
as a lot of memory to improve data caching. For more information about RAID, also
see Section 7.2, “Soft RAID Configuration” (page 119).

12.1 Setting Up an iSCSI Target


SUSE® Linux Enterprise Server comes with an open source iSCSI target solution that
evolved from the Ardis iSCSI target. A basic setup can be done with YaST, but to take
full advantage of iSCSI, a manual setup is required.

Mass Storage over IP Networks—iSCSI 257


12.1.1 Creating iSCSI Targets with YaST
The iSCSI target configuration exports existing block devices or file system images to
iSCSI initiators. First create the needed block devices with YaST or create file system
images. For an overview of partitioning, see Section 8.5.7, “Using the YaST Partitioner”
(page 149). File system images must be created manually. For example, if you want to
create the image /var/lib/xen/images/xen-0 with the size 4GB, first make
sure that the directory is there then create the image itself:
mkdir -p /var/lib/xen/images
dd if=/dev/zero of=/var/lib/xen/images/xen-0 seek=1M bs=4096 count=1

To configure the iSCSI target, run the iSCSI Target module in YaST. The configuration
is split into three tabs. In the Service tab, select the start mode and the firewall settings.
If you want to access the iSCSI target from a remote machine, select Open Port in
Firewall.

The Global tab provides settings for the iSCSI server. The authentication set here is
used for the discovery of services, not for accessing the targets. If you do not want to
restrict the access to the discovery, use No Authentication.

If authentication is needed, there are two possibilities to consider. One is that an initiator
must prove that it has the permissions to run a discovery on the iSCSI target. This is
done with Incoming Authentication. The other is that the iSCSI target must prove to
the initiator that it is the expected target. Therefore, the iSCSI target can also provide
a username and password. This is done with Outgoing Authentication. Find more infor-
mation about authentication in RFC 3720 (see http://www.ietf.org/rfc/
rfc3720.txt).

The targets are defined in the Targets tab. Use Add to create a new iSCSI target. The
first dialog asks for information about the device to export.

Target
The Target line has a fixed syntax that looks like the following:
iqn.yyyy-mm.<reversed domain name>

It always starts with iqn. yyyy-mm is the format of the date when this target is ac-
tivated. Find more about naming conventions in RFC 3722 (see http://www
.ietf.org/rfc/rfc3722.txt).

258 Installation and Administration


Identifier
The Identifier is freely selectable. It should follow some scheme to make the whole
system more structured.

LUN
It is possible to assign several LUNs to a target. To do this, select a target in the
Targets tab then click Edit. There, add new LUNs to an existing target.

Path
Add the path to the block device or file system image to export.

The next menu configures the access restrictions of the target. The configuration is very
similar to the configuration of the discovery authentication. In this case, at least an in-
coming authentication should be setup.

Next finishes the configuration of the new target, and brings you back to the overview
page of the Target tab. Activate your changes by clicking on Finish.

12.1.2 Configuring an iSCSI Target Manually


Configure an iSCSI target in /etc/ietd.conf. All parameters in this file before
the first Target declaration are global for the file. Authentication information in this
portion has a special meaning—it is not global, but is used for the discovery of the
iSCSI target.

All iSCSI authentication may be done in two directions. The iSCSI target can require
the iSCSI initiator to authenticate with the IncomingUser, which can be added
multiple times. The iSCSI initiator may also require the iSCSI target to authenticate.
Use OutgoingUser for this. Both have the same syntax:
IncomingUser <username> <password>
OutgoingUser <username> <password>

The authentication is followed by one or several target definitions. For each target, add
a Target section. This section always starts with a Target identifier followed by
definitions of logical unit numbers:
Target iqn.yyyy-mm.<reversed domain name>[:identifier]
Lun 0 Path=/dev/mapper/system-v3
Lun 1 Path=/dev/hda4
Lun 2 Path=/var/lib/xen/images/xen-1,Type=fileio

Mass Storage over IP Networks—iSCSI 259


In the Target line, yyyy-mm is the date when this target is activated, and identifier
is freely selectable. Find more about naming conventions in RFC 3722 (see http://
www.ietf.org/rfc/rfc3722.txt). Three different block devices are exported
in this example. The first one is a logical volume (see also Section 7.1, “LVM Configu-
ration” (page 111)), the second is an IDE partition, and the third is an image available
in the local file system. All these look like block devices to an iSCSI initiator.

Before activating the iSCSI target, add at least one IncomingUser after the Lun
definitions. It does the authentication for the use of this target.

To activate all your changes, restart the iscsitarget daemon with rciscsi restart.
Check your configuration in the /proc file system:
cat /proc/net/iet/volume
tid:1 name:iqn.2006-02.com.example.iserv:systems
lun:0 state:0 iotype:fileio path:/dev/mapper/system-v3
lun:1 state:0 iotype:fileio path:/dev/hda4
lun:2 state:0 iotype:fileio path:/var/lib/xen/images/xen-1

There are many more options that control the behavior of the iSCSI target. Find them
in the manual page of ietd.conf.

Active sessions are also displayed in the /proc file system. For each connected initiator,
an extra entry is added to /proc/net/iet/session:
cat /proc/net/iet/session
tid:1 name:iqn.2006-02.com.example.iserv:system-v3
sid:562949957419520
initiator:iqn.2005-11.de.suse:cn=rome.example.com,01.9ff842f5645
cid:0 ip:192.168.178.42 state:active hd:none dd:none
sid:281474980708864 initiator:iqn.2006-02.de.suse:01.6f7259c88b70
cid:0 ip:192.168.178.72 state:active hd:none dd:none

12.1.3 Configuring Online Targets with


ietadm
When changes to the iSCSI target configuration are necessary, you always must restart
the target to activate changes that are done in the configuration file. Unfortunately, all
active sessions are interrupted in this process. To maintain an undisturbed operation,
the changes should be done in the main configuration file /etc/ietd.conf, but
also made manually to the current configuration with the administration utility ietadm.

260 Installation and Administration


To create a new iSCSI target with a LUN, first update your configuration file. The ad-
ditional entry could be:

Target iqn.2006-02.com.example.iserv:system2
Lun 0 Path=/dev/mapper/system-swap2
IncomingUser joe secret

To set up this configuration manually, proceed as follows:

1 Create a new target with the command ietadm --op new --tid=2
--params Name=iqn.2006-02.com.example.iserv:system2.

2 Add a logical unit with ietadm --op new --tid=2 --lun=0


--params Path=/dev/mapper/system-swap2.

3 Set the username and password combination on this target with ietadm --op
new --tid=2 --user
--params=IncomingUser=joe,Password=secret.

4 Check the configuration with cat /proc/net/iet/volume.

It is also possible to delete active connections. First, check all active connections with
the command cat /proc/net/iet/session. This may look like:

cat /proc/net/iet/session
tid:1 name:iqn.2006-03.com.example.iserv:system
sid:281474980708864 initiator:iqn.1996-04.com.example:01.82725735af5
cid:0 ip:192.168.178.72 state:active hd:none dd:none

To delete the session with the session ID 281474980708864, use the command ietadm
--op delete --tid=1 --sid=281474980708864 --cid=0. Be aware
that this makes the device unaccessible on the client system and processes accessing
this device are likely to hang.

ietadm can also be used to change various configuration parameters. Obtain a list of
the global variables with ietadm --op show --tid=1 --sid=0. The output
looks like:

InitialR2T=Yes
ImmediateData=Yes
MaxConnections=1
MaxRecvDataSegmentLength=8192
MaxXmitDataSegmentLength=8192

Mass Storage over IP Networks—iSCSI 261


MaxBurstLength=262144
FirstBurstLength=65536
DefaultTime2Wait=2
DefaultTime2Retain=20
MaxOutstandingR2T=1
DataPDUInOrder=Yes
DataSequenceInOrder=Yes
ErrorRecoveryLevel=0
HeaderDigest=None
DataDigest=None
OFMarker=No
IFMarker=No
OFMarkInt=Reject
IFMarkInt=Reject

All of these parameters may be changed easily. For example, if you want to change the
maximum number of connections to two, use ietadm --op update --tid=1
--params=MaxConnections=2. In the file /etc/ietd.conf, the associated
line should look like MaxConnections 2.

WARNING: Update ietd.conf According to Changes with ietadm

The changes that you make with the command ietadm are not permanent
for the system. These changes are lost at the next reboot if they are not added
to the configuration file /etc/ietd.conf. Depending on the usage of iSCSI
in your network, this may lead to severe problems.

There are several more options available for the command ietadm. Find an overview
with ietadm -h. The abbreviations there are target ID (tid), session ID (sid), and
connection ID (cid). They can also be found in /proc/net/iet/session.

12.2 Configuring iSCSI Initiator


iSCSI initiator, also called client, can be used to connect to any iSCSI target. This is
not restricted to the iSCSI target solution explained above. The configuration of iSCSI
initiator involves two major steps—the discovery of available iSCSI targets and the
setup of an iSCSI session. Both can be done with YaST.

262 Installation and Administration


12.2.1 Using YaST for the iSCSI Initiator
Configuration
The configuration is divided into three tabs. The Service tab may be used to enable the
iSCSI initiator at boot time. The Connected Targets tab gives an overview of the cur-
rently connected iSCSI targets. Like the Discovered Targets tab, it gives the option to
add new targets to the system. Discovered Targets is the tab to start with. It provides
the possibility of discovering iSCSI targets in the network.

1 Use Discovery to open the discovery dialog.

2 Enter the IP address and change the port if necessary.

3 If necessary, add the Incoming or Outgoing authentication.

4 Use Next to start the discovery.

After a successful discovery, use Login to activate the target. You will be asked for
authentication information to use the selected iSCSI target. Next finishes the configura-
tion. If everything went well, the target now appears in Connected Targets.

The virtual iSCSI device is now available. Find the actual device with lsscsi:

lsscsi
[1:0:0:0] disk IET VIRTUAL-DISK 0 /dev/sda

12.2.2 Setting Up the iSCSI Initiator


Manually
Both the discovery and the configuration of iSCSI connections require a running iscsid.
When running the discovery the first time, the internal database of the iSCSI initiator
is created in the directory /var/lib/open-iscsi.

If your discovery is password protected, provide the authentication information to iscsid.


Because the internal database does not exist when doing the first discovery, it cannot
be used at this time. Instead, the configuration file /etc/iscsid.conf must be

Mass Storage over IP Networks—iSCSI 263


edited to provide the information. To add your password information for the discovery,
add the following lines to the end of /etc/iscsid.conf:
discovery.sendtargets.auth.authmethod = CHAP
discovery.sendtargets.auth.username = <username>
discovery.sendtargets.auth.password = <password>

The discovery stores all received values in an internal persistent database. In addition,
it displays all detected targets. Run this discovery with the command iscsiadm -m
discovery --type=st --portal=<targetip>. The output should look
like:
[bd0ac2] 149.44.171.99:3260,1 iqn.2006-02.com.example.iserv:systems

For each target defined on the iSCSI target, one line appears. In the previous example,
the ID of the target is bd0ac2. This ID is used to access the target. Learn how to obtain
more information about the stored data in Section 12.2.3, “The iSCSI Client Databases”
(page 264).

The special --login option of iscsiadm creates all needed devices:


iscsiadm -m node -r bd0ac2 --login

The newly generated devices show up in the output of lsscsi and can now be accessed
by mount.

12.2.3 The iSCSI Client Databases


All information that was discovered by the iSCSI initiator is stored in two database
files that reside in /var/lib/open-iscsi. There is one database for the discovery
of targets and one for the discovered nodes. When accessing a database, you first must
select if you want to get your data from the discovery or from the node database. Do
this with the -m discovery and -m node parameters of iscsiadm. Using
iscsiadm just with one of these parameters gives an overview of the stored records:
iscsiadm -m discovery
[bd0ac2] 149.44.171.99:3260,1 iqn.2006-02.com.example.iserv:systems

The record ID in this example is bd0ac2. This ID is needed for all actions that relate
to this special data set. To examine the content of the data record with the ID bd0c2,
use the following command:
iscsiadm -m node -r bd0ac2
node.name = iqn.2006-02.com.example.iserv:systems

264 Installation and Administration


node.transport_name = tcp
node.tpgt = 1
node.active_conn = 1
node.startup = manual
node.session.initial_cmdsn = 0
node.session.reopen_max = 32
node.session.auth.authmethod = CHAP
node.session.auth.username = joe
node.session.auth.password = ********
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 0
node.session.err_timeo.abort_timeout = 10
node.session.err_timeo.reset_timeout = 30
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
....

To edit the value of one of these variables, use the command iscsiadm with the
update operation. For example, if you want iscsid to log in to the iSCSI target when
it initializes, set the variable node.startup to the value automatic:
iscsiadm -m node -r bd0ac2 --op=update --name=node.startup --value=automatic

Remove obsolete data sets with the operation delete. If the record bd0ac2 is no
longer a valid record, delete this record with the command iscsiadm -m node
-r bd0ac2 --op=delete. Use this option with caution because it deletes the
record without any additional confirmation prompt.

12.2.4 For More Information


The iSCSI protocol has been available for several years. There are many reviews and
additional documentation comparing iSCSI with SAN solutions, doing performance
benchmarks, or just describing hardware solutions. Important pages for more information
about open-iscsi are:

• http://www.open-iscsi.org/

• http://www.open-iscsi.org/cgi-bin/wiki.pl

• http://www.novell.com/coolsolutions/appnote/15394.html

Mass Storage over IP Networks—iSCSI 265


There is also some online documentation available. See the manual pages of iscsiadm,
iscsid, ietd.conf, and ietd and the example configuration file /etc/iscsid
.conf.

266 Installation and Administration


Oracle Cluster File System 2
• Section 13.1, “Overview of OCFS2” (page 267)
13
• Section 13.2, “Creating an OCFS2 Volume” (page 274)

• Section 13.3, “Mounting an OCFS2 Volume” (page 279)

• Section 13.4, “Additional Information” (page 280)

13.1 Overview of OCFS2


Oracle Cluster File System 2 (OCFS2) is a general-purpose journaling file system that
is fully integrated in the Linux 2.6 kernel and later. OCFS2 allows you to store applica-
tion binary files, data files, and databases on devices in a SAN. All nodes in a cluster
have concurrent read and write access to the file system. A distributed lock manager
helps prevent file access conflicts. OCFS2 supports up to 32,000 subdirectories and
millions of files in each directory. The O2CB cluster service (a driver) runs on each
node to manage the cluster.

13.1.1 Features and Benefits


In August 2005, OCFS2 was added to SUSE Linux Enterprise Server 9 to support Oracle
Real Application Cluster (RAC) databases and Oracle Home (its application files). In
SUSE Linux Enterprise Server 10 and later, OCFS2 can be used for any of the following
storage solutions:

Oracle Cluster File System 2 267


• Oracle RAC and other databases

• General applications and workloads

• XEN image store in a cluster

XEN virtual machines and virtual servers can be stored on OCFS2 volumes that
are mounted by cluster servers to provide quick and easy portability of XEN virtual
machines between servers.

• LAMP (Linux, Apache, MySQL, and PHP | PERL | Python) stacks

In addition, it is fully integrated with Heartbeat 2.

As a high-performance, symmetric, parallel cluster file system, OCFS2 supports the


following functions:

• An application’s files are available to all nodes in the cluster. Users simply install
it once on an OCFS2 volume in the cluster.

• All nodes can concurrently read and write directly to storage via the standard file
system interface, enabling easy management of applications that run across a cluster.

• File access is coordinated through the Distributed Lock Manager (DLM).

DLM control is good for most cases, but an application’s design might limit scala-
bility if it contends with the DLM to coordinate file access.

• Storage backup functionality is available on all back-end storage. An image of the


shared application files can be easily created, which can help provide effective
disaster recovery.

OCFS2 also provides the following capabilities:

• Metadata caching

• Metadata journaling

• Cross-node file data consistency

• A GTK GUI-based administration via the ocfs2console utility

268 Installation and Administration


• Operation as a shared-root file system

• Support for multiple-block sizes (each volume can have a different block size) up
to 4 KB, for a maximum volume size of 16 TB

• Support for up to 255 cluster nodes

• Context-dependent symbolic link (CDSL) support for node-specific local files

• Asynchronous and direct I/O support for database files for improved database per-
formance

13.1.2 O2CB Cluster Service


The O2CB cluster service is a set of modules and in-memory file systems that are re-
quired to manage OCFS2 services and volumes. You can enable these modules to be
loaded and mounted system boot. For instructions, see Section 13.2.2, “Configuring
OCFS2 Services” (page 274).

Table 13.1 O2CB Cluster Service Stack

Service Description

Node Manager (NM) Keeps track of all the nodes in the /etc/ocfs2/
cluster.conf file

Heartbeat (HB) Issues up/down notifications when nodes join or leave


the cluster

TCP Handles communications between the nodes with the


TCP protocol

Distributed Lock Manager Keeps track of all locks and their owners and status
(DLM)

CONFIGFS User space configuration file system. For details, see


Section 13.1.4, “In-Memory File Systems” (page 270).

Oracle Cluster File System 2 269


Service Description

DLMFS User space interface to the kernel space DLM. For de-
tails, see Section 13.1.4, “In-Memory File Systems”
(page 270).

13.1.3 Disk Heartbeat


OCFS2 requires the nodes to be alive on the network. The O2CB cluster service sends
regular keepalive packets to ensure that they are. It uses a private interconnect between
nodes instead of the LAN to avoid network delays that might be interpreted as a node
disappearing and thus, lead to a node’s self-fencing.

The OC2B cluster service communicates the node status via a disk heartbeat. The
heartbeat system file resides on the SAN, where it is available to all nodes in the cluster.
The block assignments in the file correspond sequentially to each node’s slot assignment.

Each node reads the file and writes to its assigned block in the file at two-second inter-
vals. Changes to a node’s time stamp indicates the node is alive. A node is dead if it
does not write to the heartbeat file for a specified number of sequential intervals, called
the heartbeat threshold. Even if only a single node is alive, the O2CB cluster service
must perform this check, because another node could be added dynamically at any time.

You can modify the disk heartbeat threshold in the /etc/sysconfig/o2cb file,
using the O2CB_HEARTBEAT_THRESHOLD parameter. The wait time is calculated
as follows:

(O2CB_HEARTBEAT_THRESHOLD value - 1) * 2 = threshold in seconds

For example, if the O2CB_HEARTBEAT_THRESHOLD value is set at the default value


of 7, the wait time is 12 seconds ((7 - 1) * 2 = 12).

13.1.4 In-Memory File Systems


OCFS2 uses two in-memory file systems for communications:

270 Installation and Administration


Table 13.2 In-Memory File Systems Used by OCFS2

In-Memory Description Mount Point


File System

configfs Communicates the list of nodes in the cluster to


/config
the in-kernel node manager, and communicates the
resource used for the heartbeat to the in-kernel
heartbeat thread

ocfs2_dlmfs Communicates locking and unlocking for cluster-


/dlm
wide locks on resources to the in-kernel distributed
lock manager that keeps track of all locks and their
owners and status

13.1.5 Management Utilities and Commands


OCFS2 stores parameter files specific to the node on the node. The cluster configuration
file ( /etc/ocfs2/cluster.conf) resides on each node assigned to the cluster.

The ocfs2console utility is a GTK GUI-based interface for managing the configu-
ration of the OCFS2 services in the cluster. Use this utility to set up and save the /etc/
ocfs2/cluster.conf file to all member nodes of the cluster. In addition, you can
use it to format, tune, mount, and umount OCFS2 volumes.

IMPORTANT

The file browser column in the ocfs2console utility is prohibitively slow and
inconsistent across the cluster. We recommend that you use the ls(1) com-
mand to list files instead.

Additional OCFS2 utilities are described in the following table. For information about
syntax for these commands, see their man pages.

Oracle Cluster File System 2 271


Table 13.3 OCFS2 Utilities

OCFS2 Utili- Description


ty

de- Examines the state of the OCFS file system for the purpose of debug-
bugfs.ocfs2 ging.

fsck.ocfs2 Checks the file system for errors and optionally repairs errors.

mkfs.ocfs2 Creates an OCFS2 file system on a device, usually a partition on a


shared physical or logical disk. This tool requires the O2CB cluster
service to be up.

mount- Detects and lists all OCFS2 volumes on a clustered system. Detects
ed.ocfs2 and lists all nodes on the system that have mounted an OCFS2 device
or lists all OCFS2 devices.

ocfs2cdsl Creates a context-dependent symbolic link (CDSL) for a specified


filename (file or directory) for a node. A CDSL filename has its own
image for a specific node, but has a common name in the OCFS2.

tune.ocfs2 Changes OCFS2 file system parameters, including the volume label,
number of node slots, journal size for all node slots, and volume size.

Use the following commands to manage O2CB services. For more information about
the o2cb command syntax, see its man page.

Table 13.4 O2CB Commands

Command Description

/etc/init.d/o2cb status Reports whether the o2cb services are loaded and mounted

/etc/init.d/o2cb load Loads the O2CB modules and in-memory file systems

/etc/init.d/o2cb online Onlines the cluster named ocfs2


ocfs2

272 Installation and Administration


Command Description

At least one node in the cluster must be active for the


cluster to be online.

/etc/init.d/o2cb offline Offlines the cluster named ocfs2


ocfs2

/etc/init.d/o2cb unload Unloads the O2CB modules and in-memory file systems

/etc/init.d/o2cb start If the cluster is set up to load on boot, starts the cluster
ocfs2 named ocfs2 by loading o2cb and onlining the cluster

At least one node in the cluster must be active for the


cluster to be online.

/etc/init.d/o2cb stop If the cluster is set up to load on boot, stops the cluster
ocfs2 named ocfs2 by offlining the cluster and unloading the
O2CB modules and in-memory file systems

13.1.6 OCFS2 Packages


The OCFS2 kernel module ( ocfs2) is installed automatically in SUSE Linux Enterprise
Server 10 and later. To use OCFS2, use YaST (or the command line if you prefer) to
install the ocfs2-tools and ocfs2console packages on each node in the cluster.

1 Log in as the root user or equivalent, then open the YaST Control Center.

2 Select Software > Software Management.

3 In the Search field, enter

ocfs2

The software packages ocfs2-tools and ocfs2console should be listed


in the right panel. If they are selected, the packages are already installed.

Oracle Cluster File System 2 273


4 If you need to install the packages, select them, then click Install and follow the
on-screen instructions.

13.2 Creating an OCFS2 Volume


Follow the procedures in this section to configure your system to use OCFS2 and to
create OCFS2 volumes.

13.2.1 Prerequisites
Before you begin, do the following:

• Initialize, carve, or configure RAIDs on the SAN disks, as needed, to prepare the
devices you plan to use for your OCFS2 volumes. Leave the devices as free space.

We recommend that you store application files and data files on different OCFS2
volumes, but it is only mandatory to do so if your application volumes and data
volumes have different requirements for mounting. For example, the Oracle RAC
database volume requires the datavolume and nointr mounting options, but
the Oracle Home volume should never use these options.

• Make sure that the ocfs2console, and ocfs2-tools packages are installed.
Use YaST or command line methods to install them if they are not. For YaST in-
structions, see Section 13.1.6, “OCFS2 Packages” (page 273).

13.2.2 Configuring OCFS2 Services


Before you can create OCFS2 volumes, you must configure OCFS2 services. In the
following procedure, you generate the /etc/ocfs2/cluster.conf file, save the
cluster.conf file on all nodes, and create and start the O2CB cluster service (
o2cb).

Follow the procedure in this section for one node in the cluster.

1 Open a terminal window and log in as the root user or equivalent.

2 If the o2cb cluster service is not already enabled, enter

274 Installation and Administration


chkconfig --add o2cb

When you add a new service, chkconfig ensures that the service has either a
start or a kill entry in every run level.

3 If the ocfs2 service is not already enabled, enter

chkconfig --add ocfs2

4 Configure the o2cb cluster service driver to load on boot.

4a Enter

/etc/init.d/o2cb configure

4b At the Load O2CB driver on boot (y/n) [n] prompt, enter

(yes) to enable load on boot.

4c At the Cluster to start on boot (Enter “none” to


clear) [ocfs2] prompt, enter

none

This choice presumes that you are setting up OCFS2 for the first time or re-
setting the service. You specify a cluster name in the next step when you set
up the /etc/ocfs2/cluster.conf file.

5 Use the ocfs2console utility to set up and save the /etc/ocfs2/cluster


.conf file to all member nodes of the cluster.

This file should be the same on all the nodes in the cluster. Use the following
steps to set up the first node. Later, you can use the ocfs2console to add new
nodes to the cluster dynamically and to propagate the modified cluster.conf
file to all nodes.

Oracle Cluster File System 2 275


However, if you change other settings, such as the cluster name and IP address,
you must restart the cluster for the changes to take effect, as described in Step 6
(page 276).

5a Open the ocfs2console GUI by entering

ocfs2console

5b In the ocfs2console, select Cluster > Cluster Nodes.

If cluster.conf is not present, the console will create one with a default cluster
name of ocfs2. Modify the cluster name as desired.

5c In the Node Configuration dialog box, click Add to open the Add Node dialog
box.

5d In the Add Node dialog box, specify the unique name of your primary node,
a unique IP address (such as 192.168.1.1), and the port number (optional,
default is 7777), then click OK.

The ocfs2console console assigns node slot numbers sequentially from


0 to 254.

5e In the Node Configuration dialog box, click Apply, then click Close to dismiss
the Add Node dialog box.

5f Click Cluster > Propagate Configuration to save the cluster.conf file


to all nodes.

6 If you need to restart the OCFS2 cluster for the changes to take effect, enter the
following lines, waiting in between for the process to return a status of OK.

/etc/init.d/o2cb stop

/etc/init.d/o2cb start

276 Installation and Administration


13.2.3 Creating an OCFS2 Volume
Creating an OCFS2 file system and adding new nodes to the cluster should be performed
on only one of the nodes in the cluster.

1 Open a terminal window and log in as the root user or equivalent.

2 If the O2CB cluster service is offline, start it by entering the following command,
then wait for the process to return a status of OK.

/etc/init.d/o2cb online ocfs2

Replace ocfs2 with the actual cluster name of your OCFS2 cluster.

The OCFS2 cluster must be online, because the format operation must first ensure
that the volume is not mounted on any node in the cluster.

3 Create and format the volume using one of the following methods:

• In EVMSGUI, go to the Volumes page, select Make a file system > OCFS2,
then specify the configuration settings.

• Use the mkfs.ocfs2 utility. For information about the syntax for this
command, refer to the mkfs.ocfs2 man page.

• In the ocfs2console, click Tasks > Format, select a device in the


Available Devices list that you want to use for your OCFS2 volume, specify
the configuration settings for the volume, then click OK to format the volume.

See the following table for recommended settings.

OCFS2 Pa- Description and Recommendation


rameter

Volume la- A descriptive name for the volume to make it uniquely identifi-
bel able when it is mounted on different nodes.

Use the tunefs.ocfs2 utility to modify the label as needed.

Oracle Cluster File System 2 277


OCFS2 Pa- Description and Recommendation
rameter

Cluster size Cluster size is the smallest unit of space allocated to a file to
hold the data.

Options are 4, 8, 16, 32, 64, 128, 256, 512, and 1024 KB. Cluster
size cannot be modified after the volume is formatted.

Oracle recommends a cluster size of 128 KB or larger for


database volumes. Oracle also recommends a cluster size of 32
or 64 KB for Oracle Home.

Number of The maximum number of nodes that can concurrently mount a


node slots volume. On mounting, OCFS2 creates separate system files,
such as the journals, for each of the nodes. Nodes that access
the volume can be a combination of little-endian architectures
(such as x86, x86-64, and ia64) and big-endian architectures
(such as ppc64 and s390x).

Node-specific files are referred to as local files. A node slot


number is appended to the local file. For example: journal:0000
belongs to whatever node is assigned to slot number 0.

Set each volume’s maximum number of node slots when you


create it, according to how many nodes that you expect to con-
currently mount the volume. Use the tunefs.ocfs2 utility
to increase the number of node slots as needed; the value cannot
be decreased.

Block size The smallest unit of space addressable by the file system.
Specify the block size when you create the volume.

Options are 512 bytes (not recommended), 1 KB, 2 KB, or 4


KB (recommended for most volumes). Block size cannot be
modified after the volume is formatted.

278 Installation and Administration


13.3 Mounting an OCFS2 Volume
1 Open a terminal window and log in as the root user or equivalent.

2 If the O2CB cluster service is offline, start it by entering the following command,
then wait for the process to return a status of OK.

/etc/init.d/o2cb online ocfs2

Replace ocfs2 with the actual cluster name of your OCFS2 cluster.

The OCFS2 cluster must be online, because the format operation must ensure
that the volume is not mounted on any node in the cluster.

3 Use one of the following methods to mount the volume.

• In the ocfs2console, select a device in the Available Devices list, click


Mount, specify the directory mount point and mount options (optional), then
click OK.

• Mount the volume from the command line, using the mount command.

• Mount the volume from the /etc/fstab file on system boot.

Mounting an OCFS2 volume takes about 5 seconds, depending on how long it


takes for the heartbeat thread to stabilize. On a successful mount, the device list
in the ocfs2console shows the mount point along with the device.

For information about mounting an OCFS2 volume using any of these methods,
see the OCFS2 User Guide [http://oss.oracle.com/projects/
ocfs2/documentation/] on the OCFS2 project at Oracle [http://oss
.oracle.com/projects/ocfs2/].

When running Oracle RAC, make sure to use the datavolume and nointr
mounting options for OCFS2 volumes that contain the Voting diskfile (CRS),
Cluster registry (OCR), Data files, Redo logs, Archive logs, and Control files.
Do not use these options when mounting the Oracle Home volume.

Oracle Cluster File System 2 279


Option Description

Ensures that the Oracle processes open the files with the o_direct
datavolume
flag.

No interruptions. Ensures the IO is not interrupted by signals.


nointr

13.4 Additional Information


For information about using OCFS2, see the OCFS2 User Guide [http://oss
.oracle.com/projects/ocfs2/documentation/] on the OCFS2 project
at Oracle [http://oss.oracle.com/projects/ocfs2/].

280 Installation and Administration


Access Control Lists in Linux
POSIX ACLs (access control lists) can be used as an expansion of the traditional per-
14
mission concept for file system objects. With ACLs, permissions can be defined more
flexibly than the traditional permission concept allows.

The term POSIX ACL suggests that this is a true POSIX (portable operating system
interface) standard. The respective draft standards POSIX 1003.1e and POSIX 1003.2c
have been withdrawn for several reasons. Nevertheless, ACLs as found on many systems
belonging to the UNIX family are based on these drafts and the implementation of file
system ACLs as described in this chapter follows these two standards as well. They
can be viewed at http://wt.xpilot.org/publications/posix.1e/.

14.1 Traditional File Permissions


The basics of traditional Linux file permissions are explained in Section 17.2, “Users
and Access Permissions” (page 343). More advanced features are the setuid, setgid, and
sticky bit.

14.1.1 The setuid Bit


In certain situations, the access permissions may be too restrictive. Therefore, Linux
has additional settings that enable the temporary change of the current user and group
identity for a specific action. For example, the passwd program normally requires
root permissions to access /etc/passwd. This file contains some important informa-
tion, like the home directories of users and user and group IDs. Thus, a normal user

Access Control Lists in Linux 281


would not be able to change passwd, because it would be too dangerous to grant all
users direct access to this file. A possible solution to this problem is the setuid mecha-
nism. setuid (set user ID) is a special file attribute that instructs the system to execute
programs marked accordingly under a specific user ID. Consider the passwd command:

-rwsr-xr-x 1 root shadow 80036 2004-10-02 11:08 /usr/bin/passwd

You can see the s that denotes that the setuid bit is set for the user permission. By
means of the setuid bit, all users starting the passwd command execute it as root.

14.1.2 The setgid Bit


The setuid bit applies to users. However, there is also an equivalent property for groups:
the setgid bit. A program for which this bit was set runs under the group ID under which
it was saved, no matter which user starts it. Therefore, in a directory with the setgid bit,
all newly created files and subdirectories are assigned to the group to which the direc-
tory belongs. Consider the following example directory:
drwxrws--- 2 tux archive 48 Nov 19 17:12 backup

You can see the s that denotes that the setgid bit is set for the group permission. The
owner of the directory and members of the group archive may access this directory.
Users that are not members of this group are “mapped” to the respective group. The
effective group ID of all written files will be archive. For example, a backup program
that runs with the group ID archive is able to access this directory even without root
privileges.

14.1.3 The Sticky Bit


There is also the sticky bit. It makes a difference whether it belongs to an executable
program or a directory. If it belongs to a program, a file marked in this way is loaded
to RAM to avoid needing to get it from the hard disk each time it is used. This attribute
is used rarely, because modern hard disks are fast enough. If this bit is assigned to a
directory, it prevents users from deleting each other's files. Typical examples include
the /tmp and /var/tmp directories:
drwxrwxrwt 2 root root 1160 2002-11-19 17:15 /tmp

282 Installation and Administration


14.2 Advantages of ACLs
Traditionally, three permission sets are defined for each file object on a Linux system.
These sets include the read (r), write (w), and execute (x) permissions for each of three
types of users—the file owner, the group, and other users. In addition to that, it is pos-
sible to set the set user id, the set group id, and the sticky bit. This lean concept is fully
adequate for most practical cases. However, for more complex scenarios or advanced
applications, system administrators formerly had to use a number of tricks to circumvent
the limitations of the traditional permission concept.

ACLs can be used as an extension of the traditional file permission concept. They allow
assignment of permissions to individual users or groups even if these do not correspond
to the original owner or the owning group. Access control lists are a feature of the
Linux kernel and are currently supported by ReiserFS, Ext2, Ext3, JFS, and XFS. Using
ACLs, complex scenarios can be realized without implementing complex permission
models on the application level.

The advantages of ACLs are evident if you want to replace a Windows server with a
Linux server. Some of the connected workstations may continue to run under Windows
even after the migration. The Linux system offers file and print services to the Windows
clients with Samba. With Samba supporting access control lists, user permissions can
be configured both on the Linux server and in Windows with a graphical user interface
(only Windows NT and later). With winbindd, part of the samba suite, it is even
possible to assign permissions to users only existing in the Windows domain without
any account on the Linux server.

14.3 Definitions
user class
The conventional POSIX permission concept uses three classes of users for assign-
ing permissions in the file system: the owner, the owning group, and other users.
Three permission bits can be set for each user class, giving permission to read (r),
write (w), and execute (x).

access ACL
The user and group access permissions for all kinds of file system objects (files
and directories) are determined by means of access ACLs.

Access Control Lists in Linux 283


default ACL
Default ACLs can only be applied to directories. They determine the permissions
a file system object inherits from its parent directory when it is created.

ACL entry
Each ACL consists of a set of ACL entries. An ACL entry contains a type, a qual-
ifier for the user or group to which the entry refers, and a set of permissions. For
some entry types, the qualifier for the group or users is undefined.

14.4 Handling ACLs


Table 14.1, “ACL Entry Types” (page 285) summarizes the six possible types of ACL
entries, each defining permissions for a user or a group of users. The owner entry defines
the permissions of the user owning the file or directory. The owning group entry defines
the permissions of the file's owning group. The superuser can change the owner or
owning group with chown or chgrp, in which case the owner and owning group entries
refer to the new owner and owning group. Each named user entry defines the permissions
of the user specified in the entry's qualifier field. Each named group entry defines the
permissions of the group specified in the entry's qualifier field. Only the named user
and named group entries have a qualifier field that is not empty. The other entry defines
the permissions of all other users.

The mask entry further limits the permissions granted by named user, named group,
and owning group entries by defining which of the permissions in those entries are ef-
fective and which are masked. If permissions exist in one of the mentioned entries as
well as in the mask, they are effective. Permissions contained only in the mask or only
in the actual entry are not effective—meaning the permissions are not granted. All
permissions defined in the owner and owning group entries are always effective. The
example in Table 14.2, “Masking Access Permissions” (page 285) demonstrates this
mechanism.

There are two basic classes of ACLs: A minimum ACL contains only the entries for
the types owner, owning group, and other, which correspond to the conventional per-
mission bits for files and directories. An extended ACL goes beyond this. It must contain
a mask entry and may contain several entries of the named user and named group types.

284 Installation and Administration


Table 14.1 ACL Entry Types

Type Text Form

owner user::rwx

named user user:name:rwx

owning group group::rwx

named group group:name:rwx

mask mask::rwx

other other::rwx

Table 14.2 Masking Access Permissions

Entry Type Text Form Permissions

named user user:geeko:r-x r-x

mask mask::rw- rw-

effective permissions: r--

14.4.1 ACL Entries and File Mode Permission


Bits
Figure 14.1, “Minimum ACL: ACL Entries Compared to Permission Bits” (page 286)
and Figure 14.2, “Extended ACL: ACL Entries Compared to Permission Bits” (page 286)
illustrate the two cases of a minimum ACL and an extended ACL. The figures are
structured in three blocks—the left block shows the type specifications of the ACL
entries, the center block displays an example ACL, and the right block shows the re-
spective permission bits according to the conventional permission concept, for example,
as displayed by ls -l. In both cases, the owner class permissions are mapped to the

Access Control Lists in Linux 285


ACL entry owner. Other class permissions are mapped to the respective ACL entry.
However, the mapping of the group class permissions is different in the two cases.

Figure 14.1 Minimum ACL: ACL Entries Compared to Permission Bits

In the case of a minimum ACL—without mask—the group class permissions are mapped
to the ACL entry owning group. This is shown in Figure 14.1, “Minimum ACL: ACL
Entries Compared to Permission Bits” (page 286). In the case of an extended ACL—with
mask—the group class permissions are mapped to the mask entry. This is shown in
Figure 14.2, “Extended ACL: ACL Entries Compared to Permission Bits” (page 286).

Figure 14.2 Extended ACL: ACL Entries Compared to Permission Bits

This mapping approach ensures the smooth interaction of applications, regardless of


whether they have ACL support. The access permissions that were assigned by means
of the permission bits represent the upper limit for all other “fine adjustments” made
with an ACL. Changes made to the permission bits are reflected by the ACL and vice
versa.

14.4.2 A Directory with an Access ACL


With getfacl and setfacl on the command line, you can access ACLs. The usage
of these commands is demonstrated in the following example.

286 Installation and Administration


Before creating the directory, use the umask command to define which access permis-
sions should be masked each time a file object is created. The command umask 027
sets the default permissions by giving the owner the full range of permissions (0),
denying the group write access (2), and giving other users no permissions at all (7).
umask actually masks the corresponding permission bits or turns them off. For details,
consult the umask man page.

mkdir mydir creates the mydir directory with the default permissions as set by
umask. Use ls -dl mydir to check whether all permissions were assigned correctly.
The output for this example is:

drwxr-x--- ... tux project3 ... mydir

With getfacl mydir, check the initial state of the ACL. This gives information
like:

# file: mydir
# owner: tux
# group: project3
user::rwx
group::r-x
other::---

The first three output lines display the name, owner, and owning group of the directory.
The next three lines contain the three ACL entries owner, owning group, and other. In
fact, in the case of this minimum ACL, the getfacl command does not produce any
information you could not have obtained with ls.

Modify the ACL to assign read, write, and execute permissions to an additional user
geeko and an additional group mascots with:

setfacl -m user:geeko:rwx,group:mascots:rwx mydir

The option -m prompts setfacl to modify the existing ACL. The following argument
indicates the ACL entries to modify (multiple entries are separated by commas). The
final part specifies the name of the directory to which these modifications should be
applied. Use the getfacl command to take a look at the resulting ACL.

# file: mydir
# owner: tux
# group: project3

Access Control Lists in Linux 287


user::rwx
user:geeko:rwx
group::r-x
group:mascots:rwx
mask::rwx
other::---

In addition to the entries initiated for the user geeko and the group mascots, a mask
entry has been generated. This mask entry is set automatically so that all permissions
are effective. setfacl automatically adapts existing mask entries to the settings
modified, unless you deactivate this feature with -n. mask defines the maximum effec-
tive access permissions for all entries in the group class. This includes named user,
named group, and owning group. The group class permission bits displayed by ls -dl
mydir now correspond to the mask entry.

drwxrwx---+ ... tux project3 ... mydir

The first column of the output contains an additional + to indicate that there is an ex-
tended ACL for this item.

According to the output of the ls command, the permissions for the mask entry include
write access. Traditionally, such permission bits would mean that the owning group
(here project3) also has write access to the directory mydir. However, the effective
access permissions for the owning group correspond to the overlapping portion of the
permissions defined for the owning group and for the mask—which is r-x in our ex-
ample (see Table 14.2, “Masking Access Permissions” (page 285)). As far as the effective
permissions of the owning group in this example are concerned, nothing has changed
even after the addition of the ACL entries.

Edit the mask entry with setfacl or chmod. For example, use chmod g-w mydir.
ls -dl mydir then shows:

drwxr-x---+ ... tux project3 ... mydir

getfacl mydir provides the following output:

# file: mydir
# owner: tux
# group: project3
user::rwx
user:geeko:rwx # effective: r-x
group::r-x

288 Installation and Administration


group:mascots:rwx # effective: r-x
mask::r-x
other::---

After executing the chmod command to remove the write permission from the group
class bits, the output of the ls command is sufficient to see that the mask bits must
have changed accordingly: write permission is again limited to the owner of mydir.
The output of the getfacl confirms this. This output includes a comment for all those
entries in which the effective permission bits do not correspond to the original permis-
sions, because they are filtered according to the mask entry. The original permissions
can be restored at any time with chmod g+w mydir.

14.4.3 A Directory with a Default ACL


Directories can have a default ACL, which is a special kind of ACL defining the access
permissions that objects in the directory inherit when they are created. A default ACL
affects both subdirectories and files.

Effects of a Default ACL


There are two ways in which the permissions of a directory's default ACL are passed
to the files and subdirectories:

• A subdirectory inherits the default ACL of the parent directory both as its default
ACL and as an access ACL.

• A file inherits the default ACL as its access ACL.

All system calls that create file system objects use a mode parameter that defines the
access permissions for the newly created file system object. If the parent directory does
not have a default ACL, the permission bits as defined by the umask are subtracted
from the permissions as passed by the mode parameter, with the result being assigned
to the new object. If a default ACL exists for the parent directory, the permission bits
assigned to the new object correspond to the overlapping portion of the permissions of
the mode parameter and those that are defined in the default ACL. The umask is dis-
regarded in this case.

Access Control Lists in Linux 289


Application of Default ACLs
The following three examples show the main operations for directories and default
ACLs:

1. Add a default ACL to the existing directory mydir with:

setfacl -d -m group:mascots:r-x mydir

The option -d of the setfacl command prompts setfacl to perform the fol-
lowing modifications (option -m) in the default ACL.

Take a closer look at the result of this command:

getfacl mydir

# file: mydir
# owner: tux
# group: project3
user::rwx
user:geeko:rwx
group::r-x
group:mascots:rwx
mask::rwx
other::---
default:user::rwx
default:group::r-x
default:group:mascots:r-x
default:mask::r-x
default:other::---

getfacl returns both the access ACL and the default ACL. The default ACL is
formed by all lines that start with default. Although you merely executed the
setfacl command with an entry for the mascots group for the default ACL,
setfacl automatically copied all other entries from the access ACL to create a
valid default ACL. Default ACLs do not have an immediate effect on access per-
missions. They only come into play when file system objects are created. These
new objects inherit permissions only from the default ACL of their parent directory.

2. In the next example, use mkdir to create a subdirectory in mydir, which inherits
the default ACL.

mkdir mydir/mysubdir

290 Installation and Administration


getfacl mydir/mysubdir

# file: mydir/mysubdir
# owner: tux
# group: project3
user::rwx
group::r-x
group:mascots:r-x
mask::r-x
other::---
default:user::rwx
default:group::r-x
default:group:mascots:r-x
default:mask::r-x
default:other::---

As expected, the newly-created subdirectory mysubdir has the permissions from


the default ACL of the parent directory. The access ACL of mysubdir is an exact
reflection of the default ACL of mydir. The default ACL that this directory will
hand down to its subordinate objects is also the same.

3. Use touch to create a file in the mydir directory, for example, touch
mydir/myfile. ls -l mydir/myfile then shows:

-rw-r-----+ ... tux project3 ... mydir/myfile

The output of getfacl mydir/myfile is:

# file: mydir/myfile
# owner: tux
# group: project3
user::rw-
group::r-x # effective:r--
group:mascots:r-x # effective:r--
mask::r--
other::---

touch uses a mode with the value 0666 when creating new files, which means
that the files are created with read and write permissions for all user classes, pro-
vided no other restrictions exist in umask or in the default ACL (see Section
“Effects of a Default ACL” (page 289)). In effect, this means that all access permis-
sions not contained in the mode value are removed from the respective ACL entries.
Although no permissions were removed from the ACL entry of the group class,
the mask entry was modified to mask permissions not set in mode.

Access Control Lists in Linux 291


This approach ensures the smooth interaction of applications, such as compilers,
with ACLs. You can create files with restricted access permissions and subsequently
mark them as executable. The mask mechanism guarantees that the right users
and groups can execute them as desired.

14.4.4 The ACL Check Algorithm


A check algorithm is applied before any process or application is granted access to an
ACL-protected file system object. As a basic rule, the ACL entries are examined in the
following sequence: owner, named user, owning group or named group, and other. The
access is handled in accordance with the entry that best suits the process. Permissions
do not accumulate.

Things are more complicated if a process belongs to more than one group and would
potentially suit several group entries. An entry is randomly selected from the suitable
entries with the required permissions. It is irrelevant which of the entries triggers the
final result “access granted”. Likewise, if none of the suitable group entries contains
the required permissions, a randomly selected entry triggers the final result “access
denied”.

14.5 ACL Support in Applications


ACLs can be used to implement very complex permission scenarios that meet the re-
quirements of modern applications. The traditional permission concept and ACLs can
be combined in a smart manner. The basic file commands (cp, mv, ls, etc.) support
ACLs, as do Samba and Konqueror.

Unfortunately, many editors and file managers still lack ACL support. When copying
files with Emacs, for instance, the ACLs of these files are lost. When modifying files
with an editor, the ACLs of files are sometimes preserved and sometimes not, depending
on the backup mode of the editor used. If the editor writes the changes to the original
file, the access ACL is preserved. If the editor saves the updated contents to a new file
that is subsequently renamed to the old filename, the ACLs may be lost, unless the ed-
itor supports ACLs. Except for the star archiver, there are currently no backup applica-
tions that preserve ACLs.

292 Installation and Administration


14.6 For More Information
Detailed information about ACLs is available at http://acl.bestbits.at/.
Also see the man pages for getfacl(1), acl(5), and setfacl(1).

Access Control Lists in Linux 293


RPM—the Package Manager
RPM (RPM Package Manager) is used for managing software packages. Its main
15
commands are rpm and rpmbuild. The powerful RPM database can be queried by
the users, system administrators, and package builders for detailed information about
the installed software.

Essentially, rpm has five modes: installing, uninstalling, or updating software packages;
rebuilding the RPM database; querying RPM bases or individual RPM archives; integrity
checking of packages; and signing packages. rpmbuild can be used to build installable
packages from pristine sources.

Installable RPM archives are packed in a special binary format. These archives consist
of the program files to install and certain meta information used during the installation
by rpm to configure the software package or stored in the RPM database for documen-
tation purposes. RPM archives normally have the extension .rpm.

TIP: Software Development Packages

For a number of packages, the components needed for software development


(libraries, headers, include files, etc.) have been put into separate packages.
These development packages are only needed if you want to compile software
yourself, for example, the most recent GNOME packages. They can be identified
by the name extension -devel, such as the packages alsa-devel,
gimp-devel, and kdelibs3-devel.

RPM—the Package Manager 295


15.1 Verifying Package Authenticity
RPM packages have a GnuPG signature. The key including the fingerprint is:

1024D/9C800ACA 2000-10-19 SuSE Package Signing Key <[email protected]>


Key fingerprint = 79C1 79B2 E1C8 20C1 890F 9994 A84E DAE8 9C80 0ACA

The command rpm --checksig package-1.2.3.rpm can be used to verify


the signature of an RPM package to determine whether it really originates from SUSE
or from another trustworthy facility. This is especially recommended for update packages
from the Internet. The SUSE public package signature key normally resides in /root/
.gnupg/. The key is additionally located in the directory /usr/lib/rpm/gnupg/
to enable normal users to verify the signature of RPM packages.

15.2 Managing Packages: Install,


Update, and Uninstall
Normally, the installation of an RPM archive is quite simple: rpm -i package.rpm.
With this command, the package is installed, but only if its dependencies are fulfilled
and there are no conflicts with other packages. With an error message, rpm requests
those packages that need to be installed to meet dependency requirements. In the
background, the RPM database ensures that no conflicts arise—a specific file can only
belong to one package. By choosing different options, you can force rpm to ignore
these defaults, but this is only for experts. Otherwise, risk compromising the integrity
of the system and possibly jeopardize the ability to update the system.

The options -U or --upgrade and -F or --freshen can be used to update a


package, for example, rpm -F package.rpm. This command removes the files of
the old version and immediately installs the new files. The difference between the two
versions is that -U installs packages that previously did not exist in the system, but -F
merely updates previously installed packages. When updating, rpm updates configuration
files carefully using the following strategy:

• If a configuration file was not changed by the system administrator, rpm installs
the new version of the appropriate file. No action by the system administrator is
required.

296 Installation and Administration


• If a configuration file was changed by the system administrator before the update,
rpm saves the changed file with the extension .rpmorig or .rpmsave (backup
file) and installs the version from the new package, but only if the originally installed
file and the newer version are different. If this is the case, compare the backup file
(.rpmorig or .rpmsave) with the newly installed file and make your changes
again in the new file. Afterwards, be sure to delete all .rpmorig and .rpmsave
files to avoid problems with future updates.

• .rpmnew files appear if the configuration file already exists and if the noreplace
label was specified in the .spec file.

Following an update, .rpmsave and .rpmnew files should be removed after compar-
ing them, so they do not obstruct future updates. The .rpmorig extension is assigned
if the file has not previously been recognized by the RPM database.

Otherwise, .rpmsave is used. In other words, .rpmorig results from updating from
a foreign format to RPM. .rpmsave results from updating from an older RPM to a
newer RPM. .rpmnew does not disclose any information as to whether the system
administrator has made any changes to the configuration file. A list of these files is
available in /var/adm/rpmconfigcheck. Some configuration files (like /etc/
httpd/httpd.conf) are not overwritten to allow continued operation.

The -U switch is not just an equivalent to uninstalling with the -e option and installing
with the -i option. Use -U whenever possible.

To remove a package, enter rpm -e package. rpm only deletes the package if there
are no unresolved dependencies. It is theoretically impossible to delete Tcl/Tk, for ex-
ample, as long as another application requires it. Even in this case, RPM calls for assis-
tance from the database. If such a deletion is—for whatever reason and under unusual
circumstances—impossible, even if no additional dependencies exist, it may be helpful
to rebuild the RPM database using the option --rebuilddb.

15.3 RPM and Patches


To guarantee the operational security of a system, update packages must be installed
in the system from time to time. Previously, a bug in a package could only be eliminated
by replacing the entire package. Large packages with bugs in small files could easily

RPM—the Package Manager 297


result in large amounts of data. However the SUSE RPM offers a feature enabling the
installation of patches in packages.

The most important considerations are demonstrated using pine as an example:

Is the patch RPM suitable for my system?


To check this, first query the installed version of the package. For pine, this can be
done with

rpm -q pine
pine-4.44-188

Then check if the patch RPM is suitable for this version of pine:
rpm -qp --basedon pine-4.44-224.i586.patch.rpm
pine = 4.44-188
pine = 4.44-195
pine = 4.44-207

This patch is suitable for three different versions of pine. The installed version in
the example is also listed, so the patch can be installed.

Which files are replaced by the patch?


The files affected by a patch can easily be seen in the patch RPM. The rpm param-
eter -P allows selection of special patch features. Display the list of files with the
following command:

rpm -qpPl pine-4.44-224.i586.patch.rpm


/etc/pine.conf
/etc/pine.conf.fixed
/usr/bin/pine

or, if the patch is already installed, with the following command:

rpm -qPl pine


/etc/pine.conf
/etc/pine.conf.fixed
/usr/bin/pine

How can a patch RPM be installed in the system?


Patch RPMs are used just like normal RPMs. The only difference is that a suitable
RPM must already be installed.

298 Installation and Administration


Which patches are already installed in the system and for which package versions?
A list of all patches installed in the system can be displayed with the command
rpm -qPa. If only one patch is installed in a new system (as in this example), the
list appears as follows:

rpm -qPa
pine-4.44-224

If, at a later date, you want to know which package version was originally installed,
this information is also available in the RPM database. For pine, this information
can be displayed with the following command:

rpm -q --basedon pine


pine = 4.44-188

More information, including information about the patch feature of RPM, is available
in the man pages of rpm and rpmbuild.

15.4 Delta RPM Packages


Delta RPM packages contain the difference between an old and a new version of an
RPM package. Applying a delta RPM on an old RPM results in the complete new RPM.
It is not necessary to have a copy of the old RPM, because a delta RPM can also work
with an installed RPM. The delta RPM packages are even smaller in size than patch
RPMs, which is an advantage when transferring update packages over the Internet. The
drawback is that update operations with delta RPMs involved consume considerably
more CPU cycles than plain or patch RPMs.

The prepdeltarpm, writedeltarpm, and applydeltarpm binaries are part


of the delta RPM suite (package deltarpm) and help you create and apply delta RPM
packages. With the following commands, create a delta RPM called new.delta.rpm.
The following command assumes that old.rpm and new.rpm are present:
prepdeltarpm -s seq -i info old.rpm > old.cpio
prepdeltarpm -f new.rpm > new.cpio
xdelta delta -0 old.cpio new.cpio delta
writedeltarpm new.rpm delta info new.delta.rpm

Finally, remove the temporary working files old.cpio, new.cpio, and delta.

RPM—the Package Manager 299


Using applydeltarpm, you can reconstruct the new RPM from the file system if
the old package is already installed:
applydeltarpm new.delta.rpm new.rpm

To derive it from the old RPM without accessing the file system, use the -r option:
applydeltarpm -r old.rpm new.delta.rpm new.rpm

See /usr/share/doc/packages/deltarpm/README" for technical details.

15.5 RPM Queries


With the -q option, rpm initiates queries, making it possible to inspect an RPM archive
(by adding the option -p) and also to query the RPM database of installed packages.
Several switches are available to specify the type of information required. See Table 15.1,
“The Most Important RPM Query Options” (page 300).

Table 15.1 The Most Important RPM Query Options

-i Package information

-l File list

-f FILE Query the package that contains the file FILE (the full
path must be specified with FILE)

-s File list with status information (implies -l)

-d List only documentation files (implies -l)

-c List only configuration files (implies -l)

--dump File list with complete details (to be used with -l, -c, or
-d)

--provides List features of the package that another package can re-
quest with --requires

300 Installation and Administration


--requires, -R Capabilities the package requires

--scripts Installation scripts (preinstall, postinstall, uninstall)

For example, the command rpm -q -i wget displays the information shown in
Example 15.1, “rpm -q -i wget” (page 301).

Example 15.1 rpm -q -i wget

Name : wget Relocations: (not relocatable)


Version : 1.9.1 Vendor: SUSE LINUX AG,
Nuernberg, Germany
Release : 50 Build Date: Sat 02 Oct 2004
03:49:13 AM CEST
Install date: Mon 11 Oct 2004 10:24:56 AM CEST Build Host: f53.suse.de
Group : Productivity/Networking/Web/Utilities Source RPM:
wget-1.9.1-50.src.rpm
Size : 1637514 License: GPL
Signature : DSA/SHA1, Sat 02 Oct 2004 03:59:56 AM CEST, Key ID
a84edae89c800aca
Packager : http://www.suse.de/feedback
URL : http://wget.sunsite.dk/
Summary : A tool for mirroring FTP and HTTP servers
Description :
Wget enables you to retrieve WWW documents or FTP files from a server.
This can be done in script files or via the command line.
[...]

The option -f only works if you specify the complete filename with its full path. Provide
as many filenames as desired. For example, the following command
rpm -q -f /bin/rpm /usr/bin/wget

results in:

rpm-4.1.1-191
wget-1.9.1-50

If only part of the filename is known, use a shell script as shown in Example 15.2,
“Script to Search for Packages” (page 302). Pass the partial filename to the script shown
as a parameter when running it.

RPM—the Package Manager 301


Example 15.2 Script to Search for Packages

#! /bin/sh
for i in $(rpm -q -a -l | grep $1); do
echo "\"$i\" is in package:"
rpm -q -f $i
echo ""
done

The command rpm -q --changelog rpm displays a detailed list of change infor-
mation about a specific package, sorted by date. This example shows information about
the package rpm.

With the help of the installed RPM database, verification checks can be made. Initiate
these with -V, -y, or --verify. With this option, rpm shows all files in a package
that have been changed since installation. rpm uses eight character symbols to give
some hints about the following changes:

Table 15.2 RPM Verify Options

5 MD5 check sum

S File size

L Symbolic link

T Modification time

D Major and minor device numbers

U Owner

G Group

M Mode (permissions and file type)

In the case of configuration files, the letter c is printed. For example, for changes to
/etc/wgetrc (wget):

rpm -V wget
S.5....T c /etc/wgetrc

302 Installation and Administration


The files of the RPM database are placed in /var/lib/rpm. If the partition /usr
has a size of 1 GB, this database can occupy nearly 30 MB, especially after a complete
update. If the database is much larger than expected, it is useful to rebuild the database
with the option --rebuilddb. Before doing this, make a backup of the old database.
The cron script cron.daily makes daily copies of the database (packed with gzip)
and stores them in /var/adm/backup/rpmdb. The number of copies is controlled
by the variable MAX_RPMDB_BACKUPS (default: 5) in /etc/sysconfig/backup.
The size of a single backup is approximately 1 MB for 1 GB in /usr.

15.6 Installing and Compiling Source


Packages
All source packages carry a .src.rpm extension (source RPM).

TIP

Source packages can be copied from the installation medium to the hard disk
and unpacked with YaST. They are not, however, marked as installed ([i]) in
the package manager. This is because the source packages are not entered in
the RPM database. Only installed operating system software is listed in the RPM
database. When you “install” a source package, only the source code is added
to the system.

The following directories must be available for rpm and rpmbuild in /usr/src/
packages (unless you specified custom settings in a file like /etc/rpmrc):

SOURCES
for the original sources (.tar.bz2 or .tar.gz files, etc.) and for distribution-
specific adjustments (mostly .diff or .patch files)

SPECS
for the .spec files, similar to a meta Makefile, which control the build process

BUILD
all the sources are unpacked, patched, and compiled in this directory

RPM—the Package Manager 303


RPMS
where the completed binary packages are stored

SRPMS
here are the source RPMs

When you install a source package with YaST, all the necessary components are installed
in /usr/src/packages: the sources and the adjustments in SOURCES and the
relevant .spec file in SPECS.

WARNING

Do not experiment with system components (glibc, rpm, sysvinit, etc.),


because this endangers the operability of your system.

The following example uses the wget.src.rpm package. After installing the package
with YaST, you should have files similar to the following listing:

/usr/src/packages/SOURCES/nops_doc.diff
/usr/src/packages/SOURCES/toplev_destdir.diff
/usr/src/packages/SOURCES/wget-1.9.1+ipvmisc.patch
/usr/src/packages/SOURCES/wget-1.9.1-brokentime.patch
/usr/src/packages/SOURCES/wget-1.9.1-passive_ftp.diff
/usr/src/packages/SOURCES/wget-LFS-20040909.tar.bz2
/usr/src/packages/SOURCES/wget-wrong_charset.patch
/usr/src/packages/SPECS/wget.spec

rpmbuild -b X /usr/src/packages/SPECS/wget.spec starts the com-


pilation. X is a wild card for various stages of the build process (see the output of
--help or the RPM documentation for details). The following is merely a brief expla-
nation:

-bp
Prepare sources in /usr/src/packages/BUILD: unpack and patch.

-bc
Do the same as -bp, but with additional compilation.

-bi
Do the same as -bp, but with additional installation of the built software. Caution:
if the package does not support the BuildRoot feature, you might overwrite confi-
guration files.

304 Installation and Administration


-bb
Do the same as -bi, but with the additional creation of the binary package. If the
compile was successful, the binary should be in /usr/src/packages/RPMS.

-ba
Do the same as -bb, but with the additional creation of the source RPM. If the
compilation was successful, the binary should be in /usr/src/packages/
SRPMS.

--short-circuit
Skip some steps.

The binary RPM created can now be installed with rpm -i or, preferably, with rpm
-U. Installation with rpm makes it appear in the RPM database.

15.7 Compiling RPM Packages with


build
The danger with many packages is that unwanted files are added to the running system
during the build process. To prevent this, use build, which creates a defined environ-
ment in which the package is built. To establish this chroot environment, the build
script must be provided with a complete package tree. This tree can be made available
on the hard disk, via NFS, or from DVD. Set the position with build --rpms
directory. Unlike rpm, the build command looks for the SPEC file in the source
directory. To build wget (like in the above example) with the DVD mounted in the
system under /media/dvd, use the following commands as root:

cd /usr/src/packages/SOURCES/
mv ../SPECS/wget.spec .
build --rpms /media/dvd/suse/ wget.spec

Subsequently, a minimum environment is established at /var/tmp/build-root.


The package is built in this environment. Upon completion, the resulting packages are
located in /var/tmp/build-root/usr/src/packages/RPMS.

The build script offers a number of additional options. For example, cause the script
to prefer your own RPMs, omit the initialization of the build environment, or limit the

RPM—the Package Manager 305


rpm command to one of the above-mentioned stages. Access additional information
with build --help and by reading the build man page.

15.8 Tools for RPM Archives and the


RPM Database
Midnight Commander (mc) can display the contents of RPM archives and copy parts
of them. It represents archives as virtual file systems, offering all usual menu options
of Midnight Commander. Display the HEADER with F3. View the archive structure
with the cursor keys and Enter. Copy archive components with F5.

KDE offers the kpackage tool as a front-end for rpm. A full-featured package manager
is available as a YaST module (see Section 8.3.1, “Installing and Removing Software”
(page 127)).

306 Installation and Administration


System Monitoring Utilities
A number of programs and mechanisms, some of which are presented here, can be used
16
to examine the status of your system. Also described are some utilities that are useful
for routine work, along with their most important parameters.

For each of the commands introduced, examples of the relevant outputs are presented.
In these examples, the first line is the command itself (after the > or # sign prompt).
Omissions are indicated with square brackets ([...]) and long lines are wrapped
where necessary. Line breaks for long lines are indicated by a backslash (\).

# command -x -y
output line 1
output line 2
output line 3 is annoyingly long, so long that \
we have to break it
output line 3
[...]
output line 98
output line 99

The descriptions have been kept short to allow as many utilities as possible to be men-
tioned. Further information for all the commands can be found in the man pages. Most
of the commands also understand the parameter --help, which produces a brief list
of the possible parameters.

System Monitoring Utilities 307


16.1 Debugging
16.1.1 Specifying the Required Library: ldd
Use the command ldd to find out which libraries would load the dynamic executable
specified as argument.

tester@linux:~> ldd /bin/ls


linux-gate.so.1 => (0xffffe000)
librt.so.1 => /lib/librt.so.1 (0xb7f97000)
libacl.so.1 => /lib/libacl.so.1 (0xb7f91000)
libc.so.6 => /lib/libc.so.6 (0xb7e79000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7e67000)
/lib/ld-linux.so.2 (0xb7fb6000)
libattr.so.1 => /lib/libattr.so.1 (0xb7e63000)

Static binaries do not need any dynamic libraries.

tester@linux:~> ldd /bin/sash


not a dynamic executable
tester@linux:~> file /bin/sash
/bin/sash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.4, statically linked, for GNU/Linux 2.6.4, stripped

16.1.2 Library Calls of a Program Run:


ltrace
The command ltrace enables you to trace the library calls of a process. This command
is used in a similar fashion to strace. The parameter -c outputs the number and du-
ration of the library calls that have occurred:

tester@linux:~> ltrace -c find ~


% time seconds usecs/call calls function
------ ----------- ----------- --------- --------------------
34.37 6.758937 245 27554 __errno_location
33.53 6.593562 788 8358 __fprintf_chk
12.67 2.490392 144 17212 strlen
11.97 2.353302 239 9845 readdir64
2.37 0.466754 27 16716 __ctype_get_mb_cur_max

308 Installation and Administration


1.17 0.230765 27 8358 memcpy
[...]
0.00 0.000036 36 1 textdomain
------ ----------- ----------- --------- --------------------
100.00 19.662715 105717 total

16.1.3 System Calls of a Program Run:


strace
The utility strace enables you to trace all the system calls of a process currently
running. Enter the command in the normal way, adding strace at the beginning of
the line:

tester@linux:~> strace ls
execve("/bin/ls", ["ls"], [/* 61 vars */]) = 0
uname({sys="Linux", node="linux", ...}) = 0
brk(0) = 0x805c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or \
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=89696, ...}) = 0
mmap2(NULL, 89696, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ef2000
close(3) = 0
open("/lib/librt.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\36\0"..., 512) \
= 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=36659, ...}) = 0
[...]
stat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) \
= 0xb7ca7000
write(1, "bin Desktop Documents music\tM"..., 55bin Desktop Documents \
\ music Music public_html tmp
) = 55
close(1) = 0
munmap(0xb7ca7000, 4096) = 0
exit_group(0) = ?

For example, to trace all attempts to open a particular file, use the following:

tester@linux:~> strace -e open ls .bashrc


open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/librt.so.1", O_RDONLY) = 3
open("/lib/libacl.so.1", O_RDONLY) = 3

System Monitoring Utilities 309


open("/lib/libc.so.6", O_RDONLY) = 3
open("/lib/libpthread.so.0", O_RDONLY) = 3
open("/lib/libattr.so.1", O_RDONLY) = 3
[...]

To trace all the child processes, use the parameter -f. The behavior and output format
of strace can be largely controlled. For information, see man strace.

16.2 Files and File Systems


16.2.1 Determine the File Type: file
The command file determines the type of a file or a list of files by checking /etc/
magic.

tester@linux:~> file /usr/bin/file


/usr/bin/file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), \
for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped

The parameter -f list specifies a file with a list of filenames to examine. The -z
allows file to look inside compressed files:

tester@linux:~> file /usr/share/man/man1/file.1.gz


usr/share/man/man1/file.1.gz: gzip compressed data, from Unix, max compression
tester@linux:~> file -z /usr/share/man/man1/file.1.gz
/usr/share/man/man1/file.1.gz: ASCII troff or preprocessor input text \
(gzip compressed data, from Unix, max compression)

16.2.2 File Systems and Their Usage: mount,


df, and du
The command mount shows which file system (device and type) is mounted at which
mount point:

tester@linux:~> mount
/dev/hda3 on / type reiserfs (rw,acl,user_xattr)

310 Installation and Administration


proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda1 on /boot type ext2 (rw,acl,user_xattr)
/dev/hda4 on /local type reiserfs (rw,acl,user_xattr)
/dev/fd0 on /media/floppy type subfs (rw,nosuid,nodev,noatime,fs=floppyfss,p

Obtain information about total usage of the file systems with the command df. The
parameter -h (or --human-readable) transforms the output into a form understand-
able for common users.

tester@linux:~> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 11G 3.2G 6.9G 32% /
udev 252M 104K 252M 1% /dev
/dev/hda1 16M 6.6M 7.8M 46% /boot
/dev/hda4 27G 34M 27G 1% /local

Display the total size of all the files in a given directory and its subdirectories with the
command du. The parameter -s suppresses the output of detailed information. -h
again transforms the data into a human-readable form:

tester@linux:~> du -sh /local


1.7M /local

16.2.3 Additional Information about ELF


Binaries
Read the content of binaries with the readelf utility. This even works with ELF files
that were built for other hardware architectures:

tester@linux:~> readelf --file-header /bin/ls


ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)

System Monitoring Utilities 311


Machine: Intel 80386
Version: 0x1
Entry point address: 0x8049b60
Start of program headers: 52 (bytes into file)
Start of section headers: 81112 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 9
Size of section headers: 40 (bytes)
Number of section headers: 30
Section header string table index: 29

16.2.4 File Properties: stat


The command stat displays file properties:

tester@linux:~> stat /etc/profile


File: `/etc/profile'
Size: 7930 Blocks: 16 IO Block: 4096 regular file
Device: 303h/771d Inode: 40657 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2006-01-06 16:45:43.000000000 +0100
Modify: 2005-11-21 14:54:35.000000000 +0100
Change: 2005-12-19 09:51:04.000000000 +0100

The parameter --filesystem produces details of the properties of the file system
in which the specified file is located:

tester@linux:~> stat /etc/profile --filesystem


File: "/etc/profile"
ID: 0 Namelen: 255 Type: reiserfs
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 2622526 Free: 1809771 Available: 1809771
Inodes: Total: 0 Free: 0

312 Installation and Administration


16.3 Hardware Information
16.3.1 PCI Resources: lspci
The command lspci lists the PCI resources:

linux:~ # lspci
00:00.0 Host bridge: Intel Corporation 82845G/GL[Brookdale-G]/GE/PE \
DRAM Controller/Host-Hub Interface (rev 01)
00:01.0 PCI bridge: Intel Corporation 82845G/GL[Brookdale-G]/GE/PE \
Host-to-AGP Bridge (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM \
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM \
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM \
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM \
(ICH4/ICH4-M) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 81)
00:1f.0 ISA bridge: Intel Corporation 82801DB/DBL (ICH4/ICH4-L) \
LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801DB (ICH4) IDE \
Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) \
SMBus Controller (rev 01)
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM \
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
01:00.0 VGA compatible controller: Matrox Graphics, Inc. G400/G450 (rev 85)
02:08.0 Ethernet controller: Intel Corporation 82801DB PRO/100 VE (LOM) \
Ethernet Controller (rev 81)

Using -v results in a more detailed listing:

linux:~ # lspci
[...]
02:08.0 Ethernet controller: Intel Corporation 82801DB PRO/100 VE (LOM)\
Ethernet Controller (rev 81)
Subsystem: Fujitsu Siemens Computer GmbH: Unknown device 1001
Flags: bus master, medium devsel, latency 66, IRQ 11
Memory at d1000000 (32-bit, non-prefetchable) [size=4K]
I/O ports at 3000 [size=64]
Capabilities: [dc] Power Management version 2

System Monitoring Utilities 313


Information about device name resolution is obtained from the file /usr/share/
pci.ids. PCI IDs not listed in this file are marked “Unknown device.”

The parameter -vv produces all the information that could be queried by the program.
To view the pure numeric values, use the parameter -n.

16.3.2 USB Devices: lsusb


The command lsusb lists all USB devices. With the option -v, print a more detailed
list. The detailed information is read from the directory /proc/bus/usb/. The fol-
lowing is the output of lsusb with these USB devices attached: hub, memory stick,
hard disk, and mouse.

linux:/ # lsusb
Bus 004 Device 007: ID 0ea0:2168 Ours Technology, Inc. Transcend JetFlash \
2.0 / Astone USB Drive
Bus 004 Device 006: ID 04b4:6830 Cypress Semiconductor Corp. USB-2.0 IDE \
Adapter
Bus 004 Device 005: ID 05e3:0605 Genesys Logic, Inc.
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 005: ID 046d:c012 Logitech, Inc. Optical Mouse
Bus 001 Device 001: ID 0000:0000

16.3.3 Information about a SCSI Device:


scsiinfo
The command scsiinfo lists information about a SCSI device. With the option -l,
list all SCSI devices known to the system (similar information is obtained via the
command lsscsi). The following is the output of scsiinfo -i /dev/sda,
which gives information about a hard disk. The option -a gives even more information.

linux:/ # scsiinfo -i /dev/sda


Inquiry command
---------------
Relative Address 0
Wide bus 32 0
Wide bus 16 1
Synchronous neg. 1

314 Installation and Administration


Linked Commands 1
Command Queueing 1
SftRe 0
Device Type 0
Peripheral Qualifier 0
Removable? 0
Device Type Modifier 0
ISO Version 0
ECMA Version 0
ANSI Version 3
AENC 0
TrmIOP 0
Response Data Format 2
Vendor: FUJITSU
Product: MAS3367NP
Revision level: 0104A0K7P43002BE

The option -d puts out a defects list with two tables of bad blocks of a hard disk: first
the one supplied by the vendor (manufacturer table) and second the list of bad blocks
that appeared in operation (grown table). If the number of entries in the grown table
increases, it might be a good idea to replace the hard disk.

16.4 Networking
16.4.1 Show the Network Status: netstat
netstat shows network connections, routing tables (-r), interfaces (-i), masquerade
connections (-M), multicast memberships (-g), and statistics (-s).

tester@linux:~> netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.22.0 * 255.255.254.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.22.254 0.0.0.0 UG 0 0 0 eth0

tester@linux:~> netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 1624507 129056 0 0 7055 0 0 0 BMNRU

System Monitoring Utilities 315


lo 16436 0 23728 0 0 0 23728 0 0 0 LRU

When displaying network connections or statistics, you can specify the socket type to
display: TCP (-t), UDP (-u), or raw (-r). The -p option shows the PID and name
of the program to which each socket belongs.

The following example lists all TCP connections and the programs using these connec-
tions.

linux:~ # netstat -t -p
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Pro

tcp 0 0 linux:33513 www.novell.com:www-http ESTABLISHED 6862/fi


tcp 0 352 linux:ssh linux2.:trc-netpoll ESTABLISHED 19422/s
tcp 0 0 localhost:ssh localhost:17828 ESTABLISHED -

In the following, statistics for the TCP protocol are displayed:

tester@linux:~> netstat -s -t
Tcp:
2427 active connections openings
2374 passive connection openings
0 failed connection attempts
0 connection resets received
1 connections established
27476 segments received
26786 segments send out
54 segments retransmited
0 bad segments received.
6 resets sent
[...]
TCPAbortOnLinger: 0
TCPAbortFailed: 0
TCPMemoryPressures: 0

16.5 The /proc File System


The /proc file system is a pseudo file system in which the kernel reserves important
information in the form of virtual files. For example, display the CPU type with this
command:

316 Installation and Administration


tester@linux:~> cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon(tm) XP 2400+
stepping : 1
cpu MHz : 2009.343
cache size : 256 KB
fdiv_bug : no
[...]

Query the allocation and use of interrupts with the following command:

tester@linux:~> cat /proc/interrupts


CPU0
0: 3577519 XT-PIC timer
1: 130 XT-PIC i8042
2: 0 XT-PIC cascade
5: 564535 XT-PIC Intel 82801DB-ICH4
7: 1 XT-PIC parport0
8: 2 XT-PIC rtc
9: 1 XT-PIC acpi, uhci_hcd:usb1, ehci_hcd:usb4
10: 0 XT-PIC uhci_hcd:usb3
11: 71772 XT-PIC uhci_hcd:usb2, eth0
12: 101150 XT-PIC i8042
14: 33146 XT-PIC ide0
15: 149202 XT-PIC ide1
NMI: 0
LOC: 0
ERR: 0
MIS: 0

Some of the important files and their contents are:

/proc/devices
Available devices

/proc/modules
Kernel modules loaded

/proc/cmdline
Kernel command line

/proc/meminfo
Detailed information about memory usage

System Monitoring Utilities 317


/proc/config.gz
gzip-compressed configuration file of the kernel currently running

Further information is available in the text file /usr/src/linux/


Documentation/filesystems/proc.txt. Find information about processes
currently running in the /proc/NNN directories, where NNN is the process ID (PID)
of the relevant process. Every process can find its own characteristics in /proc/self/
:

tester@linux:~> ls -l /proc/self
lrwxrwxrwx 1 root root 64 2006-01-09 13:03 /proc/self -> 5356
tester@linux:~> ls -l /proc/self/
total 0
dr-xr-xr-x 2 tester users 0 2006-01-09 17:04 attr
-r-------- 1 tester users 0 2006-01-09 17:04 auxv
-r--r--r-- 1 tester users 0 2006-01-09 17:04 cmdline
lrwxrwxrwx 1 tester users 0 2006-01-09 17:04 cwd -> /home/tester
-r-------- 1 tester users 0 2006-01-09 17:04 environ
lrwxrwxrwx 1 tester users 0 2006-01-09 17:04 exe -> /bin/ls
dr-x------ 2 tester users 0 2006-01-09 17:04 fd
-rw-r--r-- 1 tester users 0 2006-01-09 17:04 loginuid
-r--r--r-- 1 tester users 0 2006-01-09 17:04 maps
-rw------- 1 tester users 0 2006-01-09 17:04 mem
-r--r--r-- 1 tester users 0 2006-01-09 17:04 mounts
-rw-r--r-- 1 tester users 0 2006-01-09 17:04 oom_adj
-r--r--r-- 1 tester users 0 2006-01-09 17:04 oom_score
lrwxrwxrwx 1 tester users 0 2006-01-09 17:04 root -> /
-rw------- 1 tester users 0 2006-01-09 17:04 seccomp
-r--r--r-- 1 tester users 0 2006-01-09 17:04 smaps
-r--r--r-- 1 tester users 0 2006-01-09 17:04 stat
[...]
dr-xr-xr-x 3 tester users 0 2006-01-09 17:04 task
-r--r--r-- 1 tester users 0 2006-01-09 17:04 wchan

The address assignment of executables and libraries is contained in the maps file:

tester@linux:~> cat /proc/self/maps


08048000-0804c000 r-xp 00000000 03:03 17753 /bin/cat
0804c000-0804d000 rw-p 00004000 03:03 17753 /bin/cat
0804d000-0806e000 rw-p 0804d000 00:00 0 [heap]
b7d27000-b7d5a000 r--p 00000000 03:03 11867 /usr/lib/locale/en_GB.utf8/
b7d5a000-b7e32000 r--p 00000000 03:03 11868 /usr/lib/locale/en_GB.utf8/
b7e32000-b7e33000 rw-p b7e32000 00:00 0
b7e33000-b7f45000 r-xp 00000000 03:03 8837 /lib/libc-2.3.6.so
b7f45000-b7f46000 r--p 00112000 03:03 8837 /lib/libc-2.3.6.so
b7f46000-b7f48000 rw-p 00113000 03:03 8837 /lib/libc-2.3.6.so
b7f48000-b7f4c000 rw-p b7f48000 00:00 0

318 Installation and Administration


b7f52000-b7f53000 r--p 00000000 03:03 11842 /usr/lib/locale/en_GB.utf8/
[...]
b7f5b000-b7f61000 r--s 00000000 03:03 9109 /usr/lib/gconv/gconv-module
b7f61000-b7f62000 r--p 00000000 03:03 9720 /usr/lib/locale/en_GB.utf8/
b7f62000-b7f76000 r-xp 00000000 03:03 8828 /lib/ld-2.3.6.so
b7f76000-b7f78000 rw-p 00013000 03:03 8828 /lib/ld-2.3.6.so
bfd61000-bfd76000 rw-p bfd61000 00:00 0 [stack]
ffffe000-fffff000 ---p 00000000 00:00 0 [vdso]

16.5.1 procinfo
Important information from the /proc file system is summarized by the command
procinfo:

tester@linux:~> procinfo
Linux 2.6.15-rc5-git3-2-default (geeko@buildhost) (gcc 4.1.0 20051129) #1 Wed

Memory: Total Used Free Shared Buffers


Mem: 515584 509472 6112 0 73024
Swap: 658656 0 658656

Bootup: Mon Jan 9 12:59:08 2006 Load average: 0.10 0.04 0.05 1/86 5406

user : 0:02:07.98 0.8% page in : 442638 disk 1: 20125r 134


nice : 0:02:20.91 0.9% page out: 134950
system: 0:00:42.93 0.3% page act: 70577
IOwait: 0:01:25.40 0.6% page dea: 11696
hw irq: 0:00:08.94 0.1% page flt: 1423622
sw irq: 0:00:01.29 0.0% swap in : 0
idle : 4:06:30.54 97.3% swap out: 0
uptime: 4:13:20.72 context : 3813145

irq 0: 3799268 timer irq 8: 2 rtc


irq 1: 130 i8042 irq 9: 1 acpi, uhci_hcd:usb
irq 2: 0 cascade [4] irq 10: 0 uhci_hcd:usb3
irq 3: 8 irq 11: 75905 uhci_hcd:usb2, eth
irq 4: 8 irq 12: 101150 i8042
irq 5: 564535 Intel 82801DB-ICH4 irq 14: 33733 ide0
irq 6: 9 irq 15: 157045 ide1
irq 7: 1 parport0 [3]

To see all the information, use the parameter -a. The parameter -nN produces updates
of the information every N seconds. In this case, terminate the program by pressing Q.

System Monitoring Utilities 319


By default, the cumulative values are displayed. The parameter -d produces the differ-
ential values. procinfo -dn5 displays the values that have changed in the last five
seconds:

16.6 Processes
16.6.1 Interprocess Communication: ipcs
The command ipcs produces a list of the IPC resources currently in use:

------ Shared Memory Segments --------


key shmid owner perms bytes nattch status
0x00000000 58261504 tester 600 393216 2 dest
0x00000000 58294273 tester 600 196608 2 dest
0x00000000 83886083 tester 666 43264 2
0x00000000 83951622 tester 666 192000 2
0x00000000 83984391 tester 666 282464 2
0x00000000 84738056 root 644 151552 2 dest

------ Semaphore Arrays --------


key semid owner perms nsems
0x4d038abf 0 tester 600 8

------ Message Queues --------


key msqid owner perms used-bytes messages

16.6.2 Process List: ps


The command ps produces a list of processes. Most parameters must be written without
a minus sign. Refer to ps --help for a brief help or to the man page for extensive
help.

To list all processes with user and command line information, use ps axu:

tester@linux:~> ps axu
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 696 272 ? S 12:59 0:01 init [5]
root 2 0.0 0.0 0 0 ? SN 12:59 0:00 [ksoftirqd
root 3 0.0 0.0 0 0 ? S< 12:59 0:00 [events
[...]

320 Installation and Administration


tester 4047 0.0 6.0 158548 31400 ? Ssl 13:02 0:06 mono-best
tester 4057 0.0 0.7 9036 3684 ? Sl 13:02 0:00 /opt/gnome
tester 4067 0.0 0.1 2204 636 ? S 13:02 0:00 /opt/gnome
tester 4072 0.0 1.0 15996 5160 ? Ss 13:02 0:00 gnome-scre
tester 4114 0.0 3.7 130988 19172 ? SLl 13:06 0:04 sound-juic
tester 4818 0.0 0.3 4192 1812 pts/0 Ss 15:59 0:00 -bash
tester 4959 0.0 0.1 2324 816 pts/0 R+ 16:17 0:00 ps axu

To check how many sshd processes are running, use the option -p together with the
command pidof, which lists the process IDs of the given processes.

tester@linux:~> ps -p `pidof sshd`


PID TTY STAT TIME COMMAND
3524 ? Ss 0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
4813 ? Ss 0:00 sshd: tester [priv]
4817 ? R 0:00 sshd: tester@pts/0

The process list can be formatted according to your needs. The option -L returns a list
of all keywords. Enter the following command to issue a list of all processes sorted by
memory usage:

tester@linux:~> ps ax --format pid,rss,cmd --sort rss


PID RSS CMD
2 0 [ksoftirqd/0]
3 0 [events/0]
4 0 [khelper]
5 0 [kthread]
11 0 [kblockd/0]
12 0 [kacpid]
472 0 [pdflush]
473 0 [pdflush]
[...]
4028 17556 nautilus --no-default-window --sm-client-id default2
4118 17800 ksnapshot
4114 19172 sound-juicer
4023 25144 gnome-panel --sm-client-id default1
4047 31400 mono-best --debug /usr/lib/beagle/Best.exe --autostarted
3973 31520 mono-beagled --debug /usr/lib/beagle/BeagleDaemon.exe --bg --aut

16.6.3 Process Tree: pstree


The command pstree produces a list of processes in the form of a tree:

System Monitoring Utilities 321


tester@linux:~> pstree
init-+-NetworkManagerD
|-acpid
|-3*[automount]
|-cron
|-cupsd
|-2*[dbus-daemon]
|-dbus-launch
|-dcopserver
|-dhcpcd
|-events/0
|-gpg-agent
|-hald-+-hald-addon-acpi
| `-hald-addon-stor
|-kded
|-kdeinit-+-kdesu---su---kdesu_stub---yast2---y2controlcenter
| |-kio_file
| |-klauncher
| |-konqueror
| |-konsole-+-bash---su---bash
| | `-bash
| `-kwin
|-kdesktop---kdesktop_lock---xmatrix
|-kdesud
|-kdm-+-X
| `-kdm---startkde---kwrapper
[...]

The parameter -p adds the process ID to a given name. To have the command lines
displayed as well, use the -a parameter:

16.6.4 Processes: top


The command top, which stands for "table of processes," displays a list of processes
that is refreshed every two seconds. To terminate the program, press Q. The parameter
-n 1 terminates the program after a single display of the process list. The following
is an example output of the command top -n 1:

322 Installation and Administration


tester@linux:~> top -n 1
top - 17:06:28 up 2:10, 5 users, load average: 0.00, 0.00, 0.00
Tasks: 85 total, 1 running, 83 sleeping, 1 stopped, 0 zombie
Cpu(s): 5.5% us, 0.8% sy, 0.8% ni, 91.9% id, 1.0% wa, 0.0% hi, 0.0% si
Mem: 515584k total, 506468k used, 9116k free, 66324k buffers
Swap: 658656k total, 0k used, 658656k free, 353328k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND


1 root 16 0 700 272 236 S 0.0 0.1 0:01.33 init
2 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
3 root 10 -5 0 0 0 S 0.0 0.0 0:00.27 events/0
4 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 khelper
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.05 kblockd/0
12 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
472 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
473 root 15 0 0 0 0 S 0.0 0.0 0:00.06 pdflush
475 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
474 root 15 0 0 0 0 S 0.0 0.0 0:00.07 kswapd0
681 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kseriod
839 root 10 -5 0 0 0 S 0.0 0.0 0:00.02 reiserfs/0
923 root 13 -4 1712 552 344 S 0.0 0.1 0:00.67 udevd
1343 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
1587 root 20 0 0 0 0 S 0.0 0.0 0:00.00 shpchpd_event
1746 root 15 0 0 0 0 S 0.0 0.0 0:00.00 w1_control
1752 root 15 0 0 0 0 S 0.0 0.0 0:00.00 w1_bus_master1
2151 root 16 0 1464 496 416 S 0.0 0.1 0:00.00 acpid
2165 messageb 16 0 3340 1048 792 S 0.0 0.2 0:00.64 dbus-daemon
2166 root 15 0 1840 752 556 S 0.0 0.1 0:00.01 syslog-ng
2171 root 16 0 1600 516 320 S 0.0 0.1 0:00.00 klogd
2235 root 15 0 1736 800 652 S 0.0 0.2 0:00.10 resmgrd
2289 root 16 0 4192 2852 1444 S 0.0 0.6 0:02.05 hald
2403 root 23 0 1756 600 524 S 0.0 0.1 0:00.00 hald-addon-acpi
2709 root 19 0 2668 1076 944 S 0.0 0.2 0:00.00 NetworkManagerD
2714 root 16 0 1756 648 564 S 0.0 0.1 0:00.56 hald-addon-stor

If you press F while top is running, a menu opens with which to make extensive changes
to the format of the output.

The parameter -U UID monitors only the processes associated with a particular user.
Replace UID with the user ID of the user. top -U `id -u` returns the UID of the
user on the basis of the username and displays his processes.

System Monitoring Utilities 323


16.7 System Information
16.7.1 System Activity Information: sar
To use sar, sadc (system activity data collector) needs to be running. Check its status
or start it with rcsysstat {start|status}.

sar can generate extensive reports on almost all important system activities, among
them CPU, memory, IRQ usage, IO, or networking. With its many options, it is too
complex to explain further here. Refer to the man page for extensive documentation
with examples.

16.7.2 Memory Usage: free


The utility free examines RAM usage. Details of both free and used memory and
swap areas are shown:

tester@linux:~> free
total used free shared buffers cached
Mem: 515584 501704 13880 0 73040 334592
-/+ buffers/cache: 94072 421512
Swap: 658656 0 658656

The options -b,-k,-m,-g show output in bytes, KB, MB, or GB, respectively. The
parameter -d delay ensures that the display is refreshed every delay seconds. For
example, free -d 1.5 produces an update every 1.5 seconds.

16.7.3 User Accessing Files: fuser


It can be useful to determine what processes or users are currently accessing certain
files. Suppose, for example, you want to unmount a file system mounted at /mnt.
umount returns "device is busy." The command fuser can then be used to determine
what processes are accessing the device:

tester@linux:~> fuser -v /mnt/*

324 Installation and Administration


USER PID ACCESS COMMAND
/mnt/notes.txt tester 26597 f.... less

Following termination of the less process, which was running on another terminal,
the file system can successfully be unmounted.

16.7.4 Kernel Ring Buffer: dmesg


The Linux kernel keeps certain messages in a ring buffer. To view these messages,
enter the command dmesg:

$ dmesg
[...]
end_request: I/O error, dev fd0, sector 0
subfs: unsuccessful attempt to mount media (256)
e100: eth0: e100_watchdog: link up, 100Mbps, half-duplex
NET: Registered protocol family 17
IA-32 Microcode Update Driver: v1.14 <[email protected]>
microcode: CPU0 updated from revision 0xe to 0x2e, date = 08112004
IA-32 Microcode Update Driver v1.14 unregistered
bootsplash: status on console 0 changed to on
NET: Registered protocol family 10
Disabled Privacy Extensions on device c0326ea0(lo)
IPv6 over IPv4 tunneling driver
powernow: This module only works with AMD K7 CPUs
bootsplash: status on console 0 changed to on

Older events are logged in the files /var/log/messages and /var/log/warn.

16.7.5 List of Open Files: lsof


To view a list of all the files open for the process with process ID PID, use -p. For
example, to view all the files used by the current shell, enter:

tester@linux:~> lsof -p $$
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
bash 5552 tester cwd DIR 3,3 1512 117619 /home/tester
bash 5552 tester rtd DIR 3,3 584 2 /
bash 5552 tester txt REG 3,3 498816 13047 /bin/bash
bash 5552 tester mem REG 0,0 0 [heap] (stat: No such
bash 5552 tester mem REG 3,3 217016 115687 /var/run/nscd/passwd
bash 5552 tester mem REG 3,3 208464 11867 /usr/lib/locale/en_GB.

System Monitoring Utilities 325


bash 5552 tester mem REG 3,3 882134 11868 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 1386997 8837 /lib/libc-2.3.6.so
bash 5552 tester mem REG 3,3 13836 8843 /lib/libdl-2.3.6.so
bash 5552 tester mem REG 3,3 290856 12204 /lib/libncurses.so.5.5
bash 5552 tester mem REG 3,3 26936 13004 /lib/libhistory.so.5.1
bash 5552 tester mem REG 3,3 190200 13006 /lib/libreadline.so.5.
bash 5552 tester mem REG 3,3 54 11842 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 2375 11663 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 290 11736 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 52 11831 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 34 11862 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 62 11839 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 127 11664 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 56 11735 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 23 11866 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 21544 9109 /usr/lib/gconv/gconv-m
bash 5552 tester mem REG 3,3 366 9720 /usr/lib/locale/en_GB.
bash 5552 tester mem REG 3,3 97165 8828 /lib/ld-2.3.6.so
bash 5552 tester 0u CHR 136,5 7 /dev/pts/5
bash 5552 tester 1u CHR 136,5 7 /dev/pts/5
bash 5552 tester 2u CHR 136,5 7 /dev/pts/5
bash 5552 tester 255u CHR 136,5 7 /dev/pts/5

The special shell variable $$, whose value is the process ID of the shell, has been used.

The command lsof lists all the files currently open when used without any parameters.
Because there are often thousands of open files, listing all of them is rarely useful.
However, the list of all files can be combined with search functions to generate useful
lists. For example, list all used character devices:

tester@linux:~> lsof | grep CHR


bash 3838 tester 0u CHR 136,0 2 /dev/pts/0
bash 3838 tester 1u CHR 136,0 2 /dev/pts/0
bash 3838 tester 2u CHR 136,0 2 /dev/pts/0
bash 3838 tester 255u CHR 136,0 2 /dev/pts/0
bash 5552 tester 0u CHR 136,5 7 /dev/pts/5
bash 5552 tester 1u CHR 136,5 7 /dev/pts/5
bash 5552 tester 2u CHR 136,5 7 /dev/pts/5
bash 5552 tester 255u CHR 136,5 7 /dev/pts/5
X 5646 root mem CHR 1,1 1006 /dev/mem
lsof 5673 tester 0u CHR 136,5 7 /dev/pts/5
lsof 5673 tester 2u CHR 136,5 7 /dev/pts/5
grep 5674 tester 1u CHR 136,5 7 /dev/pts/5
grep 5674 tester 2u CHR 136,5 7 /dev/pts/5

326 Installation and Administration


16.7.6 Kernel and udev Event Sequence
Viewer: udevmonitor
udevmonitor listens to the kernel uevents and events sent out by a udev rule and
prints the device path (DEVPATH) of the event to the console. This is a sequence of
events while connecting a USB memory stick:
UEVENT[1138806687] add@/devices/pci0000:00/0000:00:1d.7/usb4/4-2/4-2.2
UEVENT[1138806687] add@/devices/pci0000:00/0000:00:1d.7/usb4/4-2/4-2.2/4-2.2
UEVENT[1138806687] add@/class/scsi_host/host4
UEVENT[1138806687] add@/class/usb_device/usbdev4.10
UDEV [1138806687] add@/devices/pci0000:00/0000:00:1d.7/usb4/4-2/4-2.2
UDEV [1138806687] add@/devices/pci0000:00/0000:00:1d.7/usb4/4-2/4-2.2/4-2.2
UDEV [1138806687] add@/class/scsi_host/host4
UDEV [1138806687] add@/class/usb_device/usbdev4.10
UEVENT[1138806692] add@/devices/pci0000:00/0000:00:1d.7/usb4/4-2/4-2.2/4-2.2
UEVENT[1138806692] add@/block/sdb
UEVENT[1138806692] add@/class/scsi_generic/sg1
UEVENT[1138806692] add@/class/scsi_device/4:0:0:0
UDEV [1138806693] add@/devices/pci0000:00/0000:00:1d.7/usb4/4-2/4-2.2/4-2.2
UDEV [1138806693] add@/class/scsi_generic/sg1
UDEV [1138806693] add@/class/scsi_device/4:0:0:0
UDEV [1138806693] add@/block/sdb
UEVENT[1138806694] add@/block/sdb/sdb1
UDEV [1138806694] add@/block/sdb/sdb1
UEVENT[1138806694] mount@/block/sdb/sdb1
UEVENT[1138806697] umount@/block/sdb/sdb1

16.7.7 Server Resources Used by X11 Clients:


xrestop
xrestop provides statistics for each connected X11 client's server-side resource. The
output is very similar to Section 16.6.4, “Processes: top” (page 322).

xrestop - Display: localhost:0


Monitoring 40 clients. XErrors: 0
Pixmaps: 42013K total, Other: 206K total, All: 42219K total

res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
3e00000 385 36 1 751 107 18161K 13K 18175K ? NOVELL: SU
4600000 391 122 1 1182 889 4566K 33K 4600K ? amaroK - S
1600000 35 11 0 76 142 3811K 4K 3816K ? KDE Deskto
3400000 52 31 1 69 74 2816K 4K 2820K ? Linux Shel

System Monitoring Utilities 327


2c00000 50 25 1 43 50 2374K 3K 2378K ? Linux Shel
2e00000 50 10 1 36 42 2341K 3K 2344K ? Linux Shel
2600000 37 24 1 34 50 1772K 3K 1775K ? Root - Kon
4800000 37 24 1 34 49 1772K 3K 1775K ? Root - Kon
2a00000 209 33 1 323 238 1111K 12K 1123K ? Trekstor25
1800000 182 32 1 302 285 1039K 12K 1052K ? kicker
1400000 157 121 1 231 477 777K 18K 796K ? kwin
3c00000 175 36 1 248 168 510K 9K 520K ? de.comp.la
3a00000 326 42 1 579 444 486K 20K 506K ? [opensuse-
0a00000 85 38 1 317 224 102K 9K 111K ? Kopete
4e00000 25 17 1 60 66 63K 3K 66K ? YaST Contr
2400000 11 10 0 56 51 53K 1K 55K 22061 suseplugge
0e00000 20 12 1 50 92 50K 3K 54K 22016 kded
3200000 6 41 5 72 84 40K 8K 48K ? EMACS
2200000 54 9 1 30 31 42K 3K 45K ? SUSEWatche
4400000 2 11 1 30 34 34K 2K 36K 16489 kdesu
1a00000 255 7 0 42 11 19K 6K 26K ? KMix
3800000 2 14 1 34 37 21K 2K 24K 22242 knotify
1e00000 10 7 0 42 9 15K 624B 15K ? KPowersave
3600000 106 6 1 30 9 7K 3K 11K 22236 konqueror
2000000 10 5 0 21 34 9K 1K 10K ? klipper
3000000 21 7 0 11 9 7K 888B 8K ? KDE Wallet

16.8 User Information


16.8.1 Who Is Doing What: w
With the command w, find out who is logged onto the system and what each user is
doing. For example:

tester@linux:~> w
16:33:03 up 3:33, 2 users, load average: 0.14, 0.06, 0.02
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
tester :0 16:33 ?xdm? 9.42s 0.15s /bin/sh /opt/kde3/bin/startk
tester pts/0 15:59 0.00s 0.19s 0.00s w

If any users of other systems have logged in remotely, the parameter -f shows the
computers from which they have established the connection.

328 Installation and Administration


16.9 Time and Date
16.9.1 Time Measurement with time
Determine the time spent by commands with the time utility. This utility is available
in two versions: as a shell built-in and as a program (/usr/bin/time).

tester@linux:~> time find . > /dev/null

real 0m4.051s
user 0m0.042s
sys 0m0.205s

System Monitoring Utilities 329


Working with the Shell
When booting your Linux system, you are usually directed to a graphical user interface
17
that guides you through the login process and the following interactions with the system.
Although graphical user interfaces have become very important and user-friendly, using
them is not the only way to communicate with your system. You can also use a text-
oriented communication like a command line interpreter, usually called the shell, where
you can enter commands. Because Linux provides options to start shell windows from
the graphical user interface, you can easily use both methods.

In administration, shell-based applications are especially important for controlling


computers over slow network links or if you want to perform tasks as root on the
command line. For Linux “newbies” it might be rather unusual to enter commands in
a shell, but you will soon realize that the shell is not only for administrators—in fact,
using the shell is often the quickest and easiest way to perform some daily tasks.

There are several shells for UNIX or Linux. The default shell in SUSE® Linux Enterprise
is Bash (GNU Bourne-Again Shell).

This chapter deals with a couple of basics you need to know for using the shell. This
includes the following topics: how to enter commands, the directory structure of Linux,
how to work with files and directories and how to use some basic functions, the user
and permission concept of Linux, an overview of important shell commands, and a
short introduction to the vi editor, which is a default editor always available in Unix
and Linux systems.

Working with the Shell 331


17.1 Getting Started with the Bash
Shell
In Linux, you can use the command line parallel to the graphical user interface and
easily switch between them. To start a terminal window from the graphical user interface
in KDE, click the Konsole icon in the panel. In GNOME, click the GNOME Terminal
icon in the panel.

The Konsole or the GNOME Terminal window appears, showing the prompt on the
first line like in Figure 17.1, “Example of a Bash Terminal Window” (page 332). The
prompt usually shows your login name (in this example, tux), the hostname of your
computer (here, knox), and the current path (in this case, your home directory, indicated
by the tilde symbol, ~). When you are logged in on a remote computer this information
always shows you which system you are currently working on. When the cursor is after
this prompt, you can send commands directly to your computer system.

Figure 17.1 Example of a Bash Terminal Window

17.1.1 Entering Commands


A command consists of several elements. The first element is always the actual com-
mand, followed by parameters or options. You can type a command and edit it by using
←, →, <—, Del, and Space. You can also add options or correct typing errors. The
command is executed when you press Enter.

332 Installation and Administration


IMPORTANT: No News Is Good News

The shell is not verbose: in contrast to some graphical user interfaces, it usually
does not provide confirmation messages when commands have been executed.
Messages only appear in case of problems or errors.

Also keep this in mind for commands to delete objects. Before entering a
command like rm for removing a file, you should know if you really want to
get rid of the object: it will be deleted irretrievably, without enquiry.

Using Commands without Options


Look at the structure of commands using a simple example: the ls command, used to
list the contents of a directory. The command can be used with or without options. En-
tering the plain ls command shows the contents of the current directory:

Figure 17.2 The ls Command

Unlike in other operating systems, files in Linux may have a file extension, such as
.txt, but do not need to have one. This makes it difficult to differentiate between files
and folders in this output of the ls. By default, the colors can give you a hint: directories
are usually shown in blue, files in black.

Using Commands with Options


A better way to get more details about the contents of a directory is using the ls com-
mand with a string of options. Options modify the way a command works so that you
can get it to do specific tasks. Options are separated from the command with a blank

Working with the Shell 333


and are prefixed with a hyphen. The ls -l command shows the contents of the same
directory in full detail (long listing format):

Figure 17.3 The ls -l Command

On the left of each object name, information about the object is shown in several
columns. The most important are the following: The first column shows the file type
of the object (in this example, d for directory or - for normal files). The next nine
columns show the user permissions for the object. Columns 11 and 12 show the name
of the file owner and the group (in this case, tux and users). Find information about
user permissions and the user concept of Linux in Section 17.2, “Users and Access
Permissions” (page 343). The next column shows the file size in bytes. Then date and
time of the last change are displayed. The last column shows the object name.

If you want to see even more, you can combine two options for the ls command and
enter ls -la. The shell now also shows hidden files in the directory, indicated by a
dot in front (for example, .hiddenfile).

Getting Help
Nobody is expected to know all options of all commands by heart. If you remember
the command name but are not sure about the options, you can enter the command
followed by a blank and --help. This --help option exists for many commands.
Entering ls --help displays all the options for the ls command.

334 Installation and Administration


17.1.2 Linux Directory Structure
Because the shell does not offer a graphical overview of directories and files like the
tree view in a file manager, it is useful to have some basic knowlegde of the default
directory structure in a Linux system. You can think of directories as electronic folders
in which files, programs, and subdirectories are stored. The top level directory in the
hierarchy is the root directory, referred to as /. This is the place from which all other
directories can be accessed.

Figure 17.4 shows the standard directory tree in Linux, with the home directories of
the example users yxz, linux, and tux. The /home directory contains the directories
in which the individual users can store their personal files.

NOTE: Home Directory in a Network Environment

If you are working in a network environment, your home directory may not be
called /home. It can be mapped to any directory in the file system.

The following list provides a brief description of the standard directories in Linux.

Figure 17.4 Excerpt from a Standard Directory Tree


/

bin boot dev etc home lib media mnt opt proc root sbin srv sys tmp usr var

vmlinuz kde gnome

ld.so
hda sda st0

yxz linux tux X11R6 bin etc lib local sbin share

bin Mail test.c f2c

bin lib man bin lib ftp man doc man

xdm xterm xv bin lib pub faq howto packages

Working with the Shell 335


Table 17.1 Overview of a Standard Directory Tree

/ Root directory, starting point of the directory tree

/home Personal directories of users

/dev Device files that represent hardware components

/etc Important files for system configuration

/etc/init.d Boot scripts

/bin, /sbin Programs needed early in the boot process (/bin) and
for the administrator (/sbin)

/usr, /usr/local All application programs and local, distribution-indepen-


dent extensions (/usr/local)

/usr/bin, /usr/ Generally accessible programs (/usr/bin) and reserved


sbin for the system administrator ( /usr/sbin)

/usr/share/doc Various documentation files

/tmp, /var/tmp Temporary files (do not save files in this directory unless
you do not need them)

/opt Optional software, larger add-on program packages (such


as KDE, GNOME, and Netscape)

/proc Process file system

/sys System file system where all device information for the
kernel is gathered

/var/log System log files

336 Installation and Administration


17.1.3 Working with Directories and Files
To address a certain file or directory, you must specify the path leading to that directory
or file. There are two ways to specify a path:

• The entire (absolute) path from the root directory to the respective file

• A path starting from the current directory (relative path)

Absolute paths always start with a slash. Relative paths do not have a slash at the begin-
ning.

NOTE: Linux Is Case-Sensitive

Linux distinguishes between uppercase and lowercase in the file system. For
example, entering test.txt or Test.txt makes a difference in Linux. Keep
this in mind when entering filenames or paths.

To change directories, use the cd command.

• To switch to your home directory, enter cd.

• Refer to the current directory with a dot (.). This is mainly useful for other com-
mands (cp, mv, …).

• The next higher level in the tree is represented by two dots (..). For example, to
switch to the parent directory of your current directory, enter cd ...

Examples of Addressing a File


The cd commands in Section 17.1.3, “Working with Directories and Files” (page 337)
used relative paths. You can use also absolute paths. For example, suppose you want
to copy a file from your home directory to a subdirectory of /tmp:

1 First, from your home directory create a subdirectory in /tmp:

1a If your current directory is not your home directory, enter cd ~ to switch


to it. From anywhere in the file system, you can reach your home directory
by entering cd ~.

Working with the Shell 337


1b In your home directory, enter mkdir /tmp/test. mkdir stands for
“make directory”. This command creates a new directory named test in
the /tmp directory. In this case, use an absolute path to create the directory.

1c To check what happened, now enter ls -l /tmp. The new directory test
should appear in the list of contents of the /tmp directory.

2 Now create a new file in your home directory and copy it to the /tmp/test
directory by using a relative path.

2a Enter touch myfile.txt. The touch command with the myfile.txt


option creates a new, empty file named myfile.txt in your current direc-
tory.

2b Check this by entering ls -l. The new file should appear in the list of
contents.

2c Enter cp myfile.txt ../tmp/test. This copies myfile.txt to


the directory /tmp/test without changing the name of the file.

2d Check this by entering ls -l /tmp/test. The file myfile.txt should


appear in the list of contents for /tmp/test.

To list the contents of home directories of other users, enter ls ~username . In the
example directory tree in Figure 17.4, “Excerpt from a Standard Directory Tree”
(page 335), one of the sample users is tux. In this case, ls ~tux would list the contents
of the home directory of tux.

NOTE: Handling Blanks in Filenames or Directory Names

If a filename contains a space, either escape the space using a back slash (\)
in front of the blank or enclose the filename in single or double quotes. Other-
wise Bash interprets a filename like My Documents as the names of two files
or directories. The difference between single and double quotes is that variable
expansion takes place within double quotes. Single quotes ensure that the shell
sees the quoted string literally.

338 Installation and Administration


17.1.4 Useful Features of the Shell
Entering commands in Bash can include a lot of typing. In the following, get to know
some features of the Bash that can make your work a lot easier and save a lot of typing.

History and Completion


By default, Bash “remembers” commands you have entered. This feature is called his-
tory. To repeat a command that has been entered before, press ↑ until the desired com-
mand appears at the prompt. Press ↓ to move forward through the list of previously
entered commands. Use Ctrl + R to search in the history.

You can edit the selected command, for example, changing the name of a file, before
you execute the command by pressing Enter. To edit the command line, just move the
cursor to the desired position using the arrow keys and start typing.

Completing a filename or directory name to its full length after typing its first letters
is another helpful feature of Bash. To do so, type the first letters then press →|. If the
filename or path can be uniquely identified, it is completed at once and the cursor moves
to the end of the filename. You can then enter the next option of the command, if nec-
essary. If the filename or path cannot be uniquely identified (because there are several
filenames starting with the same letters), the filename or path is only completed up to
the point where again several options are possible. You can then obtain a list of them
by pressing →| a second time. After this, you can enter the next letters of the file or
path then try completion again by pressing →|. When completing filenames and paths
with the help of →|, you can simultaneously check whether the file or path you want
to enter really exists (and you can be sure of getting the spelling right).

Wild Cards
Another convenience offered by the shell is wild cards for pathname expansion. Wild
cards are characters that can stand for other characters. There are three different types
of these in Bash:

?
Matches exactly one arbitrary character

*
Matches any number of characters

Working with the Shell 339


[set]
Matches one of the characters from the group specified inside the square brackets,
which is represented here by the string set. As part of set you can also specify
character classes using the syntax [:class:], where a class is one of alnum,
alpha, ascii, etc.

Using ! or ^ at the beginning of the group ([!set]) matches one character other
than those identified by set.

Assuming that your test directory contains the files Testfile, Testfile1,
Testfile2, and datafile.

• The command ls Testfile? lists the files Testfile1 and Testfile2.

• The command ls Testfile? lists the files Testfile1 and Testfile2.

• With ls Test*, the list also includes Testfile.

• The command ls *fil* shows all the sample files.

• Use the set wild card to address all sample files whose last character is a number:
ls Testfile[1-9] or, using classes, ls Testfile[[:digit:]].

Of the four types of wild cards, the most inclusive one is the asterisk. It could be used
to copy all files contained in one directory to another one or to delete all files with one
command. The command rm *fil*, for instance, would delete all files in the current
directory whose name includes the string fil.

Viewing Files with Less and More


Linux includes two small programs for viewing text files directly in the shell: less
and more. Rather than starting an editor to read a file like Readme.txt, simply enter
less Readme.txt to display the text in the console window. Use Space to scroll
down one page. Use Page Up and Page Down to move forward or backward in the text.
To exit less, press Q.

Instead of less, you can also use the older program more. However, it is less convenient
because it does not allow you to scroll backwards.

340 Installation and Administration


The program less got its name from the the precept that less is more and can also be
used to view the output of commands in a convenient way. To see how this works, read
Section “Redirection and Pipes” (page 341).

Redirection and Pipes


Normally, the standard output in the shell is your screen or the console window and
the standard input is the keyboard. However, the shell provides functions by which you
can redirect the input or the output to another object, such as a file or another command.
With the help of the symbols > and <, for example, you can forward the output of a
command to a file (output redirection) or use a file as input for a command (input
redirection). For example, if you want to write the output of a command such as ls to
a file, enter ls -l > file.txt. This creates a file named file.txt that contains
the list of contents of your current directory as generated by the ls command. However,
if a file named file.txt already exists, this command overwrites the existing file.
To prevent this, use >>. Entering ls -l >> file.txt simply appends the output
of the ls command to an already existing file named file.txt. If the file does not
exist, it is created.

Sometimes it is also useful to use a file as the input for a command. For example, with
the tr command, you can replace characters redirected from a file and write the result
to the standard output, your screen. Suppose you want to replace all characters t of
your file.txt from the example above with x and print this to your screen. Do so
by entering tr t x < file.txt.

Just like the standard output, the standard error output is sent to the console. To redirect
the standard error output to a file named errors, append 2> errors to the corre-
sponding command. Both standard output and standard error are saved to one file named
alloutput if you append >& alloutput.

Using pipelines or pipes is also a sort redirection, although the use of the pipe is not
constrained to files. With a pipe (|), you can combine several commands, using the
output of one command as input for the next command. For example, to view the contents
or your current directory in less, enter ls | less. This only makes sense if the
normal output with ls would be too lengthy. For instance, if you view the contents of
the dev directory with ls /dev, you only see a small portion in the window. View
the entire list with ls /dev | less.

Working with the Shell 341


17.1.5 Archives and Data Compression
Now that you have already created a number of files and directories, consider the subject
of archives and data compression. Suppose you want to have the entire test directory
packed in one file that you can save on a USB stick as a backup copy or send by e-mail.
To do so, use the command tar (for tape archiver). With tar --help, view all the
options for the tar command. The most important of these options are explained here:

-c
(for create) Create a new archive.

-t
(for table) Display the contents of an archive.

-x
(for extract) Unpack the archive.

-v
(for verbose) Show all files on screen while creating the archive.

-f
(for file) Choose a filename for the archive file. When creating an archive, this
option must always be given as the last one.

To pack the test directory with all its files and subdirectories into an archive named
testarchive.tar, do the following:

1 Open a shell.

2 Use cd to your home directory where the test directory is located.

3 Enter tar -cvf testarchive.tar test. The -c option creates the


archive, making it a file as directed by -f. The -v option lists the files as they
are processed.

4 View the contents of the archive file with tar -tf testarchive.tar.

The test directory with all its files and directories has remained unchanged on your
hard disk. To unpack the archive, enter tar -xvf testarchive.tar, but do not
try this yet.

342 Installation and Administration


For file compression, the obvious choice is gzip or, for a even better compression ratio,
bzip2. Just enter gzip testarchive.tar (or bzip2 testarchive.tar,
but gzip is used in this example). With ls, now see that the file testarchive.tar
is no longer there and that the file testarchive.tar.gz has been created instead.
This file is much smaller and therefore much better suited for transfer via e-mail or
storage on a USB stick.

Now, unpack this file in the test2 directory created earlier. To do so, enter cp
testarchive.tar.gz test2 to copy the file to that directory. Change to the
directory with cd test2. A compressed archive with the .tar.gz extension can
be unzipped with the gunzip command. Enter gunzip testarchive.tar.gz,
which results in the file testarchive.tar, which then needs to be extracted or
untarred with tar -xvf testarchive.tar. You can also unzip and extract a
compressed archive in one step with tar -xvf testarchive.tar.gz (adding
the -z option is no longer required). With ls, you can see that a new test directory
has been created with the same contents as your test directory in your home directory.

17.1.6 Cleaning Up
After this crash course, you should be familiar with the basics of the Linux shell or
command line. You may want to clean up your home directory by deleting the various
test files and directories using the rm and rmdir commands. In Section 17.3, “Important
Linux Commands” (page 347), find a list of the most important commands and a brief
description of their functions.

17.2 Users and Access Permissions


Since its inception in the early 1990s, Linux has been developed as a multiuser system.
Any number of users can work on it simultaneously. Users need to log in to the system
before starting a session at their workstations. Each user has a username with a corre-
sponding password. This differentiation of users guarantees that unauthorized users
cannot see files for which they do not have permission. Larger changes to the system,
such as installing new programs, are also usually impossible or restricted for normal
users. Only the root user, or super user, has the unrestricted capacity to make changes
to the system and unlimited access to all files. Those who use this concept wisely, only
logging in with full root access when necessary, can cut back the risk of unintentional
loss of data. Because under normal circumstances only root can delete system files or

Working with the Shell 343


format hard disks, the threat from the Trojan horse effect or from accidentally entering
destructive commands can be significantly reduced.

17.2.1 File System Permissions


Basically, every file in a Linux file system belongs to a user and a group. Both of these
proprietary groups and all others can be authorized to write, read, or execute these files.

A group, in this case, can be defined as a set of connected users with certain collective
rights. For example, call a group working on a certain project project3. Every user
in a Linux system is a member of at least one proprietary group, normally users.
There can be as many groups in a system as needed, but only root is able to add
groups. Every user can find out, with the command groups, of which groups he is a
member.

File Access
The organization of permissions in the file system differs for files and directories.
File permission information can be displayed with the command ls -l. The
output could appear as in Example 17.1, “Sample Output Showing File Permissions”
(page 344).

Example 17.1 Sample Output Showing File Permissions


-rw-r----- 1 tux project3 14197 Jun 21 15:03 Roadmap

As shown in the third column, this file belongs to user tux. It is assigned to the
group project3. To discover the user permissions of the Roadmap file, the first
column must be examined more closely.

- rw- r-- ---

Type Users Permissions Group Permissions Permissions for Other


Users

This column consists of one leading character followed by nine characters grouped
in threes. The first of the ten letters stands for the type of file system component.
The hyphen (–) shows that this is a file. A directory (d), a link (l), a block device
(b), or a character device could also be indicated.

344 Installation and Administration


The next three blocks follow a standard pattern. The first three characters refer to
whether the file is readable (r) or not (–). A w in the middle portion symbolizes
that the corresponding object can be edited and a hyphen (–) means it is not possible
to write to the file. An x in the third position denotes that the object can be executed.
Because the file in this example is a text file and not one that is executable, exe-
cutable access for this particular file is not needed.

In this example, tux has, as owner of the file Roadmap, read (r) and write access
(w) to it, but cannot execute it (x). The members of the group project3 can read
the file, but they cannot modify it or execute it. Other users do not have any access
to this file. Other permissions can be assigned by means of ACLs (access control
lists).

Directory Permissions
Access permissions for directories have the type d. For directories, the individual
permissions have a slightly different meaning.

Example 17.2 Sample Output Showing Directory Permissions


drwxrwxr-x 1 tux project3 35 Jun 21 15:15 ProjectData

In Example 17.2, “Sample Output Showing Directory Permissions” (page 345), the
owner (tux) and the owning group (project3) of the directory ProjectData
are easy to recognize. In contrast to the file access permissions from File Access
(page 344), the set reading permission (r) means that the contents of the directory
can be shown. The write permission (w) means that new files can be created. The
executable permission (x) means that the user can change to this directory. In the
above example, the user tux as well as the members of the group project3 can
change to the ProjectData directory (x), view the contents (r), and add or
delete files (w). The rest of the users, on the other hand, are given less access. They
may enter the directory (x) and browse through it (r), but not insert any new files
(w).

17.2.2 Modifying File Permissions


Changing Access Permissions
The access permissions of a file or directory can be changed by the owner and, of
course, by root with the command chmod followed by the parameters changing
the permissions and one or more filenames. The parameters form different cate-
gories:

Working with the Shell 345


1. Users concerned

• u (user)—owner of the file

• g (group)—group that owns the file

• o (others)—additional users (if no parameter is given, the changes apply to all


categories)

2. A character for deletion (–), setting (=), or insertion (+)

3. The abbreviations

• r—read

• w—write

• x—execute

4. Filename or filenames separated by spaces

If, for example, the user tux in Example 17.2, “Sample Output Showing Directory
Permissions” (page 345) also wants to grant other users write (w) access to the di-
rectory ProjectData, he can do this using the command chmod o+w
ProjectData.

If, however, he wants to deny all users other than himself write permissions, he
can do this by entering the command chmod go-w ProjectData. To prohibit
all users from adding a new file to the folder ProjectData, enter chmod -w
ProjectData. Now, not even the owner can create a new file in the directory
without first reestablishing write permissions.

Changing Ownership Permissions


Other important commands to control the ownership and permissions of the file
system components are chown (change owner) and chgrp (change group). The
command chown can be used to transfer ownership of a file to another user.
However, only root is permitted to perform this change.

Suppose the file Roadmap from Example 17.2, “Sample Output Showing Directory
Permissions” (page 345) should no longer belong to tux, but to the user geeko.
root should then enter chown geeko Roadmap.

346 Installation and Administration


chgrp changes the group ownership of the file. However, the owner of the file
must be a member of the new group. In this way, the user tux from Example 17.1,
“Sample Output Showing File Permissions” (page 344) can switch the group owning
the file ProjectData to project4 with the command chgrp project4
ProjectData, as long as he is a member of this new group.

17.3 Important Linux Commands


This section gives insight into the most important commands. There are many more
commands than listed in this chapter. Along with the individual commands, parameters
are listed and, where appropriate, a typical sample application is introduced. To learn
more about the various commands, use the manual pages, accessed with man followed
by the name of the command, for example, man ls.

In the man pages, move up and down with PgUp and PgDn. Move between the beginning
and the end of a document with Home and End. End this viewing mode by pressing Q.
Learn more about the man command itself with man man.

In the following overview, the individual command elements are written in different
typefaces. The actual command and its mandatory options are always printed as
command option. Specifications or parameters that are not required are placed in
[square brackets].

Adjust the settings to your needs. It makes no sense to write ls file if no file named
file actually exists. You can usually combine several parameters, for example, by
writing ls -la instead of ls -l -a.

17.3.1 File Commands


The following section lists the most important commands for file management. It covers
anything from general file administration to manipulation of file system ACLs.

File Administration
ls [options] [files]
If you run ls without any additional parameters, the program lists the contents of
the current directory in short form.

Working with the Shell 347


-l
Detailed list

-a
Displays hidden files

cp [options] source target


Copies source to target.

-i
Waits for confirmation, if necessary, before an existing target is overwritten

-r
Copies recursively (includes subdirectories)

mv [options] source target


Copies source to target then deletes the original source.

-b
Creates a backup copy of the source before moving

-i
Waits for confirmation, if necessary, before an existing targetfile is
overwritten

rm [options] files
Removes the specified files from the file system. Directories are not removed by
rm unless the option -r is used.

-r
Deletes any existing subdirectories

-i
Waits for confirmation before deleting each file

ln [options] source target


Creates an internal link from source to target. Normally, such a link points
directly to source on the same file system. However, if ln is executed with the
-s option, it creates a symbolic link that only points to the directory in which
source is located, enabling linking across file systems.

348 Installation and Administration


-s
Creates a symbolic link

cd [options] [directory]
Changes the current directory. cd without any parameters changes to the user's
home directory.

mkdir [options] directory


Creates a new directory.

rmdir [options] directory


Deletes the specified directory if it is already empty.

chown [options] username[:[group]] files


Transfers ownership of a file to the user with the specified username.

-R
Changes files and directories in all subdirectories

chgrp [options] groupname files


Transfers the group ownership of a given file to the group with the specified
group name. The file owner can only change group ownership if a member of both
the current and the new group.

chmod [options] mode files


Changes the access permissions.

The mode parameter has three parts: group, access, and access type.
group accepts the following characters:

u
User

g
Group

o
Others

For access, grant access with + and deny it with -.

Working with the Shell 349


The access type is controlled by the following options:

r
Read

w
Write

x
Execute—executing files or changing to the directory

s
Setuid bit—the application or program is started as if it were started by the
owner of the file

As an alternative, a numeric code can be used. The four digits of this code are
composed of the sum of the values 4, 2, and 1—the decimal result of a binary mask.
The first digit sets the set user ID (SUID) (4), the set group ID (2), and the sticky
(1) bits. The second digit defines the permissions of the owner of the file. The third
digit defines the permissions of the group members and the last digit sets the per-
missions for all other users. The read permission is set with 4, the write permission
with 2, and the permission for executing a file is set with 1. The owner of a file
would usually receive a 6 or a 7 for executable files.

gzip [parameters] files


This program compresses the contents of files using complex mathematical algo-
rithms. Files compressed in this way are given the extension .gz and need to be
uncompressed before they can be used. To compress several files or even entire
directories, use the tar command.

-d
Decompresses the packed gzip files so they return to their original size and
can be processed normally (like the command gunzip)

tar options archive files


tar puts one or more files into an archive. Compression is optional. tar is a quite
complex command with a number of options available. The most frequently used
options are:

-f
Writes the output to a file and not to the screen as is usually the case

350 Installation and Administration


-c
Creates a new tar archive

-r
Adds files to an existing archive

-t
Outputs the contents of an archive

-u
Adds files, but only if they are newer than the files already contained in the
archive

-x
Unpacks files from an archive (extraction)

-z
Packs the resulting archive with gzip

-j
Compresses the resulting archive with bzip2

-v
Lists files processed

The archive files created by tar end with .tar. If the tar archive was also com-
pressed using gzip, the ending is .tgz or .tar.gz. If it was compressed using
bzip2, the ending is .tar.bz2.

locate patterns
This command is only available if you have installed the findutils-locate
package. The locate command can find in which directory a specified file is lo-
cated. If desired, use wild cards to specify filenames. The program is very speedy,
because it uses a database specifically created for the purpose (rather than searching
through the entire file system). This very fact, however, also results in a major
drawback: locate is unable to find any files created after the latest update of its
database. The database can be generated by root with updatedb.

updatedb [options]
This command performs an update of the database used by locate. To include
files in all existing directories, run the program as root. It also makes sense to

Working with the Shell 351


place it in the background by appending an ampersand (&), so you can immediately
continue working on the same command line (updatedb &). This command
usually runs as a daily cron job (see cron.daily).

find [options]
With find, search for a file in a given directory. The first argument specifies the
directory in which to start the search. The option -name must be followed by a
search string, which may also include wild cards. Unlike locate, which uses a
database, find scans the actual directory.

Commands to Access File Contents


file [options] [files]
With file, detect the contents of the specified files.

-z
Tries to look inside compressed files

cat [options] files


The cat command displays the contents of a file, printing the entire contents to
the screen without interruption.

-n
Numbers the output on the left margin

less [options] files


This command can be used to browse the contents of the specified file. Scroll half
a screen page up or down with PgUp and PgDn or a full screen page down with
Space. Jump to the beginning or end of a file using Home and End. Press Q to exit
the program.

grep [options] searchstring files


The grep command finds a specific search string in the specified files. If the search
string is found, the command displays the line in which searchstring was
found along with the filename.

-i
Ignores case

352 Installation and Administration


-H
Only displays the names of the respective files, but not the text lines

-n
Additionally displays the numbers of the lines in which it found a hit

-l
Only lists the files in which searchstring does not occur

diff [options] file1 file2


The diff command compares the contents of any two files. The output produced
by the program lists all lines that do not match. This is frequently used by program-
mers who need only send their program alterations and not the entire source code.

-q
Only reports whether the two files differ

-u
Produces a “unified” diff, which makes the output more readable

File Systems
mount [options] [device] mountpoint
This command can be used to mount any data media, such as hard disks, CD-ROM
drives, and other drives, to a directory of the Linux file system.

-r
Mount read-only

-t filesystem
Specify the file system, commonly ext2 for Linux hard disks, msdos for
MS-DOS media, vfat for the Windows file system, and iso9660 for CDs

For hard disks not defined in the file /etc/fstab, the device type must also be
specified. In this case, only root can mount it. If the file system should also be
mounted by other users, enter the option user in the appropriate line in the /etc/
fstab file (separated by commas) and save this change. Further information is
available in the mount(1) man page.

Working with the Shell 353


umount [options] mountpoint
This command unmounts a mounted drive from the file system. To prevent data
loss, run this command before taking a removable data medium from its drive.
Normally, only root is allowed to run the commands mount and umount. To
enable other users to run these commands, edit the /etc/fstab file to specify
the option user for the respective drive.

17.3.2 System Commands


The following section lists a few of the most important commands needed for retrieving
system information and controlling processes and the network.

System Information
df [options] [directory]
The df (disk free) command, when used without any options, displays information
about the total disk space, the disk space currently in use, and the free space on all
the mounted drives. If a directory is specified, the information is limited to the
drive on which that directory is located.

-h
Shows the number of occupied blocks in gigabytes, megabytes, or kilobytes—in
human-readable format

-T
Type of file system (ext2, nfs, etc.)

du [options] [path]
This command, when executed without any parameters, shows the total disk space
occupied by files and subdirectories in the current directory.

-a
Displays the size of each individual file

-h
Output in human-readable form

-s
Displays only the calculated total size

354 Installation and Administration


free [options]
The command free displays information about RAM and swap space usage,
showing the total and the used amount in both categories. See Section 21.1.6, “The
free Command” (page 412) for more information.

-b
Output in bytes

-k
Output in kilobytes

-m
Output in megabytes

date [options]
This simple program displays the current system time. If run as root, it can also
be used to change the system time. Details about the program are available in the
date(1) man page.

Processes
top [options]
top provides a quick overview of the currently running processes. Press H to access
a page that briefly explains the main options for customizing the program.

ps [options] [process ID]


If run without any options, this command displays a table of all your own programs
or processes—those you started. The options for this command are not preceded
by hyphen.

aux
Displays a detailed list of all processes, independent of the owner

kill [options] process ID


Unfortunately, sometimes a program cannot be terminated in the normal way. In
most cases, you should still be able to stop such a runaway program by executing
the kill command, specifying the respective process ID (see top and ps). kill
sends a TERM signal that instructs the program to shut itself down. If this does not
help, the following parameter can be used:

Working with the Shell 355


-9
Sends a KILL signal instead of a TERM signal, bringing the specified process
to an end in almost all cases

killall [options] processname


This command is similar to kill, but uses the process name (instead of the process
ID) as an argument, killing all processes with that name.

Network
ping [options] hostname or IP address
The ping command is the standard tool for testing the basic functionality of TCP/IP
networks. It sends a small data packet to the destination host, requesting an imme-
diate reply. If this works, ping displays a message to that effect, which indicates
that the network link is basically functioning.

-c number
Determines the total number of packages to send and ends after they have been
dispatched (by default, there is no limitation set)

-f
flood ping: sends as many data packages as possible; a popular means, reserved
for root, to test networks

-i value
Specifies the interval between two data packages in seconds (default: one
second)

nslookup
The domain name system resolves domain names to IP addresses. With this tool,
send queries to name servers (DNS servers).

telnet [options] hostname or IP address [port]


Telnet is actually an Internet protocol that enables you to work on remote hosts
across a network. telnet is also the name of a Linux program that uses this protocol
to enable operations on remote computers.

356 Installation and Administration


WARNING

Do not use telnet over a network on which third parties can “eavesdrop.”
Particularly on the Internet, use encrypted transfer methods, such as ssh,
to avoid the risk of malicious misuse of a password (see the man page for
ssh).

Miscellaneous
passwd [options] [username]
Users may change their own passwords at any time using this command. The ad-
ministrator root can use the command to change the password of any user on the
system.

su [options] [username]
The su command makes it possible to log in under a different username from a
running session. Specify a username and the corresponding password. The password
is not required from root, because root is authorized to assume the identity of
any user. When using the command without specifying a username, you are
prompted for the root password and change to the superuser (root).

-
Use su - to start a login shell for the different user

halt [options]
To avoid loss of data, you should always use this program to shut down your system.

reboot [options]
Does the same as halt except the system performs an immediate reboot.

clear
This command cleans up the visible area of the console. It has no options.

17.3.3 For More Information


There are many more commands than listed in this chapter. For information about
other commands or more detailed information, the O'Reilly publication Linux in a
Nutshell is recommended.

Working with the Shell 357


17.4 The vi Editor
Text editors are still used for many system administration tasks as well as for program-
ming. In the world of Unix, vi stands out as an editor that offers comfortable editing
functions and is more ergonomic than many editors with mouse support.

17.4.1 Operating Modes


NOTE: Display of Keys

In the following, find several commands that you can enter in vi by just pressing
keys. These appear in uppercase as on a keyboard. If you need to enter a key
in uppercase, this is stated explicitly by showing a key combination including
the Shift key.

Basically, vi makes use of three operating modes: insert mode, command mode, and
extended mode. The keys have different functions depending on the mode. On start-up,
vi is normally set to the command mode. The first thing to learn is how to switch between
the modes:

Command Mode to Insert Mode


There are many possibilities, including A for append, I for insert, or O for a new
line under the current line.

Insert Mode to Command Mode


Press Esc to exit the insert mode. vi cannot be terminated in insert mode, so it is
important to get used to pressing Esc.

Command Mode to Extended Mode


The extended mode of vi can be activated by entering a colon (:). The extended or
ex mode is similar to an independent line-oriented editor that can be used for various
simple and more complex tasks.

Extended Mode to Command Mode


After executing a command in extended mode, the editor automatically returns to
command mode. If you decide not to execute any command in extended mode,
delete the colon with <—. The editor returns to command mode.

358 Installation and Administration


It is not possible to switch directly from insert mode to extended mode without first
switching to command mode.

vi, like other editors, has its own procedure for terminating the program. You cannot
terminate vi while in insert mode. First, exit insert mode by pressing Esc. Subsequently,
you have two options:

1. Exit without saving: To terminate the editor without saving the changes, enter : –
Q – ! in command mode. The exclamation mark (!) causes vi to ignore any changes.

2. Save and exit: There are several possibilities to save your changes and terminate
the editor. In command mode, use Shift + Z Shift + Z. To exit the program saving
all changes using the extended mode, enter : – W – Q. In extended mode, w stands
for write and q for quit.

17.4.2 vi in Action
vi can be used as a normal editor. In insert mode, enter text and delete text with the <—
and Del keys. Use the arrow keys to move the cursor.

However, these control keys often cause problems, because there are many terminal
types that use special key codes. This is where the command mode comes into play.
Press Esc to switch from insert mode to command mode. In command mode, move the
cursor with H, J, K, and L. The keys have the following functions:

H
Move one character to the left

J
Move one line down

K
Move one line up

L
Move one character to the right

The commands in command mode allow diverse variations. To execute a command


several times, simply enter the number of repetitions before entering the actual command.
For example, enter 5 L to move the cursor five characters to the right.

Working with the Shell 359


A selection of important commands is shown in Table 17.2, “Simple Commands of the
vi Editor” (page 360) This list is far from complete. More complete lists are available
in the documentation found in Section 17.4.3, “For More Information” (page 361)

Table 17.2 Simple Commands of the vi Editor

Esc Change to command mode

I Change to insert mode (characters appear at the current cursor


position)

A Change to insert mode (characters are inserted after the current


cursor position)

Shift + A Change to insert mode (characters are added at the end of the
line)

Shift + R Change to replace mode (overwrite the old text)

R Replace the character under the cursor

O Change to insert mode (a new line is inserted after the current


one)

Shift + O Change to insert mode (a new line is inserted before the cur-
rent one)

X Delete the current character

D–D Delete the current line

D–W Delete up to the end of the current word

C–W Change to insert mode (the rest of the current word is over-
written by the next entries you make)

U Undo the last command

Ctrl + R Redo the change that was undone

360 Installation and Administration


Shift + J Join the following line with the current one

. Repeat the last command

17.4.3 For More Information


vi supports a wide range of commands. It enables the use of macros, shortcuts, named
buffers, and many other useful features. A detailed description of the various options
would exceed the scope of this manual. SUSE Linux Enterprise comes with vim (vi
improved), an improved version of vi. There are numerous information sources for this
application:

• vimtutor is an interactive tutor for vim.

• In vim, enter the command :help to get help for many subjects.

• A book about vim is available online at http://www.truth.sk/vim/


vimbook-OPL.pdf.

• The Web pages of the vim project at http://www.vim.org feature all kinds
of news, mailing lists, and other documentation.

• A number of vim sources are available on the Internet: http://www.selflinux


.org/selflinux/html/vim.html, http://www.linuxgazette.com/
node/view/9039, and http://www.apmaths.uwo.ca/~xli/vim/vim
_tutorial.html. See http://linux-universe.com/HOWTO/
Vim-HOWTO/vim-tutorial.html for further links to tutorials.

IMPORTANT: The VIM License

vim is “charityware,” which means that the authors do not charge any money
for the software but encourage you to support a nonprofit project with a
monetary contribution. This project solicits help for poor children in Uganda.
More information is available online at http://iccf-holland.org/index
.html, http://www.vim.org/iccf/, and http://www.iccf.nl/.

Working with the Shell 361


Part III. System
32-Bit and 64-Bit Applications
in a 64-Bit System
Environment
SUSE Linux Enterprise® is available for several 64-bit platforms. This does not neces-
18
sarily mean that all the applications included have already been ported to 64-bit plat-
forms. SUSE Linux Enterprise supports the use of 32-bit applications in a 64-bit system
environment. This chapter offers a brief overview of how this support is implemented
on 64-bit SUSE Linux Enterprise platforms. It explains how 32-bit applications are
executed (runtime support) and how 32-bit applications should be compiled to enable
them to run both in 32-bit and 64-bit system environments. Additionally, find information
about the kernel API and an explanation of how 32-bit applications can run under a 64-
bit kernel.

NOTE: 31-Bit Applications on IBM System z:

s390 on IBM System z uses a 31-bit environment. References to 32-bit applica-


tions in the following also apply to 31-bit applications.

SUSE Linux Enterprise for the 64-bit platforms ia64, ppc64, s390x, and x86_64 is de-
signed so that existing 32-bit applications run in the 64-bit environment “out-of-the-
box.” The corresponding 32-bit platforms are x86 for ia64, ppc for ppc64, s390 for
s390x, and x86 for x86_64. This support means that you can continue to use your pre-
ferred 32-bit applications without waiting for a corresponding 64-bit port to become
available. The current ppc64 system runs most applications in 32-bit mode, but you
can run 64-bit applications.

32-Bit and 64-Bit Applications in a 64-Bit System Environment 365


18.1 Runtime Support
IMPORTANT: Conflicts between Application Versions

If an application is available both for 32-bit and 64-bit environments, parallel


installation of both versions is bound to lead to problems. In such cases, decide
on one of the two versions and install and use this.

To be executed correctly, every application requires a range of libraries. Unfortunately,


the names for the 32-bit and 64-bit versions of these libraries are identical. They must
be differentiated from each other in another way.

The same approach is used for the 64-bit platforms ppc64, s390x, and x86_64: To retain
compatibility with the 32-bit version, the libraries are stored at the same place in the
system as in the 32-bit environment. The 32-bit version of libc.so.6 is located under
/lib/libc.so.6 in both the 32-bit and 64-bit environments.

All 64-bit libraries and object files are located in directories called lib64. The 64-bit
object files you would normally expect to find under /lib, /usr/lib, and /usr/
X11R6/lib are now found under /lib64, /usr/lib64, and /usr/X11R6/
lib64. This means that there is space for the 32-bit libraries under /lib, /usr/lib
and /usr/X11R6/lib, so the filename for both versions can remain unchanged.

Subdirectories of 32-bit /lib directories whose data content does not depend on the
word size are not moved. For example, the X11 fonts are still found in the usual location
under /usr/X11R6/lib/X11/fonts. This scheme conforms to LSB (Linux
Standards Base) and FHS (File System Hierarchy Standard).

►ipf: The 64-bit libraries for ia64 are located in the standard lib directories. In such
cases, there is neither a lib64 directory or a lib32 directory. ia64 executes the 32-
bit x86 code under an emulation. A set of basic libraries is installed in /emul/
ia32-linux/lib and /emul/ia32-linux/usr/X11R6/lib. ◄

366 Installation and Administration


18.2 Software Development
All 64-bit architectures support the development of 64-bit objects. The level of support
for 32-bit compiling depends on the architecture. These are the various implementation
options for the tool chain from GCC (GNU Compiler Collection) and binutils, which
include the assembler as and the linker ld:

Biarch Compiler
Both 32-bit and 64-bit objects can be generated with a biarch development tool
chain. The compilation of 64-bit objects is the default on almost all platforms. 32-
bit objects can be generated if special flags are used. This special flag is -m32 for
GCC (-m31 for generating s390 binaries). The flags for the binutils are architecture-
dependent, but GCC transfers the correct flags to linkers and assemblers. A biarch
development tool chain currently exists for amd64 (supports development for x86
and amd64 instructions), for s390x, and for ppc64. 32-bit objects are normally
created on the ppc64 platform. The -m64 flag must be used to generate 64-bit ob-
jects.

No Support
SUSE Linux Enterprise does not support the direct development of 32-bit software
on all platforms. To develop applications for x86 under ia64, use the corresponding
32-bit version of SUSE Linux Enterprise.

All header files must be written in an architecture-independent form. The installed 32-
bit and 64-bit libraries must have an API (application programming interface) that
matches the installed header files. The normal SUSE Linux Enterprise environment is
designed according to this principle. In the case of manually updated libraries, resolve
these issues yourself.

32-Bit and 64-Bit Applications in a 64-Bit System Environment 367


18.3 Software Compilation on Biarch
Platforms
To develop binaries for the other architecture on a biarch architecture, the respective
libraries for the second architecture must additionally be installed. These packages are
called rpmname-32bit or rpmname-x86 (for ia64) if the second architecture is a
32-bit architecture or rpmname-64bit if the second architecture is a 64-bit architec-
ture. You also need the respective headers and libraries from the rpmname-devel
packages and the development libraries for the second architecture from
rpmname-devel-32bit or rpmname-devel-64bit.

For example, to compile a program that uses libaio on a system whose second archi-
tecture is a 32-bit architecture (x86_64 or s390x), you need the following RPMs:

libaio-32bit
32-bit runtime package

libaio-devel-32bit
Headers and libraries for 32-bit development

libaio
64-bit runtime package

libaio-devel
64-bit development headers and libraries

Most open source programs use an autoconf-based program configuration. To use


autoconf for configuring a program for the second architecture, overwrite the normal
compiler and linker settings of autoconf by running the configure script with
additional environment variables.

The following example refers to an x86_64 system with x86 as the second architecture.
Examples for s390x with s390 as the second architecture or ppc64 with ppc as the second
architecture would be similar. This example does not apply to ia64 where you do not
build 32-bit packages.

368 Installation and Administration


TIP

When using s390 as second architecture, you have to use -m31 instead of
-m32, because this is a 31 bit system.

1 Use the 32-bit compiler:


CC="gcc -m32"

2 Instruct the linker to process 32-bit objects (always use gcc as the linker front-
end):
LD="gcc -m32"

3 Set the assembler to generate 32-bit objects:


AS="gcc -c -m32"

4 Determine that the libraries for libtool and so on come from /usr/lib:
LDFLAGS="-L/usr/lib"

5 Determine that the libraries are stored in the lib subdirectory:


--libdir=/usr/lib

6 Determine that the 32-bit X libraries are used:


--x-libraries=/usr/X11R6/lib/

Not all of these variables are needed for every program. Adapt them to the respective
program.

An example configure call to compile a native 32-bit application on x86_64, ppc64,


or s390x could appear as follows:

CC="gcc -m32" \
LDFLAGS="-L/usr/lib;" \
.configure \
--prefix=/usr \
--libdir=/usr/lib
make
make install

32-Bit and 64-Bit Applications in a 64-Bit System Environment 369


18.4 Kernel Specifications
The 64-bit kernels for x86_64, ppc64, and s390x offer both a 64-bit and a 32-bit kernel
ABI (application binary interface). The latter is identical with the ABI for the corre-
sponding 32-bit kernel. This means that the 32-bit application can communicate with
the 64-bit kernel in the same way as with the 32-bit kernel.

The 32-bit emulation of system calls for a 64-bit kernel does not support all the APIs
used by system programs. This depends on the platform. For this reason, a small number
of applications, like lspci, must be compiled on non-ppc64 platforms as 64-bit pro-
grams to function properly. On IBM System z, not all ioctls are available in the 32-bit
kernel ABI.

A 64-bit kernel can only load 64-bit kernel modules that have been specially compiled
for this kernel. It is not possible to use 32-bit kernel modules.

TIP

Some applications require separate kernel-loadable modules. If you intend to


use such a 32-bit application in a 64-bit system environment, contact the
provider of this application and Novell to make sure that the 64-bit version of
the kernel-loadable module and the 32-bit compiled version of the kernel API
are available for this module.

370 Installation and Administration


Booting and Configuring a
Linux System
Booting a Linux system involves various different components. Started by the BIOS,
19
the boot loader runs the kernel and some drivers that are necessary for booting. After
this, the behavior of the computer strongly depends on init and the configuration of the
runlevel used.

19.1 The Linux Boot Process


The Linux boot process consists of several stages each represented by another compo-
nent. The following list briefly summarizes the boot process and features all the major
components involved.

1. BIOS After the computer has been turned on, the BIOS initializes the screen
and keyboard and tests the main memory. Up to this stage, the machine does not
access any mass storage media. Subsequently, the information about the current
date, time, and the most important peripherals are loaded from the CMOS values.
When the first hard disk and its geometry are recognized, the system control
passes from the BIOS to the boot loader. If the BIOS supports network booting,
it is also possible to configure a boot server that provides the boot loader. On x86
systems, PXE boot is needed. Other architectures commonly use the BOOTP
protocol to get the boot loader.

2. Boot Loader The first physical 512-byte data sector of the first hard disk is
loaded into the main memory and the boot loader that resides at the beginning of
this sector takes over. The commands executed by the boot loader determine the
remaining part of the boot process. Therefore, the first 512 bytes on the first hard

Booting and Configuring a Linux System 371


disk are referred to as the Master Boot Record (MBR). The boot loader then
passes control to the actual operating system, in this case, the Linux kernel. More
information about GRUB, the Linux boot loader, can be found in Chapter 20, The
Boot Loader (page 387). For a network boot, the BIOS acts as the boot loader. It
gets the image to start from the boot server then starts the system. This is completely
independent of local hard disks.

3. Kernel and initramfs To pass system control, the boot loader loads both the
kernel and an initial RAM–based file system (initramfs) into memory. The contents
of the initramfs can be used by the kernel directly. initramfs contains a small exe-
cutable called init that handles the mounting of the real root file system. If special
hardware drivers are needed before the mass storage can be accessed, they must
be in initramfs. For more information about initramfs, refer to Section 19.1.1,
“initramfs” (page 372). If the system does not have a local hard disk, initramfs must
provide the root file system to the kernel. This can be done with the help of a net-
work block device like iSCSI or SAN, but it is also possible to use NFS as the root
device.

4. init on initramfs This program performs all actions needed to mount the
proper root file system, like providing kernel functionality for the needed file
system and device drivers for mass storage controllers with udev. After the root
file system has been found, it is checked for errors and mounted. If this has been
successful, the initramfs is cleaned and the init program on the root file system is
executed. For more information about init, refer to Section 19.1.2, “init on
initramfs” (page 373). Find more information about udev in Chapter 24, Dynamic
Kernel Device Management with udev (page 461).

5. init init handles the actual booting of the system through several different levels
providing different functionality. init is described in Section 19.2, “The init Process”
(page 375).

19.1.1 initramfs
initramfs is a small cpio archive that the kernel can load to a RAM disk. It provides a
minimal Linux environment that enables the execution of programs before the actual
root file system is mounted. This minimal Linux environment is loaded into memory
by BIOS routines and does not have specific hardware requirements other than sufficient
memory. initramfs must always provide an executable named init that should execute
the actual init program on the root file system for the boot process to proceed.

372 Installation and Administration


Before the root file system can be mounted and the operating system can be started,
the kernel needs the corresponding drivers to access the device on which the root file
system is located. These drivers may include special drivers for certain kinds of hard
drives or even network drivers to access a network file system. The needed modules
for the root file system may be loaded by init on initramfs. After the modules are loaded,
udev provides the initramfs with the needed devices. Later in the boot process, after
changing the root file system, it is necessary to regenerate the devices. This is done by
init.

If you need to change hardware (hard disks) in an installed system and this hardware
requires different drivers to be present in the kernel at boot time, you must update the
initramfs file. This is done in the same way as with its predecessor, initrd—by
calling mkinitrd. Calling mkinitrd without any argument creates an initramfs.
Calling mkinitrd -R creates an initrd. In SUSE Linux Enterprise®, the modules to
load are specified by the variable INITRD_MODULES in /etc/sysconfig/
kernel. After installation, this variable is automatically set to the correct value. The
modules are loaded in exactly the order in which they appear in INITRD_MODULES.
This is only important if you rely on the correct setting of the device files /dev/sd?.
However, in current systems you also may use the device files below /dev/disk/
that are sorted in several subdirectories, named by-id, by-path and by-uuid, and
always represent the same disk.

IMPORTANT: Updating initramfs or initrd

The boot loader loads initramfs or initrd in the same way as the kernel. It is
not necessary to reinstall GRUB after updating initramfs or initrd, because GRUB
searches the directory for the right file when booting.

19.1.2 init on initramfs


The main purpose of init on initramfs is to prepare the mounting of and access to the
real root file system. Depending on your system configuration, init is responsible for
the following tasks.

Loading Kernel Modules


Depending on your hardware configuration, special drivers may be needed to access
the hardware components of your computer (especially your hard drive). To access
the root file system, the kernel needs to load the proper file system drivers.

Booting and Configuring a Linux System 373


Providing Block Special Files
For each loaded module, the kernel generates device events. udev handles these
events and generates the needed device special files on a RAM file system in /dev.
Without those special files, the file system would not be accessible.

Managing RAID and LVM Setups


If you configured your system to hold the root file system under RAID or LVM,
init sets up LVM or RAID to enable access to the root file system later. Find infor-
mation about RAID in Section 7.2, “Soft RAID Configuration” (page 119). Find
information about LVM in Section 7.1, “LVM Configuration” (page 111). Find in-
formation about EVMS and special storage settings in Storage Administration
Guide.

Managing Network Configuration


If you configured your system to use a network-mounted root file system (mounted
via NFS), init must make sure that the proper network drivers are loaded and that
they are set up to allow access to the root file system.

If the file system resides on a networked block device like iSCSI or SAN, connection
to the storage server is also set up by the initramfs.

When init is called during the initial boot as part of the installation process, its tasks
differ from those mentioned earlier:

Finding the Installation Medium


As you start the installation process, your machine loads an installation kernel and
a special initrd with the YaST installer from the installation medium. The YaST
installer, which is run in a RAM file system, needs to have information about the
location of the installation medium to access it and install the operating system.

Initiating Hardware Recognition and Loading Appropriate Kernel Modules


As mentioned in Section 19.1.1, “initramfs” (page 372), the boot process starts with
a minimum set of drivers that can be used with most hardware configurations. init
starts an initial hardware scanning process that determines the set of drivers suitable
for your hardware configuration. The names of the modules needed for the boot
process are written to INITRD_MODULES in /etc/sysconfig/kernel.
These names are used to generate a custom initramfs that is needed to boot the
system. If the modules are not needed for boot but for coldplug, the modules are
written to /etc/sysconfig/hardware/hwconfig-*. All devices that are
described with configuration files in this directory are initialized in the boot process.

374 Installation and Administration


Loading the Installation System or Rescue System
As soon as the hardware has been properly recognized, the appropriate drivers have
been loaded, and udev has created the device special files, init starts the installation
system, which contains the actual YaST installer, or the rescue system.

Starting YaST
Finally, init starts YaST, which starts package installation and system configuration.

19.2 The init Process


The program init is the process with process ID 1. It is responsible for initializing the
system in the required way. init is started directly by the kernel and resists signal 9,
which normally kills processes. All other programs are either started directly by init or
by one of its child processes.

init is centrally configured in the /etc/inittab file where the runlevels are defined
(see Section 19.2.1, “Runlevels” (page 375)). The file also specifies which services and
daemons are available in each of the levels. Depending on the entries in /etc/
inittab, several scripts are run by init. For reasons of clarity, these scripts, called
init scripts, all reside in the directory /etc/init.d (see Section 19.2.2, “Init Scripts”
(page 378)).

The entire process of starting the system and shutting it down is maintained by init.
From this point of view, the kernel can be considered a background process whose task
is to maintain all other processes and adjust CPU time and hardware access according
to requests from other programs.

19.2.1 Runlevels
In Linux, runlevels define how the system is started and what services are available in
the running system. After booting, the system starts as defined in /etc/inittab in
the line initdefault. Usually this is 3 or 5. See Table 19.1, “Available Runlevels”
(page 376). As an alternative, the runlevel can be specified at boot time (by adding the
runlevel number at the boot prompt, for instance). Any parameters that are not directly
evaluated by the kernel itself are passed to init.

Booting and Configuring a Linux System 375


Table 19.1 Available Runlevels

Runlevel Description

0 System halt

S Single user mode; from the boot prompt, only with US keyboard
mapping

1 Single user mode

2 Local multiuser mode without remote network (NFS, etc.)

3 Full multiuser mode with network

4 Not used

5 Full multiuser mode with network and X display manag-


er—KDM, GDM, or XDM

6 System reboot

IMPORTANT: Avoid Runlevel 2 with a Partition Mounted via NFS

You should not use runlevel 2 if your system mounts a partition like /usr via
NFS. The system might behave unexpectedly if program files or libraries are
missing because the NFS service is not available in runlevel 2 (local multiuser
mode without remote network).

To change runlevels while the system is running, enter telinit and the corresponding
number as an argument. Only the system administrator is allowed to do this. The fol-
lowing list summarizes the most important commands in the runlevel area.

telinit 1 or shutdown now


The system changes to single user mode. This mode is used for system maintenance
and administration tasks.

376 Installation and Administration


telinit 3
All essential programs and services (including network) are started and regular
users are allowed to log in and work with the system without a graphical environ-
ment.

telinit 5
The graphical environment is enabled. Usually a display manager like XDM, GDM,
or KDM is started. If autologin is enabled, the local user is logged in to the prese-
lected window manager (GNOME or KDE or any other window manager).

telinit 0 or shutdown -h now


The system halts.

telinit 6 or shutdown -r now


The system halts then reboots.

Runlevel 5 is the default runlevel in all SUSE Linux Enterprise standard installations.
Users are prompted for login with a graphical interface or the default user is logged in
automatically. If the default runlevel is 3, the X Window System must be configured
properly, as described in Chapter 26, The X Window System (page 481), before the run-
level can be switched to 5. If this is done, check whether the system works in the desired
way by entering telinit 5. If everything turns out as expected, you can use YaST
to set the default runlevel to 5.

WARNING: Errors in /etc/inittab May Result in a Faulty System Boot

If /etc/inittab is damaged, the system might not boot properly. Therefore,


be extremely careful while editing /etc/inittab. Always let init reread
/etc/inittab with the command telinit q before rebooting the machine.

Generally, two things happen when you change runlevels. First, stop scripts of the
current runlevel are launched, closing down some programs essential for the current
runlevel. Then start scripts of the new runlevel are started. Here, in most cases, a number
of programs are started. For example, the following occurs when changing from runlevel
3 to 5:

1. The administrator (root) requests init to change to a different runlevel by entering


telinit 5.

Booting and Configuring a Linux System 377


2. init checks the current runlevel (runlevel) and determines it should start /etc/
init.d/rc with the new runlevel as a parameter.

3. Now rc calls the stop scripts of the current runlevel for which there is no start
script in the new runlevel. In this example, these are all the scripts that reside in
/etc/init.d/rc3.d (old runlevel was 3) and start with a K. The number
following K specifies the order to run the scripts with the stop parameter, because
there are some dependencies to consider.

4. The last things to start are the start scripts of the new runlevel. In this example,
these are in /etc/init.d/rc5.d and begin with an S. Again, the number that
follows the S determines the sequence in which the scripts are started.

When changing into the same runlevel as the current runlevel, init only checks /etc/
inittab for changes and starts the appropriate steps, for example, for starting a
getty on another interface. The same functionality may be achieved with the command
telinit q.

19.2.2 Init Scripts


There are two types of scripts in /etc/init.d:

Scripts Executed Directly by init


This is the case only during the boot process or if an immediate system shutdown
is initiated (power failure or a user pressing Ctrl + Alt + Del). For IBM System z
systems, this is the case only during the boot process or if an immediate system
shutdown is initiated (power failure or via “signal quiesce”). The execution of these
scripts is defined in /etc/inittab.

Scripts Executed Indirectly by init


These are run when changing the runlevel and always call the master script
/etc/init.d/rc, which guarantees the correct order of the relevant scripts.

All scripts are located in /etc/init.d. Scripts that are run at boot time are called
through symbolic links from /etc/init.d/boot.d. Scripts for changing the run-
level are called through symbolic links from one of the subdirectories (/etc/init
.d/rc0.d to /etc/init.d/rc6.d). This is just for clarity reasons and avoids
duplicate scripts if they are used in several runlevels. Because every script can be exe-
cuted as both a start and a stop script, these scripts must understand the parameters

378 Installation and Administration


start and stop. The scripts also understand the restart, reload,
force-reload, and status options. These different options are explained in Ta-
ble 19.2, “Possible init Script Options” (page 379). Scripts that are run directly by init
do not have these links. They are run independently from the runlevel when needed.

Table 19.2 Possible init Script Options

Option Description

start Start service.

stop Stop service.

restart If the service is running, stop it then restart it. If it is not


running, start it.

reload Reload the configuration without stopping and restarting


the service.

force-reload Reload the configuration if the service supports this.


Otherwise, do the same as if restart had been given.

status Show the current status of service.

Links in each runlevel-specific subdirectory make it possible to associate scripts with


different runlevels. When installing or uninstalling packages, these links are added and
removed with the help of the program insserv (or using /usr/lib/lsb/install
_initd, which is a script calling this program). See the insserv(8) man page for details.

All of these settings may also be changed with the help of the YaST module. If you
need to check the status on the command line, use the tool chkconfig, described in the
chkconfig(8) man page.

A short introduction to the boot and stop scripts launched first or last, respectively,
follows as well as an explanation of the maintaining script.

boot
Executed while starting the system directly using init. It is independent of the
chosen runlevel and is only executed once. Here, the proc and pts file systems
are mounted and blogd (boot logging daemon) is activated. If the system is booted

Booting and Configuring a Linux System 379


for the first time after an update or an installation, the initial system configuration
is started.

The blogd daemon is a service started by boot and rc before any other one. It is
stopped after the actions triggered by these scripts (running a number of subscripts,
for example, making block special files available) are completed. blogd writes any
screen output to the log file /var/log/boot.msg, but only if and when /var
is mounted read-write. Otherwise, blogd buffers all screen data until /var becomes
available. Get further information about blogd on the blogd(8) man page.

The script boot is also responsible for starting all the scripts in /etc/init.d/
boot.d with a name that starts with S. There, the file systems are checked and
loop devices are configured if needed. The system time is also set. If an error occurs
while automatically checking and repairing the file system, the system administrator
can intervene after first entering the root password. Last executed is the script
boot.local.

boot.local
Here, enter additional commands to execute at boot before changing into a runlevel.
It can be compared to AUTOEXEC.BAT on DOS systems.

boot.setup
This script is executed when changing from single user mode to any other runlevel
and is responsible for a number of basic settings, such as the keyboard layout and
initialization of the virtual consoles.

halt
This script is only executed while changing into runlevel 0 or 6. Here, it is executed
either as halt or as reboot. Whether the system shuts down or reboots depends
on how halt is called.

rc
This script calls the appropriate stop scripts of the current runlevel and the start
scripts of the newly selected runlevel.

You can create your own scripts and easily integrate them into the scheme described
above. For instructions about formatting, naming, and organizing custom scripts, refer
to the specifications of the LSB and to the man pages of init, init.d, chkconfig,
and insserv. Additionally consult the man pages of startproc and killproc.

380 Installation and Administration


WARNING: Faulty init Scripts May Halt Your System

Faulty init scripts may hang your machine. Edit such scripts with great care and,
if possible, subject them to heavy testing in the multiuser environment. Find
some useful information about init scripts in Section 19.2.1, “Runlevels”
(page 375).

To create a custom init script for a given program or service, use the file /etc/init
.d/skeleton as a template. Save a copy of this file under the new name and edit
the relevant program and filenames, paths, and other details as needed. You may also
need to enhance the script with your own parts, so the correct actions are triggered by
the init procedure.

The INIT INFO block at the top is a required part of the script and must be edited.
See Example 19.1, “A Minimal INIT INFO Block” (page 381).

Example 19.1 A Minimal INIT INFO Block


### BEGIN INIT INFO
# Provides: FOO
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start FOO to allow XY and provide YZ
### END INIT INFO

In the first line of the INFO block, after Provides:, specify the name of the program
or service controlled by this init script. In the Required-Start: and
Required-Stop: lines, specify all services that need to be started or stopped before
the service itself is started or stopped. This information is used later to generate the
numbering of script names, as found in the runlevel directories. After
Default-Start: and Default-Stop:, specify the runlevels in which the service
should automatically be started or stopped. Finally, for Description:, provide a
short description of the service in question.

To create the links from the runlevel directories (/etc/init.d/rc?.d/) to the


corresponding scripts in /etc/init.d/, enter the command insserv
new-script-name. The insserv program evaluates the INIT INFO header to create
the necessary links for start and stop scripts in the runlevel directories (/etc/init
.d/rc?.d/). The program also takes care of the correct start and stop order for each

Booting and Configuring a Linux System 381


runlevel by including the necessary numbers in the names of these links. If you prefer
a graphical tool to create such links, use the runlevel editor provided by YaST, as de-
scribed in Section 19.2.3, “Configuring System Services (Runlevel) with YaST”
(page 382).

If a script already present in /etc/init.d/ should be integrated into the existing


runlevel scheme, create the links in the runlevel directories right away with insserv or
by enabling the corresponding service in the runlevel editor of YaST. Your changes
are applied during the next reboot—the new service is started automatically.

Do not set these links manually. If something is wrong in the INFO block, problems
will arise when insserv is run later for some other service. The manually-added
service will be removed with the next run of insserv.

19.2.3 Configuring System Services


(Runlevel) with YaST
After starting this YaST module with YaST > System > System Services (Runlevel), it
displays an overview listing all the available services and the current status of each
service (disabled or enabled). Decide whether to use the module in Simple Mode or in
Expert Mode. The default Simple Mode should be sufficient for most purposes. The left
column shows the name of the service, the center column indicates its current status,
and the right column gives a short description. For the selected service, a more detailed
description is provided in the lower part of the window. To enable a service, select it
in the table then select Enable. The same steps apply to disable a service.

382 Installation and Administration


Figure 19.1 System Services (Runlevel)

For detailed control over the runlevels in which a service is started or stopped or to
change the default runlevel, first select Expert Mode. The current default runlevel or
“initdefault” (the runlevel into which the system boots by default) is displayed at the
top. Normally, the default runlevel of a SUSE Linux Enterprise system is runlevel 5
(full multiuser mode with network and X). A suitable alternative might be runlevel 3
(full multiuser mode with network).

This YaST dialog allows the selection of one of the runlevels (as listed in Table 19.1,
“Available Runlevels” (page 376)) as the new default. Additionally use the table in this
window to enable or disable individual services and daemons. The table lists the services
and daemons available, shows whether they are currently enabled on your system, and,
if so, for which runlevels. After selecting one of the rows with the mouse, click the
check boxes representing the runlevels (B, 0, 1, 2, 3, 5, 6, and S) to define the runlevels
in which the selected service or daemon should be running. Runlevel 4 is undefined to
allow creation of a custom runlevel. A brief description of the currently selected service
or daemon is provided below the table overview.

With Start, Stop, or Refresh, decide whether a service should be activated. Refresh
status checks the current status. Set or Reset lets you select whether to apply your
changes to the system or to restore the settings that existed before starting the runlevel
editor. Selecting Finish saves the changed settings to disk.

Booting and Configuring a Linux System 383


WARNING: Faulty Runlevel Settings May Damage Your System

Faulty runlevel settings may render a system unusable. Before applying your
changes, make absolutely sure that you know their consequences.

19.3 System Configuration via


/etc/sysconfig
The main configuration of SUSE Linux Enterprise is controlled by the configuration
files in /etc/sysconfig. The individual files in /etc/sysconfig are only read
by the scripts to which they are relevant. This ensures that network settings, for example,
only need to be parsed by network-related scripts. Many other system configuration
files are generated according to the settings in /etc/sysconfig. This task is per-
formed by SuSEconfig. For example, if you change the network configuration,
SuSEconfig might make changes to the file /etc/host.conf as well, because this
is one of the files relevant for the network configuration. This concept allows most
configurations to be made in one central place without fiddling with different configu-
ration files at different places of the operating system.

There are two ways to edit the system configuration. Either use the YaST sysconfig
Editor or edit the configuration files manually.

19.3.1 Changing the System Configuration


Using the YaST sysconfig Editor
The YaST sysconfig editor provides an easy-to-use front-end to system configuration.
Without any knowledge of the actual location of the configuration variable you need
to change, you can just use the built-in search function of this module, change the value
of the configuration variable as needed, and let YaST take care of applying these
changes, updating configurations that depend on the values set in sysconfig and
restarting services.

384 Installation and Administration


WARNING: Modifying /etc/sysconfig/* Files Can Damage Your
Installation

Do not modify the /etc/sysconfig files if you lack previous experience


and knowledge. It could do considerable damage to your system. The files in
/etc/sysconfig include a short comment for each variable to explain what
effect they actually have.

Figure 19.2 System Configuration Using the sysconfig Editor

The YaST sysconfig dialog is split into three parts. The left part of the dialog shows a
tree view of all configurable variables. When you select a variable, the right part displays
both the current selection and the current setting of this variable. Below, a third window
displays a short description of the variable's purpose, possible values, the default value,
and the actual configuration file from which this variable originates. The dialog also
provides information about which configuration script is executed after changing the
variable and which new service is started as a result of the change. YaST prompts you
to confirm your changes and informs you which scripts will be executed after you leave
the dialog by selecting Finish. Also select the services and scripts to skip for now, so
they are started later. YaST applies all changes automatically and restarts any services
involved for your changes to take an effect.

Booting and Configuring a Linux System 385


19.3.2 Changing the System Configuration
Manually
To manually change the system configuration, proceed as follows

1 Become root.

2 Bring the system into single user mode (runlevel 1) with init 1.

3 Change the configuration files as needed with an editor of your choice.

If you do not use YaST to change the configuration files in /etc/sysconfig,


make sure that empty variable values are represented by two quotation marks
(KEYTABLE="") and that values with blanks in them are enclosed in quotation
marks. Values consisting of one word only do not need to be quoted.

4 Execute SuSEconfig to make sure that the changes take effect.

5 Bring your system back to the previous runlevel with a command like init
default_runlevel. Replace default_runlevel with the default run-
level of the system. Choose 5 if you want to return to full multiuser with network
and X or choose 3 if you prefer to work in full multiuser with network.

This procedure is mainly relevant when changing systemwide settings, such as the
network configuration. Small changes should not require going into single user mode,
but you may still do so to make absolutely sure that all the programs concerned are
correctly restarted.

TIP: Configuring Automated System Configuration

To disable the automated system configuration by SuSEconfig, set the variable


ENABLE_SUSECONFIG in /etc/sysconfig/suseconfig to no. Do not
disable SuSEconfig if you want to use the SUSE installation support. It is also
possible to disable the autoconfiguration partially.

386 Installation and Administration


The Boot Loader
This chapter describes how to configure GRUB, the boot loader used in SUSE Linux
20
Enterprise®. A special YaST module is available for performing all settings. If you are
not familiar with the subject of booting in Linux, read the following sections to acquire
some background information. This chapter also describes some of the problems fre-
quently encountered when booting with GRUB and their solutions.

This chapter focuses on boot management and the configuration of the boot loader
GRUB. The boot procedure as a whole is outlined in Chapter 19, Booting and Config-
uring a Linux System (page 371). A boot loader represents the interface between machine
(BIOS) and the operating system (SUSE Linux Enterprise). The configuration of the
boot loader directly impacts the start of the operating system.

The following terms appear frequently in this chapter and might need some explanation:

Master Boot Record


The structure of the MBR is defined by an operating system–independent conven-
tion. The first 446 bytes are reserved for the program code. They typically hold
part of a boot loader program or an operating system selector. The next 64 bytes
provide space for a partition table of up to four entries (see Section “Partition
Types” (page 151)). The partition table contains information about the partitioning
of the hard disk and the file system types. The operating system needs this table
for handling the hard disk. With conventional generic code in the MBR, exactly
one partition must be marked active. The last two bytes of the MBR must contain
a static “magic number” (AA55). An MBR containing a different value is regarded
as invalid by some BIOSs, so is not considered for booting.

The Boot Loader 387


Boot Sectors
Boot sectors are the first sectors of hard disk partitions with the exception of the
extended partition, which merely serves as a “container” for other partitions. These
boot sectors have 512 bytes of space for code used to boot an operating system in-
stalled in the respective partition. This applies to boot sectors of formatted DOS,
Windows, and OS/2 partitions, which also contain some important basic data of
the file system. In contrast, the boot sectors of Linux partitions are initially empty
after setting up a file system other than XFS. Therefore, a Linux partition is not
bootable by itself, even if it contains a kernel and a valid root file system. A boot
sector with valid code for booting the system has the same magic number as the
MBR in its last two bytes (AA55).

20.1 Selecting a Boot Loader


By default, the boot loader GRUB is used in SUSE Linux Enterprise. However, in some
cases and for special hardware and software constellations, LILO may be necessary. If
you update from an older SUSE Linux Enterprise version that uses LILO, LILO is in-
stalled.

Information about the installation and configuration of LILO is available in the Support
Database under the keyword LILO and in /usr/share/doc/packages/lilo.

20.2 Booting with GRUB


GRUB (Grand Unified Bootloader) comprises two stages. stage1 consists of 512 bytes
and its only task is to load the second stage of the boot loader. Subsequently, stage2 is
loaded. This stage contains the main part of the boot loader.

In some configurations, an intermediate stage 1.5 can be used, which locates and loads
stage 2 from an appropriate file system. If possible, this method is chosen by default
on installation or when initially setting up GRUB with YaST.

stage2 is able to access many file systems. Currently, Ext2, Ext3, ReiserFS, Minix, and
the DOS FAT file system used by Windows are supported. To a certain extent, XFS,
and UFS and FFS used by BSD systems are also supported. Since version 0.95, GRUB
is also able to boot from a CD or DVD containing an ISO 9660 standard file system
pursuant to the “El Torito” specification. Even before the system is booted, GRUB can

388 Installation and Administration


access file systems of supported BIOS disk devices (floppy disks or hard disks, CD
drives, and DVD drives detected by the BIOS). Therefore, changes to the GRUB con-
figuration file (menu.lst) do not require a reinstallation of the boot manager. When
the system is booted, GRUB reloads the menu file with the valid paths and partition
data of the kernel or the initial RAM disk (initrd) and locates these files.

The actual configuration of GRUB is based on three files that are described below:

/boot/grub/menu.lst
This file contains all information about partitions or operating systems that can be
booted with GRUB. Without this information, the GRUB command line prompts
the user for how to proceed (see Section “Editing Menu Entries during the Boot
Procedure” (page 394) for details).

/boot/grub/device.map
This file translates device names from the GRUB and BIOS notation to Linux device
names.

/etc/grub.conf
This file contains the commands, parameters, and options the GRUB shell needs
for installing the boot loader correctly.

GRUB can be controlled in various ways. Boot entries from an existing configuration
can be selected from the graphical menu (splash screen). The configuration is loaded
from the file menu.lst.

In GRUB, all boot parameters can be changed prior to booting. For example, errors
made when editing the menu file can be corrected in this way. Boot commands can also
be entered interactively at a kind of input prompt (see Section “Editing Menu Entries
during the Boot Procedure” (page 394)). GRUB offers the possibility of determining
the location of the kernel and the initrd prior to booting. In this way, you can even
boot an installed operating system for which no entry exists in the boot loader configu-
ration.

GRUB actually exists in two versions: as a boot loader and as a normal Linux program
in /usr/sbin/grub. This program is referred to as the GRUB shell. It provides an
emulation of GRUB in the installed system and can be used to install GRUB or test
new settings before applying them. The functionality to install GRUB as the boot
loader on a hard disk or floppy disk is integrated in GRUB in the form of the commands
install and setup. This is available in the GRUB shell when Linux is loaded.

The Boot Loader 389


20.2.1 The GRUB Boot Menu
The graphical splash screen with the boot menu is based on the GRUB configuration
file /boot/grub/menu.lst, which contains all information about all partitions or
operating systems that can be booted by the menu.

Every time the system is booted, GRUB loads the menu file from the file system. For
this reason, GRUB does not need to be reinstalled after every change to the file. Use
the YaST boot loader to modify the GRUB configuration as described in Section 20.3,
“Configuring the Boot Loader with YaST” (page 398).

The menu file contains commands. The syntax is very simple. Every line contains a
command followed by optional parameters separated by spaces like in the shell. For
historical reasons, some commands permit an = in front of the first parameter. Comments
are introduced by a hash (#).

To identify the menu items in the menu overview, set a title for every entry. The
text (including any spaces) following the keyword title is displayed as a selectable
option in the menu. All commands up to the next title are executed when this menu
item is selected.

The simplest case is the redirection to boot loaders of other operating systems. The
command is chainloader and the argument is usually the boot block of another
partition, in GRUB block notation. For example:
chainloader (hd0,3)+1

The device names in GRUB are explained in Section “Naming Conventions for Hard
Disks and Partitions” (page 391). This example specifies the first block of the fourth
partition of the first hard disk.

Use the command kernel to specify a kernel image. The first argument is the path to
the kernel image in a partition. The other arguments are passed to the kernel on its
command line.

If the kernel does not have built-in drivers for access to the root partition or a recent
Linux system with advanced hotplug features is used, initrd must be specified with
a separate GRUB command whose only argument is the path to the initrd file. Be-
cause the loading address of the initrd is written into the loaded kernel image, the
command initrd must follow after the kernel command.

390 Installation and Administration


The command root simplifies the specification of kernel and initrd files. The only
argument of root is a device or a partition. This device is used for all kernel, initrd,
or other file paths for which no device is explicitly specified until the next root com-
mand.

The boot command is implied at the end of every menu entry, so it does not need to
be written into the menu file. However, if you use GRUB interactively for booting, you
must enter the boot command at the end. The command itself has no arguments. It
merely boots the loaded kernel image or the specified chain loader.

After writing all menu entries, define one of them as the default entry. Otherwise,
the first one (entry 0) is used. You can also specify a time-out in seconds after which
the default entry should boot. timeout and default usually precede the menu entries.
An example file is described in Section “An Example Menu File” (page 392).

Naming Conventions for Hard Disks and Partitions


The naming conventions GRUB uses for hard disks and partitions differ from those
used for normal Linux devices. It more closely resembles the simple disk enumeration
the BIOS does and the syntax is similar to that used in some BSD derivatives. In GRUB,
the numbering of the partitions starts with zero. This means that (hd0,0) is the first
partition of the first hard disk. On a common desktop machine with a hard disk connected
as primary master, the corresponding Linux device name is /dev/hda1.

The four possible primary partitions are assigned the partition numbers 0 to 3. The
logical partitions are numbered from 4:

(hd0,0) first primary partition of the first hard disk


(hd0,1) second primary partition
(hd0,2) third primary partition
(hd0,3) fourth primary partition (usually an extended partition)
(hd0,4) first logical partition
(hd0,5) second logical partition

Being dependent on BIOS devices, GRUB does not distinguish between IDE, SATA,
SCSI, and hardware RAID devices. All hard disks recognized by the BIOS or other
controllers are numbered according to the boot sequence preset in the BIOS.

Unfortunately, it is often not possible to map the Linux device names to BIOS device
names exactly. It generates this mapping with the help of an algorithm and saves it to

The Boot Loader 391


the file device.map, which can be edited if necessary. Information about the file
device.map is available in Section 20.2.2, “The File device.map” (page 395).

A complete GRUB path consists of a device name written in parentheses and the path
to the file in the file system in the specified partition. The path begins with a slash. For
example, the bootable kernel could be specified as follows on a system with a single
IDE hard disk containing Linux in its first partition:
(hd0,0)/boot/vmlinuz

An Example Menu File


The following example shows the structure of a GRUB menu file. The example instal-
lation has a Linux boot partition under /dev/hda5, a root partition under /dev/
hda7, and a Windows installation under /dev/hda1.

gfxmenu (hd0,4)/message
color white/blue black/light-gray
default 0
timeout 8

title linux
kernel (hd0,4)/vmlinuz root=/dev/hda7 vga=791
initrd (hd0,4)/initrd

title windows
chainloader(hd0,0)+1

title floppy
chainloader(fd0)+1

title failsafe
kernel (hd0,4)/vmlinuz.shipped root=/dev/hda7 ide=nodma \
apm=off acpi=off vga=normal nosmp maxcpus=0 3
initrd (hd0,4)/initrd.shipped

The first block defines the configuration of the splash screen:

gfxmenu (hd0,4)/message
The background image message is located in the top directory of the /dev/
hda5 partition.

392 Installation and Administration


color white/blue black/light-gray
Color scheme: white (foreground), blue (background), black (selection), and light
gray (background of the selection). The color scheme has no effect on the splash
screen, only on the customizable GRUB menu that you can access by exiting the
splash screen with Esc.

default 0
The first menu entry title linux is the one to boot by default.

timeout 8
After eight seconds without any user input, GRUB automatically boots the default
entry. To deactivate automatic boot, delete the timeout line. If you set timeout
0, GRUB boots the default entry immediately.

The second and largest block lists the various bootable operating systems. The sections
for the individual operating systems are introduced by title.

• The first entry (title linux) is responsible for booting SUSE Linux Enterprise.
The kernel (vmlinuz) is located in the first logical partition (the boot partition)
of the first hard disk. Kernel parameters, such as the root partition and VGA mode,
are appended here. The root partition is specified according to the Linux naming
convention (/dev/hda7/), because this information is read by the kernel and
has nothing to do with GRUB. The initrd is also located in the first logical
partition of the first hard disk.

• The second entry is responsible for loading Windows. Windows is booted from the
first partition of the first hard disk (hd0,0). The command chainloader +1
causes GRUB to read and execute the first sector of the specified partition.

• The next entry enables booting from floppy disk without modifying the BIOS set-
tings.

• The boot option failsafe starts Linux with a selection of kernel parameters that
enables Linux to boot even on problematic systems.

The menu file can be changed whenever necessary. GRUB then uses the modified set-
tings during the next boot. Edit the file permanently using YaST or an editor of your
choice. Alternatively, make temporary changes interactively using the edit function of
GRUB. See Section “Editing Menu Entries during the Boot Procedure” (page 394).

The Boot Loader 393


Editing Menu Entries during the Boot Procedure
In the graphical boot menu, select the operating system to boot with the arrow keys. If
you select a Linux system, you can enter additional boot parameters at the boot prompt.
To edit individual menu entries directly, press Esc to exit the splash screen and get to
the GRUB text-based menu then press E. Changes made in this way only apply to the
current boot and are not adopted permanently.

IMPORTANT: Keyboard Layout during the Boot Procedure

The US keyboard layout is the only one available when booting. See Figure 51.1,
“US Keyboard Layout” (page 914) for a figure.

Editing menu entries facilitates the repair of a defective system that can no longer be
booted, because the faulty configuration file of the boot loader can be circumvented by
manually entering parameters. Manually entering parameters during the boot procedure
is also useful for testing new settings without impairing the native system.

After activating the editing mode, use the arrow keys to select the menu entry of the
configuration to edit. To make the configuration editable, press E again. In this way,
edit incorrect partitions or path specifications before they have a negative effect on the
boot process. Press Enter to exit the editing mode and return to the menu. Then press
B to boot this entry. Further possible actions are displayed in the help text at the bottom.

To enter changed boot options permanently and pass them to the kernel, open the file
menu.lst as the user root and append the respective kernel parameters to the existing
line, separated by spaces:

title linux
kernel (hd0,0)/vmlinuz root=/dev/hda3 additional parameter
initrd (hd0,0)/initrd

GRUB automatically adopts the new parameters the next time the system is booted.
Alternatively, this change can also be made with the YaST boot loader module. Append
the new parameters to the existing line, separated by spaces.

394 Installation and Administration


20.2.2 The File device.map
The file device.map maps GRUB and BIOS device names to Linux device names.
In a mixed system containing IDE and SCSI hard disks, GRUB must try to determine
the boot sequence by a special procedure, because GRUB may not have access to the
BIOS information on the boot sequence. GRUB saves the result of this analysis in the
file /boot/grub/device.map. For a system on which the boot sequence in the
BIOS is set to IDE before SCSI, the file device.map could appear as follows:

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/sda

Because the order of IDE, SCSI, and other hard disks depends on various factors and
Linux is not able to identify the mapping, the sequence in the file device.map can
be set manually. If you encounter problems when booting, check if the sequence in this
file corresponds to the sequence in the BIOS and use the GRUB prompt to modify it
temporarily if necessary. After the Linux system has booted, the file device.map
can be edited permanently with the YaST boot loader module or an editor of your
choice.

IMPORTANT: SATA Disks

Depending on the controller, SATA disks are either recognized as IDE (/dev/hdx)
or SCSI (/dev/sdx) devices.

After manually changing device.map, execute the following command to reinstall


GRUB. This command causes the file device.map to be reloaded and the commands
listed in grub.conf to be executed:
grub --batch < /etc/grub.conf

The Boot Loader 395


20.2.3 The File /etc/grub.conf
The third most important GRUB configuration file after menu.lst and device.map
is /etc/grub.conf. This file contains the commands, parameters, and options the
GRUB shell needs for installing the boot loader correctly:

root (hd0,4)
install /grub/stage1 (hd0,3) /grub/stage2 0x8000 (hd0,4)/grub/menu.lst
quit

Meaning of the individual entries:

root (hd0,4)
This command tells GRUB to apply the following commands to the first logical
partition of the first hard disk (the location of the boot files).

install parameter
The command grub should be run with the parameter install. stage1 of the
boot loader should be installed in the the extended partition container
(/grub/stage1 (hd0,3)). This is a slightly esoteric configuration, but it is
known to work in many cases. stage2 should be loaded to the memory address
0x8000 (/grub/stage2 0x8000). The last entry
((hd0,4)/grub/menu.lst) tells GRUB where to look for the menu file.

20.2.4 Setting a Boot Password


Even before the operating system is booted, GRUB enables access to file systems. Users
without root permissions can access files in your Linux system to which they have no
access once the system is booted. To block this kind of access or prevent users from
booting certain operating systems, set a boot password.

IMPORTANT: Boot Password and Splash Screen

If you use a boot password for GRUB, the usual splash screen is not displayed.

396 Installation and Administration


As the user root, proceed as follows to set a boot password:

1 At the root prompt, encrypt the password using grub-md5-crypt:

# grub-md5-crypt
Password: ****
Retype password: ****
Encrypted: $1$lS2dv/$JOYcdxIn7CJk9xShzzJVw/

2 Paste the encrypted string into the global section of the file menu.lst:

gfxmenu (hd0,4)/message
color white/blue black/light-gray
default 0
timeout 8
password --md5 $1$lS2dv/$JOYcdxIn7CJk9xShzzJVw/

Now GRUB commands can only be executed at the boot prompt after pressing
P and entering the password. However, users can still boot all operating systems
from the boot menu.

3 To prevent one or several operating systems from being booted from the boot
menu, add the entry lock to every section in menu.lst that should not be
bootable without entering a password. For example:

title linux
kernel (hd0,4)/vmlinuz root=/dev/hda7 vga=791
initrd (hd0,4)/initrd
lock

After rebooting the system and selecting the Linux entry from the boot menu,
the following error message is displayed:
Error 32: Must be authenticated

Press Enter to enter the menu. Then press P to get a password prompt. After en-
tering the password and pressing Enter, the selected operating system (Linux in
this case) should boot.

The Boot Loader 397


20.3 Configuring the Boot Loader with
YaST
The easiest way to configure the boot loader in your SUSE Linux Enterprise system is
to use the YaST module. In the YaST Control Center, select System > Boot Loader. As
in Figure 20.1, “Boot Loader Settings” (page 398), this shows the current boot loader
configuration of your system and allows you to make changes.

Figure 20.1 Boot Loader Settings

Use the Section Management tab to edit, change, and delete boot loader sections for
the individual operating systems. To add an option, click Add. To change the value of
an existing option, select it with the mouse and click Edit. To remove an existing entry,
select it and click Delete. If you are not familiar with boot loader options, read Sec-
tion 20.2, “Booting with GRUB” (page 388) first.

Use the Boot Loader Installation tab to view and change settings related to type, location,
and advanced loader settings.

398 Installation and Administration


20.3.1 Boot Loader Type
Set the boot loader type in Boot Loader Installation. The default boot loader in SUSE
Linux Enterprise is GRUB. To use LILO, proceed as follows:

Procedure 20.1 Changing the Boot Loader Type

1 Select the Boot Loader Installation tab.

2 For Boot Loader, select LILO.

3 In the dialog box that opens, select one of the following actions:

Propose New Configuration


Have YaST propose a new configuration.

Convert Current Configuration


Have YaST convert the current configuration. When converting the configu-
ration, some settings may be lost.

Start New Configuration from Scratch


Write a custom configuration. This action is not available during the instal-
lation of SUSE Linux Enterprise.

Read Configuration Saved on Disk


Load your own /etc/lilo.conf. This action is not available during the
installation of SUSE Linux Enterprise.

4 Click OK to save the changes

5 Click Finish in the main dialog to apply the changes.

The Boot Loader 399


During the conversion, the old GRUB configuration is saved to disk. To use it, simply
change the boot loader type back to GRUB and choose Restore Configuration Saved
before Conversion. This action is available only on an installed system.

NOTE: Custom Boot Loader

To use a boot loader other than GRUB or LILO, select Do Not Install Any Boot
Loader. Read the documentation of your boot loader carefully before choosing
this option.

20.3.2 Boot Loader Location


To change the location of the boot loader, follow these steps:

Procedure 20.2 Changing the Boot Loader Location

1 Select the Boot Loader Installation tab then select one of the following options
for Boot Loader Location:

Boot from Boot Partition


The boot sector of the /boot partition.

/dev/hda1

Boot from Master Boot Record of


This installs the boot loader in the MBR of the first disk (according to the
boot sequence preset in the BIOS).

Boot from Root Partition


The boot sector of the / partition.

Custom Boot Partition


Use this option to specify the location of the boot loader manually.

2 Click Finish to apply your changes.

400 Installation and Administration


20.3.3 Default System
To change the system that is booted by default, proceed as follows:

Procedure 20.3 Setting the Default System

1 Open the Section Management tab.

2 Select the desired entry from the list.

3 Click Set as Default.

4 Click Finish to activate these changes.

20.3.4 Boot Loader Time-Out


The boot loader does not boot the default system immediately. During the time-out,
you can select the system to boot or write some kernel parameters. To set the boot
loader time-out, proceed as follows:

Procedure 20.4 Changing the Boot Loader Time-Out

1 Open the Boot Loader Installation tab.

2 Click Boot Loader Options.

3 Change the value of Timeout in Seconds by typing in a new value, clicking the
appropriate arrow key with your mouse, or by using the arrow keys on the key-
board.

4 Click OK.

5 Click Finish to save the changes.

The Boot Loader 401


20.3.5 Security Settings
Using this YaST module, you can also set a password to protect booting. This gives
you an additional level of security.

Procedure 20.5 Setting a Boot Loader Password

1 Open the Boot Loader Installation tab.

2 Click Boot Loader Options.

3 Set your password in Password for the Menu Interface.

4 Click OK.

5 Click Finish to save the changes.

20.4 Uninstalling the Linux Boot


Loader
YaST can be used to uninstall the Linux boot loader and restore the MBR to the state
it had prior to the installation of Linux. During the installation, YaST automatically
creates a backup copy of the original MBR and restores it on request.

To uninstall GRUB, start the YaST boot loader module (System > Boot Loader Confi-
guration). In the first dialog, select Reset > Restore MBR of Hard Disk and exit the di-
alog with Finish.

20.5 Creating Boot CDs


If problems occur booting your system using a boot manager or if the boot manager
cannot be installed on the MBR of your hard disk or a floppy disk, it is also possible
to create a bootable CD with all the necessary start-up files for Linux. This requires a
CD writer installed in your system.

402 Installation and Administration


Creating a bootable CD-ROM with GRUB merely requires a special form of stage2
called stage2_eltorito and, optionally, a customized menu.lst. The classic
files stage1 and stage2 are not required.

Procedure 20.6 Creating Boot CDs

1 Change into a directory in which to create the ISO image, for example:

cd /tmp

2 Create a subdirectory for GRUB:


mkdir -p iso/boot/grub

3 Copy the kernel, the files stage2_eltorito, initrd, menu.lst, and


message to iso/boot/:

cp /boot/vmlinuz iso/boot/
cp /boot/initrd iso/boot/
cp /boot/message iso/boot/
cp /usr/lib/grub/stage2_eltorito iso/boot/grub
cp /boot/grub/menu.lst iso/boot/grub

4 Adjust the path entries in iso/boot/grub/menu.lst to make them point


to a CD-ROM device. Do this by replacing the device name of the hard disks,
listed in the format (hd*), in the pathnames with the device name of the CD-
ROM drive, which is (cd):

timeout 8
default 0
gfxmenu (cd)/boot/message

title Linux
root (cd)
kernel /boot/vmlinuz root=/dev/hda5 vga=794 resume=/dev/hda1 \
splash=verbose showopts
initrd /boot/initrd

Use splash=silent instead of splash=verbose to prevent the boot


messages from appearing during the boot procedure.

The Boot Loader 403


5 Create the ISO image with the following command:

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \


-boot-load-size 4 -boot-info-table -o grub.iso /tmp/iso

6 Write the resulting file grub.iso to a CD using your preferred utility. Do not
burn the ISO image as data file, but use the option for burning a CD image in
your burning utility.

20.6 The Graphical SUSE Screen


Since SUSE Linux 7.2, the graphical SUSE screen is displayed on the first console if
the option “vga=<value>” is used as a kernel parameter. If you install using YaST, this
option is automatically activated in accordance with the selected resolution and the
graphics card. There are three ways to disable the SUSE screen, if desired:

Disabling the SUSE Screen When Necessary


Enter the command echo 0 >/proc/splash on the command line to disable
the graphical screen. To activate it again, enter echo 1 >/proc/splash.

Disabling the SUSE screen by default.


Add the kernel parameter splash=0 to your boot loader configuration. Chapter 20,
The Boot Loader (page 387) provides more information about this. However, if you
prefer the text mode, which was the default in earlier versions, set vga=normal.

Completely Disabling the SUSE Screen


Compile a new kernel and disable the option Use splash screen instead of boot logo
in framebuffer support.

TIP

Disabling framebuffer support in the kernel automatically disables the


splash screen as well. SUSE cannot provide any support for your system if
you run it with a custom kernel.

404 Installation and Administration


20.7 Troubleshooting
This section lists some of the problems frequently encountered when booting with
GRUB and a short description of possible solutions. Some of the problems are covered
in articles in the Knowledgebase at http://support.novell.com/. Use the
search dialog to search for keywords like GRUB, boot, and boot loader.

GRUB and XFS


XFS leaves no room for stage1 in the partition boot block. Therefore, do not
specify an XFS partition as the location of the boot loader. This problem can be
solved by creating a separate boot partition that is not formatted with XFS.

GRUB Reports GRUB Geom Error


GRUB checks the geometry of connected hard disks when the system is booted.
Sometimes, the BIOS returns inconsistent information and GRUB reports a GRUB
Geom Error. If this is the case, use LILO or update the BIOS. Detailed information
about the installation, configuration, and maintenance of LILO is available in the
Support Database under the keyword LILO.

GRUB also returns this error message if Linux was installed on an additional hard
disk that is not registered in the BIOS. stage1 of the boot loader is found and
loaded correctly, but stage2 is not found. This problem can be remedied by regis-
tering the new hard disk in the BIOS.

System Containing IDE and SCSI Hard Disks Does Not Boot
During the installation, YaST may have incorrectly determined the boot sequence
of the hard disks. For example, GRUB may regard /dev/hda as hd0 and /dev/
sda as hd1, although the boot sequence in the BIOS is reversed (SCSI before
IDE).

In this case, correct the hard disks during the boot process with the help of the
GRUB command line. After the system has booted, edit device.map to apply
the new mapping permanently. Then check the GRUB device names in the files
/boot/grub/menu.lst and /boot/grub/device.map and reinstall the
boot loader with the following command:
grub --batch < /etc/grub.conf

The Boot Loader 405


Booting Windows from the Second Hard Disk
Some operating systems, such as Windows, can only boot from the first hard disk.
If such an operating system is installed on a hard disk other than the first hard disk,
you can effect a logical change for the respective menu entry.

...
title windows
map (hd0) (hd1)
map (hd1) (hd0)
chainloader(hd1,0)+1
...

In this example, Windows is started from the second hard disk. For this purpose,
the logical order of the hard disks is changed with map. This change does not affect
the logic within the GRUB menu file. Therefore, the second hard disk must be
specified for chainloader.

20.8 For More Information


Extensive information about GRUB is available at http://www.gnu.org/
software/grub/. Also refer to the grub info page. You can also search for the
keyword “GRUB” in the Technical Information Search at http://www.novell
.com/support to get information about special issues.

406 Installation and Administration


Special System Features
This chapter starts with information about various software packages, the virtual con-
21
soles, and the keyboard layout. We talk about software components like bash, cron,
and logrotate, because they were changed or enhanced during the last release cycles.
Even if they are small or considered of minor importance, users may want to change
their default behavior, because these components are often closely coupled with the
system. The chapter is finished by a section about language and country-specific settings
(I18N and L10N).

21.1 Information about Special


Software Packages
The programs bash, cron, logrotate, locate, ulimit, and free, and the file
resolv.conf are very important for system administrators and many users. Man
pages and info pages are two useful sources of information about commands, but both
are not always available. GNU Emacs is a popular and very configurable text editor.

21.1.1 The bash Package and /etc/profile


Bash is the default system shell. When used as a login shell, it reads several initialization
files. Bash processes them in the order they appear in this list:

1. /etc/profile

Special System Features 407


2. ~/.profile

3. /etc/bash.bashrc

4. ~/.bashrc

Make custom settings in ~/.profile or ~/.bashrc. To ensure the correct process-


ing of these files, it is necessary to copy the basic settings from /etc/skel/
.profile or /etc/skel/.bashrc into the home directory of the user. It is rec-
ommended to copy the settings from /etc/skel following an update. Execute the
following shell commands to prevent the loss of personal adjustments:

mv ~/.bashrc ~/.bashrc.old
cp /etc/skel/.bashrc ~/.bashrc
mv ~/.profile ~/.profile.old
cp /etc/skel/.profile ~/.profile

Then copy personal adjustments back from the *.old files.

21.1.2 The cron Package


If you want to run commands regularly and automatically in the background at predefined
times, cron is the traditional tool to use. cron is driven by specially formatted time tables.
Some of of them come with the system and users can write their own tables if needed.

The cron tables are located in /var/spool/cron/tabs. /etc/crontab serves


as a systemwide cron table. Enter the username to run the command directly after the
time table and before the command. In Example 21.1, “Entry in /etc/crontab” (page 408),
root is entered. Package-specific tables, located in /etc/cron.d, have the same
format. See the cron man page (man cron).

Example 21.1 Entry in /etc/crontab

1-59/5 * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun

You cannot edit /etc/crontab by calling the command crontab -e. This file
must be loaded directly into an editor, modified, then saved.

A number of packages install shell scripts to the directories /etc/cron.hourly,


/etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly, whose

408 Installation and Administration


execution is controlled by /usr/lib/cron/run-crons. /usr/lib/cron/
run-crons is run every 15 minutes from the main table (/etc/crontab). This
guarantees that processes that may have been neglected can be run at the proper time.

To run the hourly, daily, or other periodic maintenance scripts at custom times,
remove the time stamp files regularly using /etc/crontab entries (see Example 21.2,
“/etc/crontab: Remove Time Stamp Files” (page 409), which removes the hourly one
before every full hour, the daily one once a day at 2:14 a.m., etc.).

Example 21.2 /etc/crontab: Remove Time Stamp Files

59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
14 2 * * * root rm -f /var/spool/cron/lastrun/cron.daily
29 2 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
44 2 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly

The daily system maintenance jobs have been distributed to various scripts for reasons
of clarity. They are contained in the package aaa_base. /etc/cron.daily con-
tains, for example, the components suse.de-backup-rpmdb, suse
.de-clean-tmp, or suse.de-cron-local.

21.1.3 Log Files: Package logrotate


There are a number of system services (daemons) that, along with the kernel itself,
regularly record the system status and specific events to log files. This way, the admin-
istrator can regularly check the status of the system at a certain point in time, recognize
errors or faulty functions, and troubleshoot them with pinpoint precision. These log
files are normally stored in /var/log as specified by FHS and grow on a daily basis.
The logrotate package helps control the growth of these files.

Configure logrotate with the file /etc/logrotate.conf. In particular, the


include specification primarily configures the additional files to read. Programs that
produce log files install individual configuration files in /etc/logrotate.d. For
example, such files ship with the packages, e.g. apache2 (/etc/logrotate.d/
apache2) and syslogd (/etc/logrotate.d/syslog).

Special System Features 409


Example 21.3 Example for /etc/logrotate.conf

# see "man logrotate" for details


# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs


rotate 4

# create new (empty) log files after rotating old ones


create

# uncomment this if you want your log files compressed


#compress

# RPM packages drop log rotation information into this directory


include /etc/logrotate.d

# no packages own lastlog or wtmp - we'll rotate them here


#/var/log/wtmp {
# monthly
# create 0664 root utmp
# rotate 1
#}

# system-specific logs may be also be configured here.

logrotate is controlled through cron and is called daily by /etc/cron.daily/


logrotate.

IMPORTANT

The create option reads all settings made by the administrator in /etc/
permissions*. Ensure that no conflicts arise from any personal modifications.

21.1.4 The locate Command


locate, a command for quickly finding files, is not included in the standard scope of
installed software. If desired, install the package find-locate. The updatedb process
is started automatically every night or about 15 minutes after booting the system.

410 Installation and Administration


21.1.5 The ulimit Command
With the ulimit (user limits) command, it is possible to set limits for the use of system
resources and to have these displayed. ulimit is especially useful for limiting the
memory available for applications. With this, an application can be prevented from
using too much memory on its own, which could bring the system to a standstill.

ulimit can be used with various options. To limit memory usage, use the options
listed in Table 21.1, “ulimit: Setting Resources for the User” (page 411).

Table 21.1 ulimit: Setting Resources for the User

-m Maximum size of physical memory

-v Maximum size of virtual memory

-s Maximum size of the stack

-c Maximum size of the core files

-a Display of limits set

Systemwide entries can be made in /etc/profile. There, enable creation of core


files, needed by programmers for debugging. A normal user cannot increase the values
specified in /etc/profile by the system administrator, but can make special entries
in ~/.bashrc.

Example 21.4 ulimit: Settings in ~/.bashrc

# Limits of physical memory:


ulimit -m 98304

# Limits of virtual memory:


ulimit -v 98304

Memory amounts must be specified in KB. For more detailed information, see man
bash.

Special System Features 411


IMPORTANT

Not all shells support ulimit directives. PAM (for instance, pam_limits)
offers comprehensive adjustment possibilities if you depend on encompassing
settings for these restrictions.

21.1.6 The free Command


The free command is somewhat misleading if your goal is to find out how much
RAM is currently being used. That information can be found in /proc/meminfo.
These days, users with access to a modern operating system, such as Linux, should not
really need to worry much about memory. The concept of available RAM dates back
to before the days of unified memory management. The slogan free memory is bad
memory applies well to Linux. As a result, Linux has always made the effort to balance
out caches without actually allowing free or unused memory.

Basically, the kernel does not have direct knowledge of any applications or user data.
Instead, it manages applications and user data in a page cache. If memory runs short,
parts of it are written to the swap partition or to files, from which they can initially be
read with the help of the mmap command (see man mmap).

The kernel also contains other caches, such as the slab cache, where the caches used
for network access are stored. This may explain differences between the counters in
/proc/meminfo. Most, but not all of them, can be accessed via /proc/slabinfo.

21.1.7 The /etc/resolv.conf File


Domain name resolution is handled through the file /etc/resolv.conf. Refer to
Chapter 33, The Domain Name System (page 609).

This file is updated by the script /sbin/modify_resolvconf exclusively, with


no other program having permission to modify /etc/resolv.conf directly. Enforc-
ing this rule is the only way to guarantee that the system's network configuration and
the relevant files are kept in a consistent state.

412 Installation and Administration


21.1.8 Man Pages and Info Pages
For some GNU applications (such as tar), the man pages are no longer maintained. For
these commands, use the --help option to get a quick overview of the info pages,
which provide more in-depth instructions. info is GNU's hypertext system. Read an
introduction to this system by entering info info. Info pages can be viewed with
Emacs by entering emacs -f info or directly in a console with info. You can
also use tkinfo, xinfo, or the help system to view info pages.

21.1.9 Settings for GNU Emacs


GNU Emacs is a complex work environment. The following sections cover the confi-
guration files processed when GNU Emacs is started. More information is available at
http://www.gnu.org/software/emacs/.

On start-up, Emacs reads several files containing the settings of the user, system admin-
istrator, and distributor for customization or preconfiguration. The initialization file ~/
.emacs is installed to the home directories of the individual users from /etc/skel.
.emacs, in turn, reads the file /etc/skel/.gnu-emacs. To customize the program,
copy .gnu-emacs to the home directory (with cp /etc/skel/.gnu-emacs
~/.gnu-emacs) and make the desired settings there.

.gnu-emacs defines the file ~/.gnu-emacs-custom as custom-file. If users


make settings with the customize options in Emacs, the settings are saved to ~/
.gnu-emacs-custom.

With SUSE® Linux Enterprise, the emacs package installs the file site-start.el
in the directory /usr/share/emacs/site-lisp. The file site-start.el is
loaded before the initialization file ~/.emacs. Among other things, site-start
.el ensures that special configuration files distributed with Emacs add-on packages,
such as psgml, are loaded automatically. Configuration files of this type are located
in /usr/share/emacs/site-lisp, too, and always begin with suse-start-.
The local system administrator can specify systemwide settings in default.el.

More information about these files is available in the Emacs info file under Init File:
info:/emacs/InitFile. Information about how to disable loading these files (if
necessary) is also provided at this location.

Special System Features 413


The components of Emacs are divided into several packages:

• The base package emacs.

• emacs-x11 (usually installed): the program with X11 support.

• emacs-nox: the program without X11 support.

• emacs-info: online documentation in info format.

• emacs-el: the uncompiled library files in Emacs Lisp. These are not required at
runtime.

• Numerous add-on packages can be installed if needed: emacs-auctex (for La-


TeX), psgml (for SGML and XML), gnuserv (for client and server operation),
and others.

21.2 Virtual Consoles


Linux is a multiuser and multitasking system. The advantages of these features can be
appreciated even on a stand-alone PC system. In text mode, there are six virtual consoles
available. Switch between them using Alt + F1 to Alt + F6. The seventh console is re-
served for X and the tenth console shows kernel messages. More or fewer consoles can
be assigned by modifying the file /etc/inittab.

To switch to a console from X without shutting it down, use Ctrl + Alt + F1 to Ctrl +
Alt + F6. To return to X, press Alt + F7.

21.3 Keyboard Mapping


To standardize the keyboard mapping of programs, changes were made to the following
files:

/etc/inputrc
/etc/X11/Xmodmap
/etc/skel/.Xmodmap
/etc/skel/.exrc
/etc/skel/.less
/etc/skel/.lesskey

414 Installation and Administration


/etc/csh.cshrc
/etc/termcap
/usr/lib/terminfo/x/xterm
/usr/share/X11/app-defaults/XTerm
/usr/share/emacs/VERSION/site-lisp/term/*.el

These changes only affect applications that use terminfo entries or whose configu-
ration files are changed directly (vi, less, etc.). Applications not shipped with the
system should be adapted to these defaults.

Under X, the compose key (multikey) can be accessed using Ctrl + Shift (right). Also
see the corresponding entry in /etc/X11/Xmodmap.

Further settings are possible using the X Keyboard Extension (XKB). This extension
is also used by the desktop environments GNOME (gswitchit) and KDE (kxkb).

TIP: For More Information

Information about XKB is available in /etc/X11/xkb/README and the doc-


uments listed there.

Detailed information about the input of Chinese, Japanese, and Korean (CJK)
is available at Mike Fabian's page: http://www.suse.de/~mfabian/
suse-cjk/input.html.

21.4 Language and Country-Specific


Settings
The system is, to a very large extent, internationalized and can be modified for local
needs in a flexible manner. In other words, internationalization (I18N) allows specific
localizations (L10N). The abbreviations I18N and L10N are derived from the first and
last letters of the words and, in between, the number of letters omitted.

Settings are made with LC_ variables defined in the file /etc/sysconfig/
language. This refers not only to native language support, but also to the categories
Messages (Language), Character Set, Sort Order, Time and Date, Numbers, and Money.
Each of these categories can be defined directly with its own variable or indirectly with
a master variable in the file language (see the locale man page).

Special System Features 415


RC_LC_MESSAGES, RC_LC_CTYPE, RC_LC_COLLATE, RC_LC_TIME,
RC_LC_NUMERIC, RC_LC_MONETARY
These variables are passed to the shell without the RC_ prefix and represent the
listed categories. The shell profiles concerned are listed below. The current setting
can be shown with the command locale.

RC_LC_ALL
This variable, if set, overwrites the values of the variables already mentioned.

RC_LANG
If none of the previous variables are set, this is the fallback. By default, only
RC_LANG is set. This makes it easier for users to enter their own values.

ROOT_USES_LANG
A yes or no variable. If it is set to no, root always works in the POSIX environ-
ment.

The variables can be set with the YaST sysconfig editor (see Section 19.3.1, “Changing
the System Configuration Using the YaST sysconfig Editor” (page 384)). The value of
such a variable contains the language code, country code, encoding, and modifier. The
individual components are connected by special characters:

LANG=<language>[[_<COUNTRY>].<Encoding>[@<Modifier>]]

21.4.1 Some Examples


You should always set the language and country codes together. Language settings
follow the standard ISO 639 available at http://www.evertype.com/
standards/iso639/iso639-en.html and http://www.loc.gov/
standards/iso639-2/. Country codes are listed in ISO 3166 available at http://
www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1
.html.

It only makes sense to set values for which usable description files can be found in
/usr/lib/locale. Additional description files can be created from the files in
/usr/share/i18n using the command localedef. The description files are part
of the glibc-i18ndata package. A description file for en_US.UTF-8 (for English
and United States) can be created with:

416 Installation and Administration


localedef -i en_US -f UTF-8 en_US.UTF-8

LANG=en_US.UTF-8
This is the default setting if American English is selected during installation. If you
selected another language, that language is enabled but still with UTF-8 as the
character encoding.

LANG=en_US.ISO-8859-1
This sets the language to English, country to United States, and the character set
to ISO-8859-1. This character set does not support the Euro sign, but it can be
useful sometimes for programs that have not been updated to support UTF-8. The
string defining the charset (ISO-8859-1 in this case) is then evaluated by pro-
grams like Emacs.

LANG=en_IE@euro
The above example explicitly includes the Euro sign in a language setting. Strictly
speaking, this setting is obsolete now, because UTF-8 also covers the Euro symbol.
It is only useful if an application does not support UTF-8, but ISO-8859-15.

SuSEconfig reads the variables in /etc/sysconfig/language and writes the


necessary changes to /etc/SuSEconfig/profile and /etc/SuSEconfig/
csh.cshrc. /etc/SuSEconfig/profile is read or sourced by /etc/
profile. /etc/SuSEconfig/csh.cshrc is sourced by /etc/csh.cshrc.
This makes the settings available systemwide.

Users can override the system defaults by editing their ~/.bashrc accordingly. For
instance, if you do not want to use the systemwide en_US for program messages, include
LC_MESSAGES=es_ES so messages are displayed in Spanish instead.

21.4.2 Locale Settings in ~/.i18n


If you are not satisfied with locale system defaults, change the settings in ~/.i18n.
Entries in ~/.i18n override system defaults from /etc/sysconfig/language.
Use the same variable names but without the RC_ namespace prefixes, for example,
use LANG instead of RC_LANG.

Special System Features 417


21.4.3 Settings for Language Support
Files in the category Messages are, as a rule, only stored in the corresponding language
directory (like en) to have a fallback. If you set LANG to en_US and the message file
in /usr/share/locale/en_US/LC_MESSAGES does not exist, it falls back to
/usr/share/locale/en/LC_MESSAGES.

A fallback chain can also be defined, for example, for Breton to French or for Galician
to Spanish to Portuguese:

LANGUAGE="br_FR:fr_FR"

LANGUAGE="gl_ES:es_ES:pt_PT"

If desired, use the Norwegian variants Nynorsk and Bokmål instead (with additional
fallback to no):

LANG="nn_NO"

LANGUAGE="nn_NO:nb_NO:no"

or

LANG="nb_NO"

LANGUAGE="nb_NO:nn_NO:no"

Note that in Norwegian, LC_TIME is also treated differently.

One problem that can arise is a separator used to delimit groups of digits not being
recognized properly. This occurs if LANG is set to only a two-letter language code like
de, but the definition file glibc uses is located in /usr/share/lib/de_DE/LC
_NUMERIC. Thus LC_NUMERIC must be set to de_DE to make the separator definition
visible to the system.

21.4.4 For More Information


• The GNU C Library Reference Manual, Chapter “Locales and Internationalization”.
It is included in glibc-info.

418 Installation and Administration


• Markus Kuhn, UTF-8 and Unicode FAQ for Unix/Linux, currently at http://
www.cl.cam.ac.uk/~mgk25/unicode.html.

• Unicode-Howto, by Bruno Haible: /usr/share/doc/howto/en/html/


Unicode-HOWTO.html.

Special System Features 419


Virtualization
The Novell® virtualization strategy is based on combining the SUSE® Linux operating
22
system with Xen* hypervisor software to create a virtualization host server platform
capable of hosting virtual machines.

• Section 22.1, “System and Software Requirements” (page 422)

• Section 22.2, “Virtualization Infrastructure” (page 425)

• Section 22.3, “Installing Virtualization Software ” (page 426)

• Section 22.4, “Starting the Virtualization Host Server” (page 427)

• Section 22.5, “Managing Virtual Machines” (page 428)

• Section 22.6, “Creating Virtual Machines ” (page 431)

• Section 22.7, “Windows Server 2003 Virtual Machines” (page 432)

• Section 22.8, “For More Information” (page 433)

Virtualization 421
22.1 System and Software
Requirements
The following sections list the system and software requirements for running virtualiza-
tion. Remember that virtual machines, just like physical machines, perform better when
they run on faster processors and have access to more system memory.

• Section 22.1.1, “Virtualization Host Server System Requirements” (page 422)

• Section 22.1.2, “Virtualization Host Server Software Requirements” (page 423)

• Section 22.1.3, “Virtual Machine Operating System Requirements” (page 423)

22.1.1 Virtualization Host Server System


Requirements
In most cases, the minimum requirements for the virtualization host server are the same
as those for the SUSE Linux operating system, but additional CPU, disk, memory, and
network requirements should be added to accomodate the resource demands of planned
virtual machines.

• Although the SUSE Linux operating system can run on many platforms, the virtu-
alization host server is only available on x86 32-bit and x86 64-bit platforms.

• Full virtualization mode is available on processors that support hardware-assisted


virtualization technology. Look for processors that support Intel* VT or AMD*
Virtualization.

For information on Intel VT, see Intel Virtualization Technology [http://www


.intel.com/technology/virtualization].

For information on AMD Virtualization, see the AMD Web Site [http://www
.amd.com].

422 Installation and Administration


22.1.2 Virtualization Host Server Software
Requirements
Virtualization packages are available in SUSE Linux operating system products based
on code path 10 and later. Code path 10 includes SUSE Linux Enterprise Server 10,
SUSE Linux Enterprise Desktop 10, and OpenSUSE® 10.1.

The virtualization host server requires the following software packages and their depen-
dencies to be installed:

• kernel-xen

• xen

• xen-tools

• xen-tools-ioemu (required for full-virtualization mode)

• kernel-xenpae (used instead of kernel-xen, this package is required to enable a 32-


bit virtualization host server to access memory over 3 GB)

• yast2-vm (You should install the newest version available)

Updates are available through your update channel. Make sure to update to the most
recent packages available.

22.1.3 Virtual Machine Operating System


Requirements
Most popular operating systems can run without modification on virtual machines using
full virtualization mode.

Table 22.1 Popular Operating Systems Tested to Run in Full Virtualization Mode

Operating System x86 32- x86 64-


bit bit

SUSE Linux Enterprise Server 10, SUSE Linux Enterprise 9 X X

Virtualization 423
Operating System x86 32- x86 64-
bit bit

Open Enterprise Server 2 - Linux X X

Windows* Server 2003 R2 X X

Windows XP X X

Windows 2000 Server X

Windows Vista* X X

Red Hat* Enterprise Linux 4 X X

Paravirtual mode is available for operating systems that are modified to recognize the
Xen virtualization environment.

Table 22.2 Modified Operating Systems Tested to Run in Paravirtual Mode

Operating System x86 32- x86 64-


bit bit

SUSE Linux Enterprise Server 10 SP1 X X

SUSE Linux Enterprise Desktop 10 SP1 X X

Open Enterprise Server 2 - NetWare X

Open Enterprise Server 2 - Linux X X

RedHat Enterprise Linux 5 X X

For more information on specific guest operating systems, see the Guest Operating
System Guide at Novell Virtualization Technology [http://www.novell.com/
documentation/vmserver/].

424 Installation and Administration


22.2 Virtualization Infrastructure
The basic components of virtualization are a virtualization host server and virtual ma-
chines.

• The virtualization host server provides a virtualization platform (Xen Hypervisor)


and a management environment (SUSE Linux desktop) to host virtual machines.

• Virtual machines are instances of virtual hardware that operating systems recognize
as a physical computer. A virtual machine can run an operating system in full vir-
tualization mode or paravirtual mode.

• Full virtualization mode lets virtual machines run unmodified operating systems,
such as Windows Server 2003, but requires the computer running the virtualization
host server to support hardware-assisted virtualization technology.

• Paravirtual mode does not require a computer that supports hardware-assisted


virtualization technology but requires the operating system emulates only key
aspects of the computer but requires that the operating system be modified for
the virtualization environment. Operating systems currently modified to run in
paravirtual mode include SUSE Linux Enterprise Server 10 and Open Enterprise
Server 2 NetWare.

Virtualization 425
Figure 22.1 Virtualization Architecture

22.3 Installing Virtualization Software


You can set up a computer to be a virtualization host server during the installation of
the SUSE Linux operating system or added to a computer already running SUSE Linux.

NOTE

Only applications and processes required for virtualization should be installed


on the virtualization host server.

Virtualization software can be installed by using one of the following options:

• During the initial installation, change the Software category so it includes the Xen
Virtual Machine Host Server selection. Complete the installation and restart the
computer.

426 Installation and Administration


• On a computer already running SUSE Linux, run YaST > Virtualization > Install
Hypervisor and Tools. Complete the on-screen instructions and restart the computer.

• On a computer already running SUSE Linux, enter yast2 xen from a command
line interface. Complete the on-screen instructions and restart the computer.

• Copy the virtualization packages to the virtualization host server desktop and run
the rpm -U package_name command. Restart the computer.

NOTE

If you use the rpm command, you can safely ignore any messages stating
“ Cannot determine dependencies of module edd.” The message
might be repeated two or three times during installation.

22.4 Starting the Virtualization Host


Server
If virtualization software is correctly installed, the computer boots to display the GRUB
boot loader with a Xen option on the menu. Select this option to start the virtualization
host server.

Virtualization 427
If the GRUB boot loader does not display or the Xen option is not on the menu, review
the steps for installation and verify that the GRUB boot loader has been updated.

22.5 Managing Virtual Machines


Virtual machines can be created and managed by using the Virtual Machine Manager.

1 On the virtualization host server, click YaST > Virtualization > Virtual Machine
Manager.

The Virtual Machine Manager page displays the virtualization host server (Do-
main-0) and all virtual machines.

428 Installation and Administration


2 From the Virtual Machine Manager page, you can perform the following actions:

• New starts the process to create a new virtual machine.

• Details displays status and hardware of the selected virtual machine or Do-
main-0

• Open displays the command console for the selected virtual machine.

• Delete completely removes the selected virtual machine.

• Start a virtual machine by selecting it from the list, click Open, and then click
Run.

Virtual Machine Manager is recommended for managing virtual machines, but you can
also perform actions by entering commands on the command line.

Table 22.3 xm Commands

Command Action

xm help View a list of actions available for the xm


command.

Virtualization 429
Command Action

xm list View a list of all registered and running


virtual machines.

xm new /etc/xen/vm/vm_name Create and register a new virtual machine


based on settings in a configuration file.

This command does not create a configu-


ration file or virtual disk.

xm start vm_name Start a virtual machine.

xm delete vm_name Delete a virtual machine.

This command does not delete the confi-


guration file or virtual disk.

xm console vm_name View the text console of an already-run-


ning virtual machine.

xm mem-set vm_name MB_Memory Change the memory available to a virtual


machine.

xm shutdown vm_name Perform a normal shutdown of the virtual


machine’s operating system.

xm destroy vm_name Immediately terminate a running virtual


machine.

xm create /etc/xen/vm/ (Deprecated) Start a virtual machine using


vm_name settings defined in its configuration file.

This command overwrites virtual machine


settings with configuration file settings.
Instead, use xm new to create and regis-
ter the virtual machine, and then use xm
start to start it.

430 Installation and Administration


22.6 Creating Virtual Machines
The Create Virtual Machine Wizard helps you through the steps required to create a
virtual machine and install its operating system.

1 Launch the Create Virtual Machine Wizard by using one of the following methods:

• From the virtualization host server desktop, click YaST > Virtualization >
Create Virtual Machine

• From within Virtual Machine Manager, click New.

• From the command line, enter vm-install.

If the wizard does not appear or the vm-install command does not work,
review the process of installing and starting the virtualization host server. The
virtualization software might not be installed properly.

2 Choose between installing an operating system or using a disk or disk image that
already has an installed operating system.

The option to set up a virtual machine based on an existing disk or disk image
is only supported if the existing disk or disk image was originally set up through
the Create Virtual Machine Wizard.

3 Select the type of operating system.

4 Change the settings on the Summary screen to meet your configuration require-
ments.

TIP

To access an installation source on CD/DVD/ISO, you must add the


CD/DVD device or ISO file as a virtual disk (using the CD-ROM button)
in the Disks section. Then, specify the newly-added virtual disk as the
Installation Source in the Operating System Installation section.

5 Click OK to start the virtual machine and launch the operating system installation
program.

Virtualization 431
6 Follow the on-screen instructions to complete the installation program.

The virtual machine should now appear in the Virtual Machine Manager.

22.7 Windows Server 2003 Virtual


Machines
Setting up a virtual machine to run Windows Server 2003 is no different than setting
up any other unmodified operating system.

Here are a few items to remember:

• Unmodified operating systems, such as Windows Server 2003, must run in full
virtualization mode, which requires the computer running the virtualization host
server to support hardware-assisted virtualization.

• The most recent version of the operating system should be installed on the virtual
machine.

• The minimum amount of RAM must be enough to run the host operating system
and the operating system of each virtual machine you plan to run simultaneously.

For example, simultaneously running four Windows Server 2003 R2 Standard


Edition virtual machines on a SUSE Linux Enteprise Server 10 virtualization host
server requires 1024 MB of total system memory (4 x 128 MB for each virtual
machine plus 512 MB for the virtualization host server).

This example uses theoretical minimums. For real-world configurations, system


memory should be increased to at least the recommended amount for each virtual
machine.

For more information on minimum, recommended, and maximum amounts of


memory required for operating systems, consult the vendor’s published information.

• The virtual machine should be set up using the Create Virtual Machine Wizard,
which is available by running YaST > Virtualization > Virtual Machine Manager
> New.

432 Installation and Administration


• An x86 64-bit computer can host virtual machines running both 32-bit and 64-bit
operating systems.

• The option to set up a virtual machine based on an existing disk or disk image is
only supported if the existing disk or disk image was originally set up through the
Create Virtual Machine Wizard.

• The operating system installation source can be launched from CD/DVD or from
ISO image files.

• Virtual disks can be based on a file, partition, volume, or other type of block device.

• Virtual machines are managed using the Virtual Machine Manager, which is
available by running YaST > Virtualization > Virtual Machine Manager.

22.8 For More Information


For more information about virtualization technology and specific operating systems
running on virtual machines, see Novell Virtualization Technology [http://www
.novell.com/documentation/vmserver/].

Virtualization 433
Printer Operation
SUSE Linux Enterprise® supports printing with many types of printers, including remote
23
network printers. Printers can be configured with YaST or manually. Both graphical
and command line utilities are available for starting and managing print jobs. If your
printer does not work as expected, refer to Section 23.9, “Troubleshooting” (page 452).

CUPS is the standard print system in SUSE Linux Enterprise. CUPS is highly user-
oriented. In many cases, it is compatible with LPRng or can be adapted with relatively
little effort. LPRng is included in SUSE Linux Enterprise only for reasons of compati-
bility.

Printers can be distinguished by interface, such as USB or network, and printer language.
When buying a printer, make sure that the printer has an interface (like USB or parallel
port) that is available on your hardware and a suitable printer language. Printers can be
categorized on the basis of the following three classes of printer languages:

PostScript Printers
PostScript is the printer language in which most print jobs in Linux and Unix are
generated and processed by the internal print system. This language is already quite
old and very efficient. If PostScript documents can be processed directly by the
printer and do not need to be converted in additional stages in the print system, the
number of potential error sources is reduced. Because PostScript printers are subject
to substantial license costs, these printers usually cost more than printers without
a PostScript interpreter.

Standard Printer (Languages Like PCL and ESC/P)


Although these printer languages are quite old, they are still undergoing expansion
to address new features in printers. In the case of known printer languages, the

Printer Operation 435


print system can convert PostScript jobs to the respective printer language with the
help of Ghostscript. This processing stage is referred to as interpreting. The best-
known languages are PCL, which is mostly used by HP printers and their clones,
and ESC/P, which is used by Epson printers. These printer languages are usually
supported by Linux and produce a decent print result. Linux may not be able to
address some functions of extremely new and fancy printers, because the open
source developers may still be working on these features. Except for HP developing
hpijs drivers, there are currently no printer manufacturers who develop Linux
drivers and make them available to Linux distributors under an open source license.
Most of these printers are in the medium price range.

Proprietary Printers (Also Called GDI Printers)


These printers do not support any of the common printer languages. They use their
own undocumented printer languages, which are subject to change when a new
edition of a model is released. Usually only Windows drivers are available for these
printers. See Section 23.9.1, “Printers without Standard Printer Language Support”
(page 452) for more information.

Before you buy a new printer, refer to the following sources to check how well the
printer you intend to buy is supported:

http://www.linuxprinting.org/
The LinuxPrinting.org printer database.

http://www.cs.wisc.edu/~ghost/
The Ghostscript Web page.

/usr/share/doc/packages/ghostscript/catalog.devices
List of included drivers.

The online databases always show the latest Linux support status. However, a Linux
distribution can only integrate the drivers available at production time. Accordingly, a
printer currently rated as “perfectly supported” may not have had this status when the
latest SUSE Linux Enterprise version was released. Thus, the databases may not neces-
sarily indicate the correct status, but only provide an approximation.

436 Installation and Administration


23.1 The Workflow of the Printing
System
The user creates a print job. The print job consists of the data to print plus information
for the spooler, such as the name of the printer or the name of the printer queue, and,
optionally, information for the filter, such as printer-specific options.

At least one dedicated printer queue exists for every printer. The spooler holds the print
job in the queue until the desired printer is ready to receive data. When the printer is
ready, the spooler sends the data through the filter and back-end to the printer.

The filter converts the data generated by the application that is printing (usually
PostScript or PDF, but also ASCII, JPEG, etc.) into printer-specific data (PostScript,
PCL, ESC/P, etc.). The features of the printer are described in the PPD files. A PPD
file contains printer-specific options with the parameters needed to enable them on the
printer. The filter system makes sure that options selected by the user are enabled.

If you use a PostScript printer, the filter system converts the data into printer-specific
PostScript. This does not require a printer driver. If you use a non-PostScript printer,
the filter system converts the data into printer-specific data using Ghostscript. This re-
quires a Ghostscript printer driver suitable for your printer. The back-end receives the
printer-specific data from the filter then passes it to the printer.

23.2 Methods and Protocols for


Connecting Printers
There are various possibilities for connecting a printer to the system. The configuration
of the CUPS print system does not distinguish between a local printer and a printer
connected to the system over the network. In Linux, local printers must be connected
as described in the manual of the printer manufacturer. CUPS supports serial, USB,
parallel, and SCSI connections. For more information about the printer connection,
read the article CUPS in a Nutshell in the Support Database at http://en.opensuse
.org/SDB:CUPS_in_a_Nutshell.

Printer Operation 437


►zseries: Printers and similar devices provided by the z/VM that you can connect
locally with the IBM System z mainframes are not supported by CUPS or LPRng. On
these platforms, printing is only possible over the network. The cabling for network
printers must be installed according to the instructions of the printer manufacturer. ◄

WARNING: Changing Cable Connections in a Running System

When connecting the printer to the machine, do not forget that only USB de-
vices can be plugged in or unplugged during operation. To avoid damaging
your system or printer, shut down the system before changing any connections
that are not USB.

23.3 Installing the Software


PPD (PostScript printer description) is the computer language that describes the prop-
erties, like resolution, and options, such as the availability of a duplex unit. These de-
scriptions are required for using various printer options in CUPS. Without a PPD file,
the print data would be forwarded to the printer in a “raw” state, which is usually not
desired. During the installation of SUSE Linux Enterprise, many PPD files are prein-
stalled to enable even printers without PostScript support to be used.

To configure a PostScript printer, the best approach is to get a suitable PPD file. Many
PPD files are available in the package manufacturer-PPDs, which is automatically
installed within the scope of the standard installation. See Section 23.8.3, “PPD Files
in Various Packages” (page 450) and Section 23.9.2, “No Suitable PPD File Available
for a PostScript Printer” (page 453).

New PPD files can be stored in the directory /usr/share/cups/model/ or added


to the print system with YaST (as described in Section “Adding PPD Files with YaST”
(page 442)). Subsequently, the PPD file can be selected during the installation.

Be careful if a printer manufacturer wants you to install entire software packages in


addition to modifying configuration files. First, this kind of installation would result in
the loss of the support provided by SUSE Linux Enterprise and, second, print commands
may work differently and the system may no longer be able to address devices of other
manufacturers. For this reason, the installation of manufacturer software is not recom-
mended.

438 Installation and Administration


23.4 Setting Up a Printer
YaST can be used to configure a local printer that is directly connected to your machine
(normally with USB or parallel port) or to set up printing over the network. It is also
possible to add PPD (PostScript Printer Description) files for your printer with YaST.

23.4.1 Configuring Local Printers


If an unconfigured local printer is detected, YaST starts automatically to configure it.
YaST can configure the printer automatically if the parallel or USB port can be set up
automatically and the connected printer can be detected. The printer model must also
be listed in the database used during the automatic hardware detection.

If the printer model is unknown or cannot be automatically detected, configure it man-


ually. There are two possible reasons why a printer is not automatically detected:

• The printer does not identify itself correctly. This may apply to very old devices.
Try to configure your printer as described in Section “Configuring Manually”
(page 439).

• If the manual configuration does not work, communication between printer and
computer is not possible. Check the cable and the plugs to make sure that the
printer is properly connected. If this is the case, the problem may not be printer-
related, but rather a USB or parallel port–related problem.

Configuring Manually
To manually configure the printer, select Hardware > Printer in the YaST control
center. This opens the main Printer Configuration window, where the detected devices
are listed in the upper part. The lower part lists any queues configured so far (refer to
Section 23.1, “The Workflow of the Printing System” (page 437) for more information
about print queues). If no printer was detected, both parts of the configuration window
are empty. Use Edit to change the configuration of a listed printer or Add to set up a
printer not automatically detected. Editing an existing configuration uses the same di-
alogs as in Adding a Local Printer Manually (page 440).

In Printer Configuration, you can also Delete an existing entry. Clicking Other opens
a list with advanced options. By restarting the detection, manually start the automatic

Printer Operation 439


printer detection. If more than one printer is connected to the machine or more than
one queue is configured for a printer, you can mark the active entry as the default. CUPS
Expert Settings and Change IPP Listen are advanced configuration options— refer to
Chapter 23, Printer Operation (page 435) for details.

Procedure 23.1 Adding a Local Printer Manually

TIP: YaST Print Test

To make sure that everything works correctly, the crucial configuration steps
can be checked with the print test function of YaST. The test page also pro-
vides important information about the configuration tested. If the output is
garbled, for example, with several pages almost empty, you can stop the
printer by first removing all paper then stopping the test from YaST.

1 Start YaST and choose Hardware > Printer to open the Printer Configuration
dialog.

2 Click Add to open the Printer Type window.

3 Choose Directly Connected Printers.

4 Select the port to which the printer is connected (usually USB or parallel port)
and choose the device in the next configuration screen. It is recommended to
Test the Printer Connection at this point. If problems occur, select the correct
device or choose Back to return to the previous dialog.

5 In Queue Name, set up a print queue. Specifying a Name for Printing is manda-
tory. It is recommended to choose a recognizable name—with this name, you
can later identify the printer in the printing dialogs of applications. Use Printer
Description and Printer Location to further describe the printer. This is optional,
but useful if you have more than one printer connected to the machine or if you
set up a print server. Do Local Filtering should be checked—it is needed for local
printers.

6 In Printer Model, specify the printer by Manufacturer and Model. If your printer
is not listed, you can try UNKNOWN MANUFACTURER from the manufacturer
list and select an appropriate standard language (the set of commands controlling
the printer) from the model list (refer to your printer's documentation to find out

440 Installation and Administration


which language your printer understands). If this does not work, refer to Section
“Adding PPD Files with YaST” (page 442) for another possible solution.

7 The Configuration screen lists a summary of the printer setup. This dialog is also
shown when editing an existing printer configuration from the start screen of this
YaST module.

Figure 23.1 Printer Configuration Summary

The summary contains the following entries, which you can also modify with
Edit:

• Name and basic settings, Printer Model, and Connection let you change en-
tries made while following this procedure.

• Refer to Section “Choosing an Alternative PPD File with YaST” (page 442)
for details on PPD file.

• With Filter settings fine-tune the printer setup. Configure options like Page
Size, Color Mode, and Resolution here.

• By default, every user is able to use the printer. With Restriction settings,
list users that are forbidden to use the printer or list users that are allowed to
use it.

Printer Operation 441


• With State and banner settings you can, for example, deactivate the printer
by changing its state and specify whether a page with a Starting Banner or
Ending Banner is printed before or after each job (the default is not to print
them).

Adding PPD Files with YaST


If your printer does not show up in the Printer Model dialog, a PPD (PostScript Printer
Description) file for your model is missing (see Section 23.3, “Installing the Software”
(page 438) for more information about PPD files). With Add PPD File to Database, add
a PPD file from the local file system or an FTP or HTTP server.

Get PPD files directly from your printer vendor or from the driver CD of the printer
(see Section 23.9.2, “No Suitable PPD File Available for a PostScript Printer” (page 453)
for details). An alternative source for PPD files is http://www.linuxprinting
.org/, the “Linux Printing Database”. When downloading PPD files from linuxprint-
ing.org, keep in mind that it always shows the latest Linux support status, which is not
necessarily met by SUSE Linux Enterprise.

Choosing an Alternative PPD File with YaST


For many printer models, several PPD files are available. When configuring the printer,
YaST defaults to the one marked recommended as a general rule. To get a list of
PPD files available for a printer, select PPD file in Configuration then click Edit. See
Figure 23.1, “Printer Configuration Summary” (page 441).

Normally it should not be necessary to change the PPD file—the PPD file chosen by
YaST should produce the best results. However, if you want a color printer to print
only in black and white, for example, it is most convenient to use a PPD file that does
not support color printing. If you experience performance problems with a PostScript
printer when printing graphics, it may help to switch from a PostScript PPD file to a
PCL PPD file (provided your printer understands PCL).

442 Installation and Administration


23.5 Network Printers
A network printer can support various protocols, some of them even concurrently. Al-
though most of the supported protocols are standardized, some manufacturers expand
(modify) the standard because they test systems that have not implemented the standard
correctly or because they want to provide certain functions that are not available in the
standard. Manufacturers then provide drivers for only a few operating systems, elimi-
nating difficulties with those systems. Unfortunately, Linux drivers are rarely provided.
The current situation is such that you cannot act on the assumption that every protocol
works smoothly in Linux. Therefore, you may have to experiment with various options
to achieve a functional configuration.

CUPS supports the socket, LPD, IPP, and smb protocols.

socket
Socket refers to a connection in which the data is sent to an Internet socket without
first performing a data handshake. Some of the socket port numbers that are com-
monly used are 9100 or 35. The device URI (uniform resource identifier) syntax
is socket://IP.of.the.printer:port, for example,
socket://192.168.0.202:9100/.

LPD (Line Printer Daemon)


The proven LPD protocol is described in RFC 1179. Under this protocol, some
job-related data, such as the ID of the printer queue, is sent before the actual print
data is sent. Therefore, a printer queue must be specified when configuring the
LPD protocol for the data transmission. The implementations of diverse printer
manufacturers are flexible enough to accept any name as the printer queue. If nec-
essary, the printer manual should indicate what name to use. LPT, LPT1, LP1, or
similar names are often used. An LPD queue can also be configured on a different
Linux or Unix host in the CUPS system. The port number for an LPD service is
515. An example device URI is lpd://192.168.0.202/LPT1.

IPP (Internet Printing Protocol)


IPP is a relatively new (1999) protocol based on the HTTP protocol. With IPP,
more job-related data is transmitted than with the other protocols. CUPS uses IPP
for internal data transmission. This is the preferred protocol for a forwarding queue
between two CUPS servers. The name of the print queue is necessary to configure
IPP correctly. The port number for IPP is 631. Example device URIs are
ipp://192.168.0.202/ps and ipp://192.168.0.202/printers/ps.

Printer Operation 443


SMB (Windows Share)
CUPS also supports printing on printers connected to Windows shares. The protocol
used for this purpose is SMB. SMB uses the port numbers 137, 138, and 139.
Example device URIs are
smb://user:password@workgroup/server/printer,
smb://user:password@host/printer, and smb://server/printer.

The protocol supported by the printer must be determined before configuration. If the
manufacturer does not provide the needed information, the command nmap, which
comes with the nmap package, can be used to guess the protocol. nmap checks a host
for open ports. For example:

nmap -p 35,137-139,515,631,9100-10000 printerIP

23.5.1 Configuring Network Printers with


YaST
Network printers are not detected automatically. They must be configured manually
using the YaST printer module. Depending on your network setup, you can print to a
print server (CUPS, LPD, SMB, or IPX) or directly to a network printer (preferably via
TCP). Ask your network administrator for details for configuring a network printer in
your environment.

Procedure 23.2 Configuring a Network Printer with YaST

1 Start YaST and choose Hardware > Printer to open the Printer Configuration
dialog.

2 Click Add to open the Printer Type window.

3 Choose Network Printers to open a dialog in which to specify further details that
should be provided by your network administrator.

444 Installation and Administration


23.5.2 Configuring Network Printers with
Command Line Tools
Apart from setting CUPS options with YaST when configuring a network printer, CUPS
can be configured with command line tools like lpadmin and lpoptions. You need
a device URI consisting of a back-end, such as USB, and parameters, like /dev/usb/
lp0. For example, the full URI could be parallel:/dev/lp0 (printer connected
to the first parallel port) or usb:/dev/usb/lp0 (first detected printer connected to
the USB port).

With lpadmin, the CUPS server administrator can add, remove, or manage class and
print queues. To add a print queue, use the following syntax:

lpadmin -p queue -v device-URI -P PPD-file -E

Then the device (-v) is available as queue (-p), using the specified PPD file (-P).
This means that you must know the PPD file and the name of the device to configure
the printer manually.

Do not use -E as the first option. For all CUPS commands, -E as the first argument
sets use of an encrypted connection. To enable the printer, -E must be used as shown
in the following example:

lpadmin -p ps -v parallel:/dev/lp0 -P \
/usr/share/cups/model/Postscript.ppd.gz -E

The following example configures a network printer:

lpadmin -p ps -v socket://192.168.1.0:9100/ -P \
/usr/share/cups/model/Postscript-level1.ppd.gz -E

For more options of lpadmin, see the man page of lpadmin(1).

Printer Operation 445


During printer setup, certain options are set as default. These options can be modified
for every print job (depending on the print tool used). Changing these default options
with YaST is also possible. Using command line tools, set default options as follows:

1 First, list all options:

lpoptions -p queue -l

Example:

Resolution/Output Resolution: 150dpi *300dpi 600dpi

The activated default option is identified with a preceding asterisk (*).

2 Change the option with lpadmin:

lpadmin -p queue -o Resolution=600dpi

3 Check the new setting:

lpoptions -p queue -l

Resolution/Output Resolution: 150dpi 300dpi *600dpi

When a normal user runs lpoptions, the settings are written to ~/.lpoptions.
However, root settings are written to /etc/cups/lpoptions.

23.6 Graphical Printing Interfaces


Tools such as xpp and the KDE program KPrinter provide a graphical interface for
choosing queues and setting both CUPS standard options and printer-specific options
made available through the PPD file. You can even use KPrinter as the standard printing
interface of non-KDE applications. In the print dialog of these applications, specify
either kprinter or kprinter --stdin as the print command. The command to
use depends on how the application transmits the data—just try which one results in
starting KPrinter. If set up correctly, the application should open the KPrinter dialog
whenever a print job is issued from it, so you can use the dialog to select a queue and
set other printing options. This requires that the application's own print setup does not

446 Installation and Administration


conflict with that of KPrinter and that printing options are only changed through
KPrinter after it has been enabled.

23.7 Printing from the Command Line


To print from the command line, enter lp -d queuename filename, substituting
the corresponding names for queuename and filename.

Some applications rely on the lp command for printing. In this case, enter the correct
command in the application's print dialog, usually without specifying filename, for
example, lp -d queuename.

23.8 Special Features in SUSE Linux


Enterprise
A number of CUPS features have been adapted for SUSE Linux Enterprise. Some of
the most important changes are covered here.

23.8.1 CUPS Server and Firewall


There are several ways to configure CUPS as the client of a network server.

1. For every queue on the network server, you can configure a local queue through
which to forward all jobs to the corresponding network server (forwarding queue).
Usually this approach is not recommended, because all client machines must be
reconfigured whenever the configuration of the network server changes.

2. Print jobs can also be forwarded directly to one network server. For this type of
configuration, do not run a local CUPS daemon. lp or corresponding library calls
of other programs can send jobs directly to the network server. However, this
configuration does not work if you also want to print on a local printer.

3. The CUPS daemon can listen to IPP broadcast packets that other network servers
send to announce available queues.

Printer Operation 447


This is the best CUPS configuration for printing over remote CUPS servers.
However, there is a risk that an attacker sends IPP broadcasts with queues and the
local daemon accesses a counterfeit queue. If it then displays the queue with the
same name as another queue on the local server, the owner of the job may believe
the job is sent to a local server, while in reality it is sent to the attacker's server.

YaST can find CUPS servers by scanning local network hosts to see if they offer the
IPP service or by listening to IPP broadcasts. This requires the firewall to allow incoming
packets on port 631/UDP (service IPP client) to pass through. This is automatically
enabled when you have configured your machine to be in the internal firewall zone.
Opening a port to configure access to remote queues in the external zone can be a secu-
rity risk because an attacker could broadcast a server that might be accepted by users.
By default, IPP broadcasts are rejected in the external zone. See Section 43.4.1, “Con-
figuring the Firewall with YaST” (page 822) for details of firewall configuration.

Alternatively, the user can detect CUPS servers by actively scanning the local network
hosts or configure all queues manually. However, this method is not recommended.

23.8.2 Changes in the CUPS Print Service


cupsd Runs as the User lp
On start-up, cupsd changes from the user root to the user lp. This provides a much
higher level of security, because the CUPS print service does not run with unrestricted
permissions, only with the permissions needed for the print service.

However, the authentication (the password check) cannot be performed via /etc/
shadow, because lp has no access to /etc/shadow. Instead, the CUPS-specific
authentication via /etc/cups/passwd.md5 must be used. For this purpose, a CUPS
administrator with the CUPS administration group sys and a CUPS password must
be entered in /etc/cups/passwd.md5. To do this, enter the following as root:

lppasswd -g sys -a CUPS-admin-name

This setting is also essential if you want to use the CUPS administration Web front-end
or the KDE printer administration tool.

When cupsd runs as lp, /etc/printcap cannot be generated, because lp is not


permitted to create files in /etc/. Therefore, cupsd generates /etc/cups/

448 Installation and Administration


printcap. To ensure that applications that can only read queue names from /etc/
printcap continue to work properly, /etc/printcap is a symbolic link pointing
to /etc/cups/printcap.

When cupsd runs as lp, port 631 cannot be opened. Therefore, cupsd cannot be
reloaded with rccups reload. Use rccups restart instead.

Generalized Functionality for BrowseAllow and


BrowseDeny
The access permissions set for BrowseAllow and BrowseDeny apply to all kinds
of packages sent to cupsd. The default settings in /etc/cups/cupsd.conf are
as follows:

BrowseAllow @LOCAL
BrowseDeny All

and

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 127.0.0.2
Allow From @LOCAL
</Location>

In this way, only LOCAL hosts can access cupsd on a CUPS server. LOCAL hosts are
hosts whose IP addresses belong to a non-PPP interface (interfaces whose
IFF_POINTOPOINT flags are not set) and whose IP addresses belong to the same
network as the CUPS server. Packets from all other hosts are rejected immediately.

cupsd Activated by Default


In a standard installation, cupsd is activated automatically, enabling comfortable access
to the queues of CUPS network servers without any additional manual actions. The
items in Section “cupsd Runs as the User lp” (page 448) and Section “Generalized
Functionality for BrowseAllow and BrowseDeny” (page 449) are vital preconditions
for this feature, because otherwise the security would not be sufficient for an automatic
activation of cupsd.

Printer Operation 449


23.8.3 PPD Files in Various Packages
The YaST printer configuration sets up the queues for CUPS using only the PPD files
installed in /usr/share/cups/model. To find the suitable PPD files for the
printer model, YaST compares the vendor and model determined during hardware de-
tection with the vendors and models in all PPD files available in /usr/share/cups/
model on the system. For this purpose, the YaST printer configuration generates a
database from the vendor and model information extracted from the PPD files. When
you select a printer from the list of vendors and models, receive the PPD files matching
the vendor and model.

The configuration using only PPD files and no other information sources has the advan-
tage that the PPD files in /usr/share/cups/model can be modified freely. The
YaST printer configuration recognizes changes and regenerates the vendor and model
database. For example, if you only have PostScript printers, normally you do not need
the Foomatic PPD files in the cups-drivers package or the Gimp-Print PPD files
in the cups-drivers-stp package. Instead, the PPD files for your PostScript
printers can be copied directly to /usr/share/cups/model (if they do not already
exist in the manufacturer-PPDs package) to achieve an optimum configuration
for your printers.

CUPS PPD Files in the cups Package


The generic PPD files in the cups package have been complemented with adapted
Foomatic PPD files for PostScript level 1 and level 2 printers:

• /usr/share/cups/model/Postscript-level1.ppd.gz

• /usr/share/cups/model/Postscript-level2.ppd.gz

PPD Files in the cups-drivers Package


Normally, the Foomatic printer filter foomatic-rip is used together with Ghostscript
for non-PostScript printers. Suitable Foomatic PPD files have the entries *NickName:
... Foomatic/Ghostscript driver and *cupsFilter: ...
foomatic-rip. These PPD files are located in the cups-drivers package.

450 Installation and Administration


YaST prefers a Foomatic PPD file if a Foomatic PPD file with the entry *NickName:
... Foomatic ... (recommended) matches the printer model and the
manufacturer-PPDs package does not contain a more suitable PPD file.

Gimp-Print PPD Files in the cups-drivers-stp


Package
Instead of foomatic-rip, the CUPS filter rastertoprinter from Gimp-Print
can be used for many non-PostScript printers. This filter and suitable Gimp-Print PPD
files are available in the cups-drivers-stp package. The Gimp-Print PPD files
are located in /usr/share/cups/model/stp/ and have the entries *NickName:
... CUPS+Gimp-Print and *cupsFilter: ... rastertoprinter.

PPD Files from Printer Manufacturers in the


manufacturer-PPDs Package
The manufacturer-PPDs package contains PPD files from printer manufacturers
that are released under a sufficiently liberal license. PostScript printers should be con-
figured with the suitable PPD file of the printer manufacturer, because this file enables
the use of all functions of the PostScript printer. YaST prefers a PPD file from the
manufacturer-PPDs package if the following conditions are met:

• The vendor and model determined during the hardware detection match the vendor
and model in a PPD file from the manufacturer-PPDs package.

• The PPD file from the manufacturer-PPDs package is the only suitable PPD
file for the printer model or a there is a Foomatic PPD file with a *NickName:
... Foomatic/Postscript (recommended) entry that also matches the
printer model.

Accordingly, YaST does not use any PPD file from the manufacturer-PPDs
package in the following cases:

• The PPD file from the the manufacturer-PPDs package does not match the
vendor and model. This may happen if the manufacturer-PPDs package con-
tains only one PPD file for similar models, for example, if there is no separate PPD
file for the individual models of a model series, but the model name is specified in
a form like Funprinter 1000 series in the PPD file.

Printer Operation 451


• The Foomatic PostScript PPD file is not recommended. This may be because the
printer model does not operate efficiently enough in PostScript mode, for example,
the printer may be unreliable in this mode because it has too little memory or the
printer is too slow because its processor is too weak. Furthermore, the printer may
not support PostScript by default, for example, because PostScript support is only
available as an optional module.

If a PPD file from the manufacturer-PPDs package is suitable for a PostScript


printer, but YaST cannot configure it for these reasons, select the respective printer
model manually in YaST.

23.9 Troubleshooting
The following sections cover some of the most frequently encountered printer hardware
and software problems and ways to solve or circumvent these problems. Among the
topics covered are GDI printers, PPD files, and port configuration. Common network
printer problems, defective printouts, and queue handling are also addressed.

23.9.1 Printers without Standard Printer


Language Support
These printers do not support any common printer language and can only be addressed
with special proprietary control sequences. Therefore they can only work with the op-
erating system versions for which the manufacturer delivers a driver. GDI is a program-
ming interface developed by Microsoft* for graphics devices. Usually the manufacturer
delivers drivers only for Windows and because the Windows driver uses the GDI inter-
face, these printers are also called GDI printers. The actual problem is not the program-
ming interface, but the fact that these printers can only be addressed with the proprietary
printer language of the respective printer model.

Some GDI printers can be switched to operate either in GDI mode or one of the standard
printer languages. See whether it is possible in the manual of the printer. Some models
require a special Windows software to do the switch (note that the Windows printer
driver may always switch the printer back into GDI mode when printing from Windows).
For other GDI printers, there are extension modules for a standard printer language
available.

452 Installation and Administration


Some manufacturers provide proprietary drivers for their printers. The disadvantage of
proprietary printer drivers is that there is no guarantee that these work with the installed
print system and that they are suitable for the various hardware platforms. In contrast,
printers that support a standard printer language do not depend on a special print system
version or a special hardware platform.

Instead of spending time trying to make a proprietary Linux driver work, it may be
more cost-effective to purchase a supported printer. This would solve the driver problem
once and for all, eliminating the need to install and configure special driver software
and obtain driver updates that may be required due to new developments in the print
system.

23.9.2 No Suitable PPD File Available for a


PostScript Printer
If the manufacturer-PPDs package does not contain any suitable PPD file for a
PostScript printer, it should be possible to use the PPD file from the driver CD of the
printer manufacturer or download a suitable PPD file from the Web page of the printer
manufacturer.

If the PPD file is provided as a zip archive (.zip) or a self-extracting zip archive (.exe),
unpack it with unzip. First, review the license terms of the PPD file. Then use the
cupstestppd utility to check if the PPD file complies with “Adobe PostScript
Printer Description File Format Specification, version 4.3.” If the utility returns “FAIL,”
the errors in the PPD files are serious and are likely to cause major problems. The
problem spots reported by cupstestppd should be eliminated. If necessary, ask the
printer manufacturer for a suitable PPD file.

Printer Operation 453


23.9.3 Parallel Ports
The safest approach is to connect the printer directly to the first parallel port and to select
the following parallel port settings in the BIOS:

• I/O address: 378 (hexadecimal)

• Interrupt: irrelevant

• Mode: Normal, SPP, or Output Only

• DMA: disabled

If the printer cannot be addressed on the parallel port despite these settings, enter the
I/O address explicitly in accordance with the setting in the BIOS in the form 0x378
in /etc/modprobe.conf. If there are two parallel ports that are set to the I/O ad-
dresses 378 and 278 (hexadecimal), enter these in the form 0x378,0x278.

If interrupt 7 is free, it can be activated with the entry shown in Example 23.1,
“/etc/modprobe.conf: Interrupt Mode for the First Parallel Port” (page 454). Before ac-
tivating the interrupt mode, check the file /proc/interrupts to see which interrupts
are already in use. Only the interrupts currently being used are displayed. This may
change depending on which hardware components are active. The interrupt for the
parallel port must not be used by any other device. If you are not sure, use the polling
mode with irq=none.

Example 23.1 /etc/modprobe.conf: Interrupt Mode for the First Parallel Port

alias parport_lowlevel parport_pc


options parport_pc io=0x378 irq=7

23.9.4 Network Printer Connections


Identifying Network Problems
Connect the printer directly to the computer. For test purposes, configure the
printer as a local printer. If this works, the problems are related to the network.

Checking the TCP/IP Network


The TCP/IP network and name resolution must be functional.

454 Installation and Administration


Checking a Remote lpd
Use the following command to test if a TCP connection can be established to lpd
(port 515) on host:

netcat -z host 515 && echo ok || echo failed

If the connection to lpd cannot be established, lpd may not be active or there
may be basic network problems.

As the user root, use the following command to query a (possibly very long)
status report for queue on remote host, provided the respective lpd is active
and the host accepts queries:

echo -e "\004queue" \
| netcat -w 2 -p 722 host 515

If lpd does not respond, it may not be active or there may be basic network prob-
lems. If lpd responds, the response should show why printing is not possible on
the queue on host. If you receive a response like that in Example 23.2, “Error
Message from lpd” (page 455), the problem is caused by the remote lpd.

Example 23.2 Error Message from lpd

lpd: your host does not have line printer access


lpd: queue does not exist
printer: spooling disabled
printer: printing disabled

Checking a Remote cupsd


By default, the CUPS network server should broadcast its queues every 30 seconds
on UDP port 631. Accordingly, the following command can be used to test whether
there is a CUPS network server in the network.

netcat -u -l -p 631 & PID=$! ; sleep 40 ; kill $PID

If a broadcasting CUPS network server exists, the output appears as shown in Ex-
ample 23.3, “Broadcast from the CUPS Network Server” (page 455).

Example 23.3 Broadcast from the CUPS Network Server

ipp://192.168.0.202:631/printers/queue

Printer Operation 455


►zseries: Take into account that IBM System z ethernet devices do not receive
broadcasts by default. ◄

The following command can be used to test if a TCP connection can be established
to cupsd (port 631) on host:

netcat -z host 631 && echo ok || echo failed

If the connection to cupsd cannot be established, cupsd may not be active or


there may be basic network problems. lpstat -h host -l -t returns a
(possibly very long) status report for all queues on host, provided the respective
cupsd is active and the host accepts queries.

The next command can be used to test if the queue on host accepts a print job
consisting of a single carriage-return character. Nothing should be printed. Possibly,
a blank page may be ejected.

echo -en "\r" \


| lp -d queue -h host

Troubleshooting a Network Printer or Print Server Box


Spoolers running in a print server box sometimes cause problems when they have
to deal with a lot of print jobs. Because this is caused by the spooler in the print
server box, there is nothing you can do about it. As a work-around, circumvent the
spooler in the print server box by addressing the printer connected to the print
server box directly with TCP socket. See Section 23.5, “Network Printers”
(page 443).

In this way, the print server box is reduced to a converter between the various forms
of data transfer (TCP/IP network and local printer connection). To use this method,
you need to know the TCP port on the print server box. If the printer is connected
to the print server box and powered on, this TCP port can usually be determined
with the nmap utility from the nmap package some time after the print server box
is powered on. For example, nmap IP-address may deliver the following
output for a print server box:

Port State Service


23/tcp open telnet
80/tcp open http
515/tcp open printer
631/tcp open cups
9100/tcp open jetdirect

456 Installation and Administration


This output indicates that the printer connected to the print server box can be ad-
dressed via TCP socket on port 9100. By default, nmap only checks a number of
commonly known ports listed in /usr/share/nmap/nmap-services. To
check all possible ports, use the command nmap
-p from_port-to_port IP-address. This may take some time. For further
information, refer to the man page of nmap.

Enter a command like

echo -en "\rHello\r\f" | netcat -w 1 IP-address port


cat file | netcat -w 1 IP-address port

to send character strings or files directly to the respective port to test if the printer
can be addressed on this port.

23.9.5 Defective Printouts without Error


Message
For the print system, the print job is completed when the CUPS back-end completes
the data transfer to the recipient (printer). If the further processing on the recipient fails,
for example, if the printer is not able to print the printer-specific data, the print system
does not notice this. If the printer is not able to print the printer-specific data, select a
different PPD file that is more suitable for the printer.

23.9.6 Disabled Queues


If the data transfer to the recipient fails entirely after several attempts, the CUPS back-
end, such as USB or socket, reports an error to the print system (to cupsd). The
back-end decides whether and how many attempts make sense until the data transfer
is reported as impossible. Because further attempts would be in vain, cupsd disables
printing for the respective queue. After eliminating the cause of the problem, the system
administrator must reenable printing with the command /usr/bin/enable.

Printer Operation 457


23.9.7 CUPS Browsing: Deleting Print Jobs
If a CUPS network server broadcasts its queues to the client hosts via browsing and a
suitable local cupsd is active on the client hosts, the client cupsd accepts print jobs
from applications and forwards them to the cupsd on the server. When cupsd accepts
a print job, it is assigned a new job number. Therefore, the job number on the client
host is different from the job number on the server. Because a print job is usually for-
warded immediately, it cannot be deleted with the job number on the client host, because
the client cupsd regards the print job as completed as soon as it has been forwarded
to the server cupsd.

To delete the print job on the server, use a command such as lpstat -h
print-server -o to determine the job number on the server, provided the server
has not already completed the print job (that is, sent it completely to the printer). Using
this job number, the print job on the server can be deleted:

cancel -h print-server queue-jobnnumber

23.9.8 Defective Print Jobs and Data


Transfer Errors
Print jobs remain in the queues and printing resumes if you switch the printer off and
on or shut down and reboot the computer during the printing process. Defective print
jobs must be removed from the queue with cancel.

If a print job is defective or an error occurs in the communication between the host and
the printer, the printer prints numerous sheets of paper with unintelligible characters,
because it is unable to process the data correctly. To deal with this, follow these steps:

1 To stop printing, remove all paper from ink jet printers or open the paper trays
of laser printers. High-quality printers have a button for canceling the current
printout.

2 The print job may still be in the queue, because jobs are only removed after they
are sent completely to the printer. Use lpstat -o or lpstat -h
print-server -o to check which queue is currently printing. Delete the
print job with cancel queue-jobnumber or cancel -h
print-server queue-jobnumber.

458 Installation and Administration


3 Some data may still be transferred to the printer even though the print job has
been deleted from the queue. Check if a CUPS back-end process is still running
for the respective queue and terminate it. For example, for a printer connected
to the parallel port, the command fuser -k /dev/lp0 can be used to termi-
nate all processes that are still accessing the printer (more precisely: the parallel
port).

4 Reset the printer completely by switching it off for some time. Then insert the
paper and turn on the printer.

23.9.9 Debugging the CUPS Print System


Use the following generic procedure to locate problems in the CUPS print system:

1 Set LogLevel debug in /etc/cups/cupsd.conf.

2 Stop cupsd.

3 Remove /var/log/cups/error_log* to avoid having to search through


very large log files.

4 Start cupsd.

5 Repeat the action that led to the problem.

6 Check the messages in /var/log/cups/error_log* to identify the cause


of the problem.

Printer Operation 459


Dynamic Kernel Device
Management with udev
Since version 2.6, the kernel is capable of adding or removing almost any device in the
24
running system. Changes in device state (whether a device is plugged in or removed)
need to be propagated to userspace. Devices need to be configured as soon as they are
plugged in and discovered. Users of a certain device need to be informed about any
state changes of this device. udev provides the needed infrastructure to dynamically
maintain the device node files and symbolic links in the /dev directory. udev rules
provide a way to plug external tools into the kernel device event processing. This enables
you to customize udev device handling, for example, by adding certain scripts to execute
as part of kernel device handling, or request and import additional data to evaluate
during device handling.

24.1 The /dev Directory


The device nodes in the /dev directory provide access to the corresponding kernel
devices. With udev, the /dev directory reflects the current state of the kernel. Every
kernel device has one corresponding device file. If a device is disconnected from the
system, the device node is removed.

The content of the /dev directory is kept on a temporary file system and all files are
created from scratch at every system start-up. Manually created or changed files inten-
tionally do not survive a reboot. Static files and directories that should always be present
in the /dev directory regardless of the state of the corresponding kernel device can be
placed in the /lib/udev/devices directory. At system start-up, the contents of
that directory is copied to the /dev directory with the same ownership and permissions
as the files in /lib/udev/devices.

Dynamic Kernel Device Management with udev 461


24.2 Kernel uevents and udev
The required device information is exported by the sysfs file system. For every device
the kernel has detected and initialized, a directory with the device name is created. It
contains attribute files with device-specific properties. Every time a device is added or
removed, the kernel sends a uevent to notify udev of the change.

The udev daemon reads and parses all provided rules from the /etc/udev/rules
.d/*.rules files once at start-up and keeps them in memory. If rules files are
changed, added, or removed, the daemon receives an event and updates the in-memory
representation of the rules.

Every received event is matched against the set of provides rules. The rules can add or
change event environment keys, request a specific name for the device node to create,
add symlinks pointing to the node, or add programs to run after the device node is cre-
ated. The driver core uevents are received from a kernel netlink socket.

24.3 Drivers, Kernel Modules, and


Devices
The kernel bus drivers probe for devices. For every detected device, the kernel creates
an internal device structure and the driver core sends a uevent to the udev daemon. Bus
devices identify themselves by a specially-formatted ID, which tells what kind of device
it is. Usually these IDs consist of vendor and product ID and other subsystem-specific
values. Every bus has its own scheme for these IDs, called MODALIAS. The kernel
takes the device information, composes a MODALIAS ID string from it, and sends that
string along with the event. For a USB mouse, it looks like this:
MODALIAS=usb:v046DpC03Ed2000dc00dsc00dp00ic03isc01ip02

Every device driver carries a list of known aliases for devices it can handle. The list is
contained in the kernel module file itself. The program depmod reads the ID lists and
creates the file modules.alias in the kernel's /lib/modules directory for all
currently available modules. With this infrastructure, module loading is as easy as
calling modprobe for every event that carries a MODALIAS key. If modprobe
$MODALIAS is called, it matches the device alias composed for the device with the

462 Installation and Administration


aliases provided by the modules. If a matching entry is found, that module is loaded.
All this is triggered by udev and happens automatically.

24.4 Booting and Initial Device Setup


All device events happening during the boot process before the udev daemon is running
are lost, because the infrastructure to handle these events lives on the root file system
and is not available at that time. To cover that loss, the kernel provides a uevent file
for every device in the sysfs file system. By writing add to that file, the kernel resends
the same event as the one lost during boot. A simple loop over all uevent files in
/sys triggers all events again to create the device nodes and perform device setup.

As an example, a USB mouse present during boot may not be initialized by the early
boot logic, because the driver is not available that time. The event for the device discov-
ery was lost and failed to find a kernel module for the device. Instead of manually
searching for possibly connected devices, udev just requests all device events from the
kernel after the root file system is available, so the event for the USB mouse device
just runs again. Now it finds the kernel module on the mounted root file system and the
USB mouse can be initialized.

From userspace, there is no visible difference between a device coldplug sequence and
a device discovery during runtime. In both cases, the same rules are used to match and
the same configured programs are run.

24.5 Debugging udev Events


The program udevmonitor can be used to visualize the driver core events and the
timing of the udev event processes.

UEVENT[1132632714.285362] add@/devices/pci0000:00/0000:00:1d.1/usb2/2-2
UEVENT[1132632714.288166] add@/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0
UEVENT[1132632714.309485] add@/class/input/input6
UEVENT[1132632714.309511] add@/class/input/input6/mouse2
UEVENT[1132632714.309524] add@/class/usb_device/usbdev2.12
UDEV [1132632714.348966] add@/devices/pci0000:00/0000:00:1d.1/usb2/2-2
UDEV [1132632714.420947] add@/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0
UDEV [1132632714.427298] add@/class/input/input6
UDEV [1132632714.434223] add@/class/usb_device/usbdev2.12
UDEV [1132632714.439934] add@/class/input/input6/mouse2

Dynamic Kernel Device Management with udev 463


The UEVENT lines show the events the kernel has sent over netlink. The UDEV lines
show the finished udev event handlers. The timing is printed in microseconds. The time
between UEVENT and UDEV is the time udev took to process this event or the udev
daemon has delayed its execution to synchronize this event with related and already
running events. For example, events for hard disk partitions always wait for the main
disk device event to finish, because the partition events may rely on the data the main
disk event has queried from the hardware.

udevmonitor --env shows the complete event environment:

UDEV [1132633002.937243] add@/class/input/input7


UDEV_LOG=3
ACTION=add
DEVPATH=/class/input/input7
SUBSYSTEM=input
SEQNUM=1043
PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
PRODUCT=3/46d/c03e/2000
NAME="Logitech USB-PS/2 Optical Mouse"
PHYS="usb-0000:00:1d.1-2/input0"
UNIQ=""
EV=7
KEY=70000 0 0 0 0 0 0 0 0
REL=103

udev also sends messages to syslog. The default syslog priority that controls which
messages are sent to syslog is specified in the udev configuration file /etc/udev/
udev.conf. The log priority of the running daemon can be changed with
udevcontrol log_priority=level/number.

24.6 Influencing Kernel Device Event


Handling with udev Rules
A udev rule can match any property the kernel adds to the event itself or any information
that the kernel exports to sysfs. The rule can also request additional information from
external programs. Every event is matched against all provided rules. All rules are lo-
cated in the /etc/udev/rules.d directory.

464 Installation and Administration


Every line in the rules file contains at least one key value pair. There are two kinds of
keys, match and assignment keys. If all match keys match their values, the rule is applied
and the assignment keys are assigned the specified value. A matching rule may specify
the name of the device node, add symlinks pointing to the node, or run a specified
program as part of the event handling. If no matching rule is found, the default device
node name is used to create the device node. The rule syntax and the provided keys to
match or import data are described in the udev man page.

24.7 Persistent Device Naming


The dynamic device directory and the udev rules infrastructure make it possible to
provide stable names for all disk devices—regardless of their order of recognition or
the connection used for the device. Every appropriate block device the kernel creates
is examined by tools with special knowledge about certain buses, drive types, or file
systems. Along with the dynamic kernel-provided device node name, udev maintains
classes of persistent symbolic links pointing to the device:

/dev/disk
|-- by-id
| |-- scsi-SATA_HTS726060M9AT00_MRH453M4HWHG7B -> ../../sda
| |-- scsi-SATA_HTS726060M9AT00_MRH453M4HWHG7B-part1 -> ../../sda1
| |-- scsi-SATA_HTS726060M9AT00_MRH453M4HWHG7B-part6 -> ../../sda6
| |-- scsi-SATA_HTS726060M9AT00_MRH453M4HWHG7B-part7 -> ../../sda7
| |-- usb-Generic_STORAGE_DEVICE_02773 -> ../../sdd
| `-- usb-Generic_STORAGE_DEVICE_02773-part1 -> ../../sdd1
|-- by-label
| |-- Photos -> ../../sdd1
| |-- SUSE10 -> ../../sda7
| `-- devel -> ../../sda6
|-- by-path
| |-- pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sda
| |-- pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sda1
| |-- pci-0000:00:1f.2-scsi-0:0:0:0-part6 -> ../../sda6
| |-- pci-0000:00:1f.2-scsi-0:0:0:0-part7 -> ../../sda7
| |-- pci-0000:00:1f.2-scsi-1:0:0:0 -> ../../sr0
| |-- usb-02773:0:0:2 -> ../../sdd
| |-- usb-02773:0:0:2-part1 -> ../../sdd1
`-- by-uuid
|-- 159a47a4-e6e6-40be-a757-a629991479ae -> ../../sda7
|-- 3e999973-00c9-4917-9442-b7633bd95b9e -> ../../sda6
`-- 4210-8F8C -> ../../sdd1

Dynamic Kernel Device Management with udev 465


24.8 The Replaced hotplug Package
The formerly used hotplug package is entirely replaced by udev and the udev-related
kernel infrastructure. The following parts of the former hotplug infrastructure have
been made obsolete or had their functionality taken over by udev:

/etc/hotplug/*.agent
No longer needed or moved to /lib/udev

/etc/hotplug/*.rc
Replaced by the /sys/*/uevent trigger

/etc/hotplug/blacklist
Replaced by the blacklist option in modprobe.conf

/etc/dev.d/*
Replaced by the udev rule RUN key

/etc/hotplug.d/*
Replaced by the udev rule RUN key

/sbin/hotplug
Replaced by udevd listening to netlink; only used in the initial RAM file system
until the root file system can be mounted, then it is disabled

/dev/*
Replaced by dynamic udev and static content in /lib/udev/devices/*

The following files and directories contain the crucial elements of the udev infrastructure:

/etc/udev/udev.conf
Main udev configuration file

/etc/udev/rules.d/*
udev event matching rules

/lib/udev/devices/*
Static /dev content

466 Installation and Administration


/lib/udev/*
Helper programs called from udev rules

24.9 For More Information


For more information about the udev infrastructure, refer to the following man pages:

udev
General information about udev, keys, rules, and other important configuration is-
sues.

udevinfo
udevinfo can be used to query device information from the udev database.

udevd
Information about the udev event managing daemon.

udevmonitor
udevmonitor prints the kernel and udev event sequence to the console. This tool is
mainly used for debugging purposes.

Dynamic Kernel Device Management with udev 467


File Systems in Linux
SUSE Linux Enterprise® ships with a number of different file systems, including Rei-
25
serFS, Ext2, Ext3, and XFS, from which to choose at installation time. Each file system
has its own advantages and disadvantages that can make it more suited to a scenario.
To meet the requirements of high-performance clustering scenarios, SUSE Linux En-
terprise Server includes OCFS2 (Oracle Cluster File System 2).

25.1 Terminology
metadata
A file system–internal data structure that assures all the data on disk is properly
organized and accessible. Essentially, it is “data about the data.” Almost every file
system has its own structure of metadata, which is part of why the file systems
show different performance characteristics. It is extremely important to maintain
metadata intact, because otherwise all data on the file system could become inac-
cessible.

inode
Inodes contain various information about a file, including size, number of links,
pointers to the disk blocks where the file contents are actually stored, and date and
time of creation, modification, and access.

journal
In the context of a file system, a journal is an on-disk structure containing a kind
of log in which the file system stores what it is about to change in the file system's
metadata. Journaling greatly reduces the recovery time of a Linux system because

File Systems in Linux 469


it obsoletes the lengthy search process that checks the entire file system at system
start-up. Instead, only the journal is replayed.

25.2 Major File Systems in Linux


Unlike two or three years ago, choosing a file system for a Linux system is no longer
a matter of a few seconds (Ext2 or ReiserFS?). Kernels starting from 2.4 offer a variety
of file systems from which to choose. The following is an overview of how these file
systems basically work and which advantages they offer.

It is very important to bear in mind that there may be no file system that best suits all
kinds of applications. Each file system has its particular strengths and weaknesses,
which must be taken into account. Even the most sophisticated file system cannot replace
a reasonable backup strategy, however.

The terms data integrity and data consistency, when used in this chapter, do not refer
to the consistency of the user space data (the data your application writes to its files).
Whether this data is consistent must be controlled by the application itself.

IMPORTANT: Setting Up File Systems

Unless stated otherwise in this chapter, all the steps required to set up or
change partitions and file systems can be performed using YaST.

25.2.1 ReiserFS
Officially one of the key features of the 2.4 kernel release, ReiserFS has been available
as a kernel patch for 2.2.x SUSE kernels since version 6.4. ReiserFS was designed by
Hans Reiser and the Namesys development team. It has proven itself to be a powerful
alternative to Ext2. Its key assets are better disk space utilization, better disk access
performance, and faster crash recovery.

ReiserFS's strengths, in more detail, are:

Better Disk Space Utilization


In ReiserFS, all data is organized in a structure called B*-balanced tree. The tree
structure contributes to better disk space utilization because small files can be stored

470 Installation and Administration


directly in the B* tree leaf nodes instead of being stored elsewhere and just main-
taining a pointer to the actual disk location. In addition to that, storage is not allo-
cated in chunks of 1 or 4 KB, but in portions of the exact size needed. Another
benefit lies in the dynamic allocation of inodes. This keeps the file system more
flexible than traditional file systems, like Ext2, where the inode density must be
specified at file system creation time.

Better Disk Access Performance


For small files, file data and “stat_data” (inode) information are often stored next
to each other. They can be read with a single disk I/O operation, meaning that only
one access to disk is required to retrieve all the information needed.

Fast Crash Recovery


Using a journal to keep track of recent metadata changes makes a file system check
a matter of seconds, even for huge file systems.

Reliability through Data Journaling


ReiserFS also supports data journaling and ordered data modes similar to the con-
cepts outlined in the Ext3 section, Section 25.2.3, “Ext3” (page 472). The default
mode is data=ordered, which ensures both data and metadata integrity, but
uses journaling only for metadata.

25.2.2 Ext2
The origins of Ext2 go back to the early days of Linux history. Its predecessor, the
Extended File System, was implemented in April 1992 and integrated in Linux 0.96c.
The Extended File System underwent a number of modifications and, as Ext2, became
the most popular Linux file system for years. With the creation of journaling file systems
and their astonishingly short recovery times, Ext2 became less important.

A brief summary of Ext2's strengths might help understand why it was—and in some
areas still is—the favorite Linux file system of many Linux users.

Solidity
Being quite an “old-timer,” Ext2 underwent many improvements and was heavily
tested. This may be the reason why people often refer to it as rock-solid. After a
system outage when the file system could not be cleanly unmounted, e2fsck starts
to analyze the file system data. Metadata is brought into a consistent state and
pending files or data blocks are written to a designated directory (called lost

File Systems in Linux 471


+found). In contrast to journaling file systems, e2fsck analyzes the entire file
system and not just the recently modified bits of metadata. This takes significantly
longer than checking the log data of a journaling file system. Depending on file
system size, this procedure can take half an hour or more. Therefore, it is not desir-
able to choose Ext2 for any server that needs high availability. However, because
Ext2 does not maintain a journal and uses significantly less memory, it is sometimes
faster than other file systems.

Easy Upgradability
The code for Ext2 is the strong foundation on which Ext3 could become a highly-
acclaimed next-generation file system. Its reliability and solidity were elegantly
combined with the advantages of a journaling file system.

25.2.3 Ext3
Ext3 was designed by Stephen Tweedie. Unlike all other next-generation file systems,
Ext3 does not follow a completely new design principle. It is based on Ext2. These two
file systems are very closely related to each other. An Ext3 file system can be easily
built on top of an Ext2 file system. The most important difference between Ext2 and
Ext3 is that Ext3 supports journaling. In summary, Ext3 has three major advantages to
offer:

Easy and Highly Reliable Upgrades from Ext2


Because Ext3 is based on the Ext2 code and shares its on-disk format as well as its
metadata format, upgrades from Ext2 to Ext3 are incredibly easy. Unlike transitions
to other journaling file systems, such as ReiserFS or XFS, which can be quite tedious
(making backups of the entire file system and recreating it from scratch), a transition
to Ext3 is a matter of minutes. It is also very safe, because recreating an entire file
system from scratch might not work flawlessly. Considering the number of existing
Ext2 systems that await an upgrade to a journaling file system, you can easily figure
out why Ext3 might be of some importance to many system administrators.
Downgrading from Ext3 to Ext2 is as easy as the upgrade. Just perform a clean
unmount of the Ext3 file system and remount it as an Ext2 file system.

Reliability and Performance


Some other journaling file systems follow the “metadata-only” journaling approach.
This means your metadata is always kept in a consistent state, but the same cannot
be automatically guaranteed for the file system data itself. Ext3 is designed to take
care of both metadata and data. The degree of “care” can be customized. Enabling

472 Installation and Administration


Ext3 in the data=journal mode offers maximum security (data integrity), but
can slow down the system because both metadata and data are journaled. A rela-
tively new approach is to use the data=ordered mode, which ensures both data
and metadata integrity, but uses journaling only for metadata. The file system
driver collects all data blocks that correspond to one metadata update. These data
blocks are written to disk before the metadata is updated. As a result, consistency
is achieved for metadata and data without sacrificing performance. A third option
to use is data=writeback, which allows data to be written into the main file
system after its metadata has been committed to the journal. This option is often
considered the best in performance. It can, however, allow old data to reappear in
files after crash and recovery while internal file system integrity is maintained.
Unless you specify something else, Ext3 is run with the data=ordered default.

25.2.4 Converting an Ext2 File System into


Ext3
To convert an Ext2 file system to Ext3, proceed as follows:

1 Create an Ext3 journal by running tune2fs -j as root. This creates an Ext3


journal with the default parameters.

To decide yourself how large the journal should be and on which device it should
reside, run tune2fs -J instead together with the desired journal options
size= and device=. More information about the tune2fs program is available
in the tune2fs manual page.

2 To ensure that the Ext3 file system is recognized as such, edit the file /etc/
fstab as root, changing the file system type specified for the corresponding
partition from ext2 to ext3. The change takes effect after the next reboot.

3 To boot a root file system set up as an Ext3 partition, include the modules ext3
and jbd in the initrd. To do this, edit /etc/sysconfig/kernel as
root, adding ext3 and jbd to the INITRD_MODULES variable. After saving
the changes, run the mkinitrd command. This builds a new initrd and prepares
it for use.

File Systems in Linux 473


25.2.5 XFS
Originally intended as the file system for their IRIX OS, SGI started XFS development
in the early 1990s. The idea behind XFS was to create a high-performance 64-bit jour-
naling file system to meet the extreme computing challenges of today. XFS is very
good at manipulating large files and performs well on high-end hardware. However,
even XFS has a drawback. Like ReiserFS, XFS takes great care of metadata integrity,
but less of data integrity.

A quick review of XFS's key features explains why it may prove a strong competitor
for other journaling file systems in high-end computing.

High Scalability through the Use of Allocation Groups


At the creation time of an XFS file system, the block device underlying the file
system is divided into eight or more linear regions of equal size. Those are referred
to as allocation groups. Each allocation group manages its own inodes and free
disk space. Practically, allocation groups can be seen as file systems in a file system.
Because allocation groups are rather independent of each other, more than one of
them can be addressed by the kernel simultaneously. This feature is the key to
XFS's great scalability. Naturally, the concept of independent allocation groups
suits the needs of multiprocessor systems.

High Performance through Efficient Management of Disk Space


Free space and inodes are handled by B+ trees inside the allocation groups. The
use of B+ trees greatly contributes to XFS's performance and scalability. XFS uses
delayed allocation. It handles allocation by breaking the process into two pieces.
A pending transaction is stored in RAM and the appropriate amount of space is
reserved. XFS still does not decide where exactly (speaking of file system blocks)
the data should be stored. This decision is delayed until the last possible moment.
Some short-lived temporary data may never make its way to disk, because it may
be obsolete by the time XFS decides where actually to save it. Thus XFS increases
write performance and reduces file system fragmentation. Because delayed allocation
results in less frequent write events than in other file systems, it is likely that data
loss after a crash during a write is more severe.

Preallocation to Avoid File System Fragmentation


Before writing the data to the file system, XFS reserves (preallocates) the free space
needed for a file. Thus, file system fragmentation is greatly reduced. Performance
is increased because the contents of a file are not distributed all over the file system.

474 Installation and Administration


25.2.6 Oracle Cluster File System 2
OCFS2 is a journaling file system that has been tailor-made for clustering setups. In
contrast to a standard single-node file system like Ext3, OCFS2 is capable of managing
several nodes. OCFS2 allows spreading a file system across shared storage, such as a
SAN or multipath setup.

Every node in an OCFS2 setup has concurrent read and write access to all data. This
requires OCFS2 to be cluster-aware, meaning that OCFS2 must include a means to
determine of which nodes the cluster consists and whether these nodes are actually
alive and available. To compute a cluster's membership, OCFS2 includes a node man-
ager (NM). To monitor the availability of the nodes in a cluster, OCFS2 includes a
simple heartbeat implementation. To avoid chaos arising from various nodes directly
accessing the file system, OCFS2 also contains a lock manager, DLM (distributed lock
manager). Communication between the nodes is handled via a TCP-based messaging
system.

Major features and benefits of OCFS2 include:

• Metadata caching and journaling

• Asynchronous and direct I/O support for database files for improved database per-
formance

• Support for multiple block sizes (where each volume can have a different block
size) up to 4 KB, for a maximum volume size of 16 TB

• Cross-node file data consistency

• Support for up to 255 cluster nodes

For more in-depth information about OCFS2, refer to Chapter 13, Oracle Cluster File
System 2 (page 267).

File Systems in Linux 475


25.3 Some Other Supported File
Systems
Table 25.1, “File System Types in Linux” (page 476) summarizes some other file systems
supported by Linux. They are supported mainly to ensure compatibility and interchange
of data with different kinds of media or foreign operating systems.

Table 25.1 File System Types in Linux

cramfs Compressed ROM file system: A compressed read-only file sys-


tem for ROMs.

hpfs High Performance File System: The IBM OS/2 standard file
system—only supported in read-only mode.

iso9660 Standard file system on CD-ROMs.

minix This file system originated from academic projects on operating


systems and was the first file system used in Linux. Today, it is
used as a file system for floppy disks.

msdos fat, the file system originally used by DOS, is today used by
various operating systems.

ncpfs File system for mounting Novell volumes over networks.

nfs Network File System: Here, data can be stored on any machine
in a network and access may be granted via a network.

smbfs Server Message Block is used by products such as Windows to


enable file access over a network.

sysv Used on SCO UNIX, Xenix, and Coherent (commercial UNIX


systems for PCs).

ufs Used by BSD, SunOS, and NeXTSTEP. Only supported in read-


only mode.

476 Installation and Administration


umsdos UNIX on MSDOS: Applied on top of a normal fat file system,
achieves UNIX functionality (permissions, links, long filenames)
by creating special files.

vfat Virtual FAT: Extension of the fat file system (supports long
filenames).

ntfs Windows NT file system, read-only.

25.4 Large File Support in Linux


Originally, Linux supported a maximum file size of 2 GB. This was enough before the
explosion of multimedia and as long as no one tried to manipulate huge databases on
Linux. Becoming more and more important for server computing, the kernel and C li-
brary were modified to support file sizes larger than 2 GB when using a new set of in-
terfaces that applications must use. Today, almost all major file systems offer LFS
support, allowing you to perform high-end computing. Table 25.2, “Maximum Sizes
of File Systems (On-Disk Format)” (page 477) offers an overview of the current limita-
tions of Linux files and file systems.

Table 25.2 Maximum Sizes of File Systems (On-Disk Format)

File System File Size (Bytes) File System Size


(Bytes)

Ext2 or Ext3 (1 KB block size) 234 (16 GB) 241 (2 TB)

Ext2 or Ext3 (2 KB block size) 238 (256 GB) 243 (8 TB)

Ext2 or Ext3 (4 KB block size) 241 (2 TB) 243-4096 (16 TB-4096


Bytes)

Ext2 or Ext3 (8 KB block size) 246 (64 TB) 245 (32 TB)
(systems with 8 KB pages, like
Alpha)

ReiserFS v3 246 (64 TB) 245 (32 TB)

File Systems in Linux 477


File System File Size (Bytes) File System Size
(Bytes)

XFS 263 (8 EB) 263 (8 EB)

NFSv2 (client side) 231 (2 GB) 263 (8 EB)

NFSv3 (client side) 263 (8 EB) 263 (8 EB)

IMPORTANT: Linux Kernel Limits

Table 25.2, “Maximum Sizes of File Systems (On-Disk Format)” (page 477) de-
scribes the limitations regarding the on-disk format. The 2.6 kernel imposes its
own limits on the size of files and file systems handled by it. These are as follows:

File Size
41
On 32-bit systems, files may not exceed the size of 2 TB (2 bytes).

File System Size


73
File systems may be up to 2 bytes in size. However, this limit is still out
of reach for the currently available hardware.

25.5 For More Information


Each of the file system projects described above maintains its own home page on which
to find mailing list information, further documentation, and FAQs.

• http://e2fsprogs.sourceforge.net/

• http://www.zipworld.com.au/~akpm/linux/ext3/

• http://www.namesys.com/

• http://oss.sgi.com/projects/xfs/

• http://oss.oracle.com/projects/ocfs2/

478 Installation and Administration


A comprehensive multipart tutorial about Linux file systems can be found at IBM de-
veloperWorks: http://www-106.ibm.com/developerworks/library/
l-fs.html. A very in-depth comparison of file systems (not only Linux file systems)
is available from the Wikipedia project http://en.wikipedia.org/wiki/
Comparison_of_file_systems#Comparison.

File Systems in Linux 479


The X Window System
The X Window System (X11) is the de facto standard for graphical user interfaces in
26
UNIX. X is network-based, enabling applications started on one host to be displayed
on another host connected over any kind of network (LAN or Internet). The X Window
System environment is very configurable. It additionally provides access to fonts in
SUSE Linux Enterprise®.

TIP: IBM System z: Configuring the Graphical User Interface

IBM System z do not have any input and output devices supported by X.Org.
Therefore, none of the configuration procedures described in this section apply.
Find more relevant information for IBM System z in Section 8.6, “Network De-
vices” (page 159).

26.1 Manually Configuring the X


Window System
By default, the X Window System is configured with the SaX2 interface, described in
Section 8.14, “SaX2” (page 186). Alternatively it can be configured manually by editing
the its configuration files.

The X Window System 481


WARNING: Faulty X Configurations Can Damage Your Hardware

Be very careful when configuring your X Window System. Never start the X
Window System until the configuration is finished. A wrongly configured system
can cause irreparable damage to your hardware (this applies especially to fixed-
frequency monitors). The creators of this book and SUSE Linux Enterprise
cannot be held responsible for any resulting damage. This information has been
carefully researched, but this does not guarantee that all methods presented
here are correct and cannot damage your hardware.

The commands sax2 and X -configure create the file /etc/X11/xorg.conf.


This is the primary configuration file for the X Window System. Find all the settings
here concerning your graphics card, mouse, and monitor.

IMPORTANT: Using X -configure

Use X -configure to configure your X setup if previous tries with SUSE


Linux Enterprise's SaX2 have failed. If your setup involves proprietary binary-
only drivers, X -configure cannot work.

The following sections describe the structure of the configuration file /etc/X11/
xorg.conf. It consists of several sections, each one dealing with a certain aspect of
the configuration. Each section starts with the keyword Section <designation>
and ends with EndSection. The following convention applies to all sections:

Section designation
entry 1
entry 2
entry n
EndSection

The section types available are listed in Table 26.1, “Sections in /etc/X11/xorg.conf”
(page 483).

482 Installation and Administration


Table 26.1 Sections in /etc/X11/xorg.conf

Type Meaning

Files The paths used for fonts and the RGB color table.

ServerFlags General switches.

Module A list of modules the server should load.

InputDevice Input devices, like keyboard, mouse, and special input devices
(touchpads, joysticks, etc.), are configured in this section. Impor-
tant parameters in this section are Driver and the options
defining the Protocol and Device.

Monitor The monitor used. The individual elements of this section are
the name, which is referred to later in the Screen definition,
the Bandwidth, and the synchronization frequency limits
(HorizSync and VertRefresh). Settings are given in MHz,
kHz, and Hz. Normally, the server refuses any modeline that
does not correspond with the specification of the monitor. This
prevents too high frequencies from being sent to the monitor by
accident.

Modes The modeline parameters for the specific screen resolutions.


These parameters can be calculated by SaX2 on the basis of the
values given by the user and normally do not need to be changed.
Intervene manually at this point if, for example, you want to
connect a fixed frequency monitor. Find details of the meaning
of individual number values in the HOWTO files in /usr/
share/doc/howto/en/html/
XFree86-Video-Timings-HOWTO (the package
howtoenh must be installed).

Device A specific graphics card. It is referenced by its descriptive name.

Screen Combines a Monitor and a Device to form all the necessary


settings for X.Org. In the Display subsection, specify the size

The X Window System 483


Type Meaning

of the virtual screen (Virtual), the ViewPort, and the


Modes used with this screen.

ServerLayout The layout of a single or multihead configuration. Binds the input


devices InputDevice and the display devices Screen.

DRI Provides information for the Direct Rendering Infrastructure


(DRI).

Monitor, Device, and Screen are explained in more detail. Further information
about the other sections can be found in the manual pages of X.Org and xorg.conf.

There can be several different Monitor and Device sections in xorg.conf. Even
multiple Screen sections are possible. The following ServerLayout section deter-
mines which one is used.

26.1.1 Screen Section


The screen section combines a monitor with a device section and determines the reso-
lution and color depth to use. A screen section might resemble Example 26.1, “Screen
Section of the File /etc/X11/xorg.conf” (page 485).

484 Installation and Administration


Example 26.1 Screen Section of the File /etc/X11/xorg.conf

Section "Screen"❶
DefaultDepth 16❷
SubSection "Display"❸
Depth 16❹
Modes "1152x864" "1024x768" "800x600"❺
Virtual 1152x864❻
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024"
EndSubSection
SubSection "Display"
Depth 32
Modes "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"❼
Monitor "Monitor[0]"
EndSection

❶ Section determines the section's name, in this case, Screen.


❷ DefaultDepth determines the color depth to use by default unless another
color depth is explicitly specified.
❸ For each color depth, different Display sections are specified.
❹ Depth determines the color depth to use with this set of Display settings.
Possible values are 8, 15, 16, 24, and 32, although not all of these are supported
by all X server modules.
❺ The Modes section comprises a list of possible screen resolutions. The list is
checked by the X server from left to right. For each resolution, the X server
searches for a suitable Modeline in the Modes section. The Modeline depends
on the capability of both the monitor and the graphics card. The Monitor settings
determine the resulting Modeline.

The first resolution found is the Default mode. With Ctrl + Alt + + (on the
number pad), switch to the next resolution in the list to the right. With Ctrl + Alt
+ – (on the number pad), switch to the left. This enables you to vary the resolution
while X is running.

The X Window System 485


❻ The last line of the Display subsection with Depth 16 refers to the size of
the virtual screen. The maximum possible size of a virtual screen depends on the
amount of memory installed on the graphics card and the desired color depth, not
on the maximum resolution of the monitor. Because modern graphics cards have
a large amount of video memory, you can create very large virtual desktops.
However, you may no longer be able to use 3D functionality if you fill most of
the video memory with a virtual desktop. If the card has 16 MB video RAM, for
example, the virtual screen can be up to 4096x4096 pixels in size at 8-bit color
depth. Especially for accelerated cards, however, it is not recommended to use
all your memory for the virtual screen, because this memory on the card is also
used for several font and graphics caches.
❼ The Identifier line (here Screen[0]) gives this section a defined name
with which it can be uniquely referenced in the following ServerLayout sec-
tion. The lines Device and Monitor specify the graphics card and the monitor
that belong to this definition. These are just links to the Device and Monitor
sections with their corresponding names or identifiers. These sections are discussed
in detail below.

26.1.2 Device Section


A device section describes a specific graphics card. You can have as many device entries
in xorg.conf as you like, provided their names are differentiated using the keyword
Identifier. If you have more than one graphics card installed, the sections are
simply numbered in order. The first one is called Device[0], the second one
Device[1], and so on. The following file shows an excerpt from the Device section
of a computer with a Matrox Millennium PCI graphics card (as configured by SaX2):

Section "Device"
BoardName "MGA2064W"
BusID "0:19:0"❶
Driver "mga"❷
Identifier "Device[0]"
VendorName "Matrox"
Option "sw_cursor"
EndSection

❶ The BusID defines the PCI or AGP slot in which the graphics card is installed.
This matches the ID displayed by the command lspci. The X server needs details

486 Installation and Administration


in decimal form, but lspci displays these in hexadecimal form. The value of
BusID is automatically detected by SaX2.
❷ The value of Driver is automatically set by SaX2 and specifies which driver to
use for your graphics card. If the card is a Matrox Millennium, the driver module
is called mga. The X server then searches through the ModulePath defined in
the Files section in the drivers subdirectory. In a standard installation, this
is the /usr/X11R6/lib/modules/drivers or /usr/X11R6/lib64/
modules/driversdirectory. _drv.o is added to the name, so, in the case of
the mga driver, the driver file mga_drv.o is loaded.

The behavior of the X server or of the driver can also be influenced through additional
options. An example of this is the option sw_cursor, which is set in the device section.
This deactivates the hardware mouse cursor and depicts the mouse cursor using software.
Depending on the driver module, there are various options available, which can be
found in the description files of the driver modules in the directory /usr/share/
doc/package_name. Generally valid options can also be found in the manual pages
(man xorg.conf and man X.Org).

26.1.3 Monitor and Modes Section


Like the Device sections, the Monitor and Modes sections describe one monitor
each. The configuration file /etc/X11/xorg.conf can contain as many Monitor
sections as desired. The server layout section specifies which Monitor section is rel-
evant.

Monitor definitions should only be set by experienced users. The modelines constitute
an important part of the Monitor sections. Modelines set horizontal and vertical timings
for the respective resolution. The monitor properties, especially the allowed frequencies,
are stored in the Monitor section.

WARNING

Unless you have an in-depth knowledge of monitor and graphics card functions,
nothing should be changed in the modelines, because this could cause severe
damage to your monitor.

The X Window System 487


Those who try to develop their own monitor descriptions should be very familiar with
the documentation in /usr/X11R6/lib/X11/doc/ (the package xorg-x11-doc
must be installed).

Manual specification of modelines is rarely required today. If you are using a modern
multisync monitor, the allowed frequencies and optimal resolutions can, as a rule, be
read directly from the monitor by the X server via DDC, as described in the SaX2
configuration section. If this is not possible for some reason, use one of the VESA
modes included in the X server. This works with almost all graphics card and monitor
combinations.

26.2 Installing and Configuring Fonts


The installation of additional fonts in SUSE Linux Enterprise is very easy. Simply copy
the fonts to any directory located in the X11 font path (see Section 26.2.1, “X11 Core
Fonts” (page 489)). To enable use of the fonts, the installation directory should be a
subdirectory of the directories configured in /etc/fonts/fonts.conf (see Sec-
tion 26.2.2, “Xft” (page 490)) or be included into this file with /etc/fonts/
suse-font-dirs.conf.

The following is an excerpt from /etc/fonts/font.conf including /etc/


fonts/suse-fonts-dirs.conf:
<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/X11R6/lib/X11/fonts</dir>
<dir>/opt/kde3/share/fonts</dir>
<dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<dir>~/.fonts/kde-override</dir>
<include ignore_missing="yes">suse-font-dirs.conf</include>

/etc/fonts/suse-font-dirs.conf is automatically generated to pull in fonts


that ship with (mostly third party) applications like OpenOffice.org, Java or Adobe
Acrobat Reader. Some typical entries of /etc/fonts/suse-font-dirs.conf
would look like the following:
<dir>/usr/lib/ooo-2.0/share/fonts</dir>
<dir>/usr/lib/ooo-2.0/share/fonts/truetype</dir>
<dir>/usr/lib/jvm/java-1.5.0-sun-1.5.0_update10/jre/lib/fonts</dir>
<dir>/usr/X11R6/lib/Acrobat7/Resource/Font</dir>
<dir>/usr/X11R6/lib/Acrobat7/Resource/Font/PFM</dir>

488 Installation and Administration


To install additional fonts systemwide, manually copy the font files to a suitable direc-
tory (as root), such as /usr/share/fonts/truetype. Alternatively, the task
can be performed with the KDE font installer in the KDE Control Center. The result is
the same.

Instead of copying the actual fonts, you can also create symbolic links. For example,
you may want to do this if you have licensed fonts on a mounted Windows partition
and want to use them. Subsequently, run SuSEconfig --module fonts.

SuSEconfig --module fonts executes the script /usr/sbin/


fonts-config, which handles the configuration of the fonts. To see what this script
does, refer to the manual page of the script (man fonts-config).

The procedure is the same for bitmap fonts, TrueType and OpenType fonts, and Type1
(PostScript) fonts. All these font types can be installed in any directory.

X.Org contains two completely different font systems: the old X11 core font system
and the newly designed Xft and fontconfig system. The following sections briefly de-
scribe these two systems.

26.2.1 X11 Core Fonts


Today, the X11 core font system supports not only bitmap fonts but also scalable fonts,
like Type1 fonts, TrueType, and OpenType fonts. Scalable fonts are only supported
without antialiasing and subpixel rendering and the loading of large scalable fonts with
glyphs for many languages may take a long time. Unicode fonts are also supported, but
their use may be slow and require more memory.

The X11 core font system has a few inherent weaknesses. It is outdated and can no
longer be extended in a meaningful fashion. Although it must be retained for reasons
of backward compatibility, the more modern Xft and fontconfig system should be used
if at all possible.

For its operation, the X server needs to know which fonts are available and where in
the system it can find them. This is handled by a FontPath variable, which contains the
path to all valid system font directories. In each of these directories, a file named fonts
.dir lists the available fonts in this directory. The FontPath is generated by the X
server at start-up. It searches for a valid fonts.dir file in each of the FontPath
entries in the configuration file /etc/X11/xorg.conf. These entries are found in

The X Window System 489


the Files section. Display the actual FontPath with xset q. This path may also be
changed at runtime with xset. To add an additional path, use xset +fp <path>.
To remove an unwanted path, use xset -fp <path>.

If the X server is already active, newly installed fonts in mounted directories can be
made available with the command xset fp rehash. This command is executed by
SuSEconfig --module fonts. Because the command xset needs access to the
running X server, this only works if SuSEconfig --module fonts is started from
a shell that has access to the running X server. The easiest way to achieve this is to as-
sume root permissions by entering su and the root password. su transfers the access
permissions of the user who started the X server to the root shell. To check if the fonts
were installed correctly and are available by way of the X11 core font system, use the
command xlsfonts to list all available fonts.

By default, SUSE Linux Enterprise uses UTF-8 locales. Therefore, Unicode fonts should
be preferred (font names ending with iso10646-1 in xlsfonts output). All available
Unicode fonts can be listed with xlsfonts | grep iso10646-1. Nearly all
Unicode fonts available in SUSE Linux Enterprise contain at least the glyphs needed
for European languages (formerly encoded as iso-8859-*).

26.2.2 Xft
From the outset, the programmers of Xft made sure that scalable fonts including an-
tialiasing are supported well. If Xft is used, the fonts are rendered by the application
using the fonts, not by the X server as in the X11 core font system. In this way, the re-
spective application has access to the actual font files and full control of how the glyphs
are rendered. This constitutes the basis for the correct display of text in a number of
languages. Direct access to the font files is very useful for embedding fonts for printing
to make sure that the printout looks the same as the screen output.

In SUSE Linux Enterprise, the two desktop environments KDE and GNOME, Mozilla,
and many other applications already use Xft by default. Xft is already used by more
applications than the old X11 core font system.

Xft uses the fontconfig library for finding fonts and influencing how they are rendered.
The properties of fontconfig are controlled by the global configuration file /etc/
fonts/fonts.conf and the user-specific configuration file ~/.fonts.conf.
Each of these fontconfig configuration files must begin with

490 Installation and Administration


<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

and end with


</fontconfig>

To add directories to search for fonts, append lines such as the following:
<dir>/usr/local/share/fonts/</dir>

However, this is usually not necessary. By default, the user-specific directory ~/.fonts
is already entered in /etc/fonts/fonts.conf. Accordingly, all you need to do
to install additional fonts is to copy them to ~/.fonts.

You can also insert rules that influence the appearance of the fonts. For example, enter

<match target="font">
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>

to disable antialiasing for all fonts or

<match target="font">
<test name="family">
<string>Luxi Mono</string>
<string>Luxi Sans</string>
</test>
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>

to disable antialiasing for specific fonts.

By default, most applications use the font names sans-serif (or the equivalent
sans), serif, or monospace. These are not real fonts but only aliases that are re-
solved to a suitable font, depending on the language setting.

Users can easily add rules to ~/.fonts.conf to resolve these aliases to their favorite
fonts:

The X Window System 491


<alias>
<family>sans-serif</family>
<prefer>
<family>FreeSans</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>FreeSerif</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>FreeMono</family>
</prefer>
</alias>

Because nearly all applications use these aliases by default, this affects almost the entire
system. Thus, you can easily use your favorite fonts almost everywhere without having
to modify the font settings in the individual applications.

Use the command fc-list to find out which fonts are installed and available for use.
For instance, the command fc-list returns a list of all fonts. To find out which of
the available scalable fonts (:scalable=true) contain all glyphs required for Hebrew
(:lang=he), their font names (family), their style (style), their weight (weight),
and the name of the files containing the fonts, enter the following command:
fc-list ":lang=he:scalable=true" family style weight

The output of this command could look like the following:

FreeSansBold.ttf: FreeSans:style=Bold:weight=200
FreeMonoBoldOblique.ttf: FreeMono:style=BoldOblique:weight=200
FreeSerif.ttf: FreeSerif:style=Medium:weight=80
FreeSerifBoldItalic.ttf: FreeSerif:style=BoldItalic:weight=200
FreeSansOblique.ttf: FreeSans:style=Oblique:weight=80
FreeSerifItalic.ttf: FreeSerif:style=Italic:weight=80
FreeMonoOblique.ttf: FreeMono:style=Oblique:weight=80
FreeMono.ttf: FreeMono:style=Medium:weight=80
FreeSans.ttf: FreeSans:style=Medium:weight=80
FreeSerifBold.ttf: FreeSerif:style=Bold:weight=200
FreeSansBoldOblique.ttf: FreeSans:style=BoldOblique:weight=200
FreeMonoBold.ttf: FreeMono:style=Bold:weight=200

Important parameters that can be queried with fc-list:

492 Installation and Administration


Table 26.2 Parameters of fc-list

Parameter Meaning and Possible Values

family Name of the font family, for example, FreeSans.

foundry The manufacturer of the font, for example, urw.

style The font style, such as Medium, Regular, Bold,


Italic, or Heavy.

lang The language that the font supports, for example, de for
German, ja for Japanese, zh-TW for traditional Chinese,
or zh-CN for simplified Chinese.

weight The font weight, such as 80 for regular or 200 for bold.

slant The slant, usually 0 for none and 100 for italic.

file The name of the file containing the font.

outline true for outline fonts or false for other fonts.

scalable true for scalable fonts or false for other fonts.

bitmap true for bitmap fonts or false for other fonts.

pixelsize Font size in pixels. In connection with fc-list, this option


only makes sense for bitmap fonts.

26.3 For More Information


Install the packages xorg-x11-doc and howtoenh to get more in-depth information
about X11.

The X Window System 493


Authentication with PAM
Linux uses PAM (pluggable authentication modules) in the authentication process as
27
a layer that mediates between user and application. PAM modules are available on a
systemwide basis, so they can be requested by any application. This chapter describes
how the modular authentication mechanism works and how it is configured.

System administrators and programmers often want to restrict access to certain parts
of the system or to limit the use of certain functions of an application. Without PAM,
applications must be adapted every time a new authentication mechanism, such as
LDAP or SAMBA, is introduced. This process, however, is rather time-consuming and
error-prone. One way to avoid these drawbacks is to separate applications from the
authentication mechanism and delegate authentication to centrally managed modules.
Whenever a newly required authentication scheme is needed, it is sufficient to adapt
or write a suitable PAM module for use by the program in question.

Every program that relies on the PAM mechanism has its own configuration file in the
directory /etc/pam.d/programname. These files define the PAM modules used
for authentication. In addition, there are global configuration files for most PAM
modules under /etc/security, which define the exact behavior of these modules
(examples include pam_env.conf, pam_pwcheck.conf, pam_unix2.conf,
and time.conf). Every application that uses a PAM module actually calls a set of
PAM functions, which then process the information in the various configuration files
and return the result to the calling application.

Authentication with PAM 495


27.1 Structure of a PAM
Configuration File
Each line in a PAM configuration file contains a maximum of four columns:
<Type of module> <Control flag> <Module path> <Options>

PAM modules are processed as stacks. Different types of modules have different pur-
poses, for example, one module checks the password, another one verifies the location
from which the system is accessed, and yet another one reads user-specific settings.
PAM knows about four different types of modules:

auth
The purpose of this type of module is to check the user's authenticity. This is tradi-
tionally done by querying a password, but it can also be achieved with the help of
a chip card or through biometrics (fingerprints or iris scan).

account
Modules of this type check whether the user has general permission to use the re-
quested service. As an example, such a check should be performed to ensure that
no one can log in under the username of an expired account.

password
The purpose of this type of module is to enable the change of an authentication
token. In most cases, this is a password.

session
Modules of this type are responsible for managing and configuring user sessions.
They are started before and after authentication to register login attempts in system
logs and configure the user's specific environment (mail accounts, home directory,
system limits, etc.).

The second column contains control flags to influence the behavior of the modules
started:

required
A module with this flag must be successfully processed before the authentication
may proceed. After the failure of a module with the required flag, all other

496 Installation and Administration


modules with the same flag are processed before the user receives a message about
the failure of the authentication attempt.

requisite
Modules having this flag must also be processed successfully, in much the same
way as a module with the required flag. However, in case of failure a module
with this flag gives immediate feedback to the user and no further modules are
processed. In case of success, other modules are subsequently processed, just like
any modules with the required flag. The requisite flag can be used as a
basic filter checking for the existence of certain conditions that are essential for a
correct authentication.

sufficient
After a module with this flag has been successfully processed, the calling application
receives an immediate message about the success and no further modules are pro-
cessed, provided there was no preceding failure of a module with the required
flag. The failure of a module with the sufficient flag has no direct conse-
quences, in the sense that any subsequent modules are processed in their respective
order.

optional
The failure or success of a module with this flag does not have any direct conse-
quences. This can be useful for modules that are only intended to display a message
(for example, to tell the user that mail has arrived) without taking any further action.

include
If this flag is given, the file specified as argument is inserted at this place.

The module path does not need to be specified explicitly, as long as the module is lo-
cated in the default directory /lib/security (for all 64-bit platforms supported by
SUSE Linux Enterprise®, the directory is /lib64/security). The fourth column
may contain an option for the given module, such as debug (enables debugging) or
nullok (allows the use of empty passwords).

27.2 The PAM Configuration of sshd


To show how the theory behind PAM works, consider the PAM configuration of sshd
as a practical example:

Authentication with PAM 497


Example 27.1 PAM Configuration for sshd

#%PAM-1.0
auth include common-auth
auth required pam_nologin.so
account include common-account
password include common-password
session include common-session
# Enable the following line to get resmgr support for
# ssh sessions (see /usr/share/doc/packages/resmgr/README.SuSE)
#session optional pam_resmgr.so fake_ttyname

The typical PAM configuration of an application (sshd, in this case) contains four include
statements referring to the configuration files of four module types: common-auth,
common-account, common-password, and common-session. These four
files hold the default configuration for each module type. By including them instead of
calling each module separately for each PAM application, automatically get an updated
PAM configuration if the administrator changes the defaults. In former times, you had
to adjust all configuration files manually for all applications when changes to PAM
occurred or a new application was installed. Now the PAM configuration is made with
central configuration files and all changes are automatically inherited by the PAM
configuration of each service.

The first include file (common-auth) calls two modules of the auth type: pam_env
and pam_unix2. See Example 27.2, “Default Configuration for the auth Section”
(page 498).

Example 27.2 Default Configuration for the auth Section

auth required pam_env.so


auth required pam_unix2.so

The first one, pam_env, loads the file /etc/security/pam_env.conf to set


the environment variables as specified in this file. This can be used to set the DISPLAY
variable to the correct value, because the pam_env module knows about the location
from which the login is taking place. The second one, pam_unix2, checks the user's
login and password against /etc/passwd and /etc/shadow.

After the modules specified in common-auth have been successfully called, a third
module called pam_nologin checks whether the file /etc/nologin exists. If it
does, no user other than root may log in. The whole stack of auth modules is pro-
cessed before sshd gets any feedback about whether the login has succeeded. Given

498 Installation and Administration


that all modules of the stack have the required control flag, they must all be processed
successfully before sshd receives a message about the positive result. If one of the
modules is not successful, the entire module stack is still processed and only then is
sshd notified about the negative result.

As soon as all modules of the auth type have been successfully processed, another
include statement is processed, in this case, that in Example 27.3, “Default Configuration
for the account Section” (page 499). common-account contains just one module,
pam_unix2. If pam_unix2 returns the result that the user exists, sshd receives a
message announcing this success and the next stack of modules (password) is pro-
cessed, shown in Example 27.4, “Default Configuration for the password Section”
(page 499).

Example 27.3 Default Configuration for the account Section

account required pam_unix2.so

Example 27.4 Default Configuration for the password Section

password required pam_pwcheck.so nullok


password required pam_unix2.so nullok use_first_pass use_authtok
#password required pam_make.so /var/yp

Again, the PAM configuration of sshd involves just an include statement referring to
the default configuration for password modules located in common-password.
These modules must successfully be completed (control flag required) whenever
the application requests the change of an authentication token. Changing a password
or another authentication token requires a security check. This is achieved with the pam
_pwcheck module. The pam_unix2 module used afterwards carries over any old
and new passwords from pam_pwcheck, so the user does not need to authenticate
again. This also makes it impossible to circumvent the checks carried out by pam
_pwcheck. The modules of the password type should be used wherever the preceding
modules of the account or the auth type are configured to complain about an expired
password.

Example 27.5 Default Configuration for the session Section

session required pam_limits.so


session required pam_unix2.so

Authentication with PAM 499


As the final step, the modules of the session type, bundled in the common-session
file are called to configure the session according to the settings for the user in question.
Although pam_unix2 is processed again, it has no practical consequences due to its
none option specified in the respective configuration file of this module, pam_unix2
.conf. The pam_limits module loads the file /etc/security/limits.conf,
which may define limits on the use of certain system resources. The session modules
are called a second time when user logs out.

27.3 Configuration of PAM Modules


Some of the PAM modules are configurable. The corresponding configuration files are
located in /etc/security. This section briefly describes the configuration files
relevant to the sshd example—pam_unix2.conf, pam_env.conf, pam_pwcheck
.conf, and limits.conf.

27.3.1 pam_unix2.conf
The traditional password-based authentication method is controlled by the PAM module
pam_unix2. It can read the necessary data from /etc/passwd, /etc/shadow,
NIS maps, NIS+ tables, or an LDAP database. The behavior of this module can be in-
fluenced by configuring the PAM options of the individual application itself or globally
by editing /etc/security/pam_unix2.conf. A very basic configuration file
for the module is shown in Example 27.6, “pam_unix2.conf” (page 500).

Example 27.6 pam_unix2.conf


auth: nullok
account:
password: nullok
session: none

The nullok option for module types auth and password specifies that empty
passwords are permitted for the corresponding type of account. Users are also allowed
to change passwords for their accounts. The none option for the module type session
specifies that no messages are logged on its behalf (this is the default). Learn about
additional configuration options from the comments in the file itself and from the
manual page pam_unix2(8).

500 Installation and Administration


27.3.2 pam_env.conf
This file can be used to define a standardized environment for users that is set whenever
the pam_env module is called. With it, preset environment variables using the following
syntax:
VARIABLE [DEFAULT=[value]] [OVERRIDE=[value]]

VARIABLE
Name of the environment variable to set.

[DEFAULT=[value]]
Default value the administrator wants set.

[OVERRIDE=[value]]
Values that may be queried and set by pam_env, overriding the default value.

A typical example of how pam_env can be used is the adaptation of the DISPLAY
variable, which is changed whenever a remote login takes place. This is shown in Ex-
ample 27.7, “pam_env.conf” (page 501).

Example 27.7 pam_env.conf

REMOTEHOST DEFAULT=localhost OVERRIDE=@{PAM_RHOST}


DISPLAY DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}

The first line sets the value of the REMOTEHOST variable to localhost, which is
used whenever pam_env cannot determine any other value. The DISPLAY variable
in turn contains the value of REMOTEHOST. Find more information in the comments
in the file /etc/security/pam_env.conf.

27.3.3 pam_pwcheck.conf
This configuration file is for the pam_pwcheck module, which reads options from it
for all password type modules. Settings stored in this file take precedence over the
PAM settings of an individual application. If application-specific settings have not been
defined, the application uses the global settings. Example 27.8, “pam_pwcheck.conf”
(page 502) tells pam_pwcheck to allow empty passwords and modification of pass-
words. More options for the module are mentioned in the file /etc/security/pam
_pwcheck.conf.

Authentication with PAM 501


Example 27.8 pam_pwcheck.conf
password: nullok

27.3.4 limits.conf
System limits can be set on a user or group basis in the file limits.conf, which is
read by the pam_limits module. The file allows you to set hard limits, which may
not be exceeded at all, and soft limits, which may be exceeded temporarily. To learn
about the syntax and the available options, read the comments included in the file.

27.4 For More Information


In the directory /usr/share/doc/packages/pam of your installed system, find
the following additional documentation:

READMEs
In the top level of this directory, there are some general README files. The sub-
directory modules holds README files about the available PAM modules.

The Linux-PAM System Administrators' Guide


This document includes everything that a system administrator should know about
PAM. It discusses a range of topics, from the syntax of configuration files to the
security aspects of PAM. The document is available as a PDF file, in HTML format,
and as plain text.

The Linux-PAM Module Writers' Manual


This document summarizes the topic from the developer's point of view, with in-
formation about how to write standard-compliant PAM modules. It is available as
a PDF file, in HTML format, and as plain text.

The Linux-PAM Application Developers' Guide


This document includes everything needed by an application developer who wants
to use the PAM libraries. It is available as a PDF file, in HTML format, and as
plain text.

Thorsten Kukuk has developed a number of PAM modules and made some information
available about them at http://www.suse.de/~kukuk/pam/.

502 Installation and Administration


Power Management
Power management is especially important on laptop computers, but is also useful on
28
other systems. Two technologies are available: APM (advanced power management)
and ACPI (advanced configuration and power interface). In addition to these, it is also
possible to control CPU frequency scaling to save power or decrease noise. These options
can be configured manually or using a special YaST module.

►zseries: The features and hardware described in this chapter do not exist on IBM
System z, making this chapter irrelevant for these platforms. ◄

Unlike APM, which was previously used on laptops for power management only, the
hardware information and configuration tool ACPI is available on all modern computers
(laptops, desktops, and servers). All power management technologies require suitable
hardware and BIOS routines. Most laptops and many modern desktops and servers
meet these requirements.

APM had been used in many older computers. Because APM largely consists of a
function set implemented in the BIOS, the level of APM support may vary depending
on the hardware. This is even more true of ACPI, which is even more complex. For
this reason, it is virtually impossible to recommend one over the other. Simply test the
various procedures on your hardware then select the technology that is best supported.

IMPORTANT: Power Management for AMD64 Processors

AMD64 processors with a 64-bit kernel only support ACPI.

Power Management 503


28.1 Power Saving Functions
Power saving functions are not only significant for the mobile use of laptops, but also
for desktop systems. The main functions and their use in the power management systems
APM and ACPI are:

Standby
This operating mode turns off the display. On some computers, the processor per-
formance is throttled. This function is not available in all APM implementations.
This function corresponds to the ACPI state S1 or S2.

Suspend (to memory)


This mode writes the entire system state to the RAM. Subsequently, the entire
system except the RAM is put to sleep. In this state, the computer consumes very
little power. The advantage of this state is the possibility of resuming work at the
same point within a few seconds without having to boot and restart applications.
Devices using APM can usually be suspended by closing the lid and activated by
opening it. This function corresponds to the ACPI state S3. The support of this
state is still under development and therefore largely depends on the hardware.

Hibernation (suspend to disk)


In this operating mode, the entire system state is written to the hard disk and the
system is powered off. There must be a swap partition at least as big as the RAM
to write all the active data. Reactivation from this state takes about 30 to 90 seconds.
The state prior to the suspend is restored. Some manufacturers offer useful hybrid
variants of this mode, such as RediSafe in IBM Thinkpads. The corresponding
ACPI state is S4. In Linux, suspend to disk is performed by kernel routines that
are independent from APM and ACPI.

Battery Monitor
ACPI and APM check the battery charge status and provide information about it.
Additionally, both systems coordinate actions to perform when a critical charge
status is reached.

Automatic Power-Off
Following a shutdown, the computer is powered off. This is especially important
when an automatic shutdown is performed shortly before the battery is empty.

504 Installation and Administration


Shutdown of System Components
Switching off the hard disk is the greatest single aspect of the power saving potential
of the overall system. Depending on the reliability of the overall system, the hard
disk can be put to sleep for some time. However, the risk of losing data increases
with the duration of the sleep periods. Other components, like PCI devices that can
be put into a special power saving mode, can be deactivated with ACPI (at least
theoretically) or permanently disabled in the BIOS setup.

Processor Speed Control


In connection with the CPU, energy can be saved in three different ways: frequency
and voltage scaling (also known as PowerNow! or Speedstep), throttling, and
putting the processor to sleep (C states). Depending on the operating mode of the
computer, these methods can also be combined.

28.2 APM
Some of the power saving functions are performed by the APM BIOS itself. On many
laptops, standby and suspend states can be activated with key combinations or by
closing the lid without any special operating system function. However, to activate
these modes with a command, certain actions must be triggered before the system is
suspended. To view the battery charge level, you need special program packages and
a suitable kernel.

SUSE Linux Enterprise® kernels have built-in APM support. However, APM is only
activated if ACPI is not implemented in the BIOS and an APM BIOS is detected. To
activate APM support, ACPI must be disabled with acpi=off at the boot prompt.
Enter cat /proc/apm to check if APM is active. An output consisting of various
numbers indicates that everything is OK. You should now be able to shut down the
computer with the command shutdown -h.

BIOS implementations that are not fully standard-compliant can cause problems with
APM. Some problems can be circumvented with special boot parameters. All parameters
are entered at the boot prompt in the form of apm=parameter with parameter
being one of:

Power Management 505


on or off
Enable or disable APM support.

(no-)allow-ints
Allow interrupts during the execution of BIOS functions.

(no-)broken-psr
The “GetPowerStatus” function of the BIOS does not work properly.

(no-)realmode-power-off
Reset processor to real mode prior to shutdown.

(no-)debug
Log APM events in system log.

(no-)power-off
Power system off after shutdown.

bounce-interval=n
Time in hundredths of a second after a suspend event during which additional
suspend events are ignored.

idle-threshold=n
System inactivity percentage from which the BIOS function idle is executed
(0=always, 100=never).

idle-period=n
Time in hundredths of a second after which the system activity is measured.

The APM daemon (apmd) is no longer used. Its functionality is now handled by the
new powersaved, which also supports ACPI and provides many other features.

506 Installation and Administration


28.3 ACPI
ACPI (advanced configuration and power interface) was designed to enable the operating
system to set up and control the individual hardware components. ACPI supersedes
both PnP and APM. It delivers information about the battery, AC adapter, temperature,
fan, and system events, like “close lid” or “battery low.”

The BIOS provides tables containing information about the individual components and
hardware access methods. The operating system uses this information for tasks like
assigning interrupts or activating and deactivating components. Because the operating
system executes commands stored in the BIOS, the functionality depends on the BIOS
implementation. The tables ACPI can detect and load are reported in /var/log/boot
.msg. See Section 28.3.4, “Troubleshooting” (page 512) for more information about
troubleshooting ACPI problems.

28.3.1 ACPI in Action


If the kernel detects an ACPI BIOS when the system is booted, ACPI is activated auto-
matically and APM is deactivated. The boot parameter acpi=force may be necessary
for some older machines. The computer must support ACPI 2.0 or later. Check the
kernel boot messages in /var/log/boot.msg to see if ACPI was activated.

Subsequently, a number of modules must be loaded. This is done by the start script of
acpid. If any of these modules cause problems, the respective module can be excluded
from loading or unloading in /etc/sysconfig/powersave/common. The system
log (/var/log/messages) contains the messages of the modules, enabling you to
see which components were detected.

/proc/acpi now contains a number of files that provide information about the system
state or can be used to change some of the states. Some features do not work yet because
they are still under development and the support of some functions largely depends on
the implementation of the manufacturer.

All files (except dsdt and fadt) can be read with cat. In some files, settings can be
modified with echo, for example, echo X > file to specify suitable values for
X. One possibility for easy access to those values is the powersave command, which
acts as a front-end for the Powersave daemon. The following describes the most impor-
tant files:

Power Management 507


/proc/acpi/info
General information about ACPI.

/proc/acpi/alarm
Here, specify when the system should wake from a sleep state. Currently, this feature
is not fully supported.

/proc/acpi/sleep
Provides information about possible sleep states.

/proc/acpi/event
All events are reported here and processed by the Powersave daemon
(powersaved). If no daemon accesses this file, events, such as a brief click on
the power button or closing the lid, can be read with cat /proc/acpi/event
(terminate with Ctrl + C).

/proc/acpi/dsdt and /proc/acpi/fadt


These files contain the ACPI tables DSDT (differentiated system description table)
and FADT (fixed ACPI description table). They can be read with acpidmp,
acpidisasm, and dmdecode. These programs and their documentation are lo-
cated in the package pmtools. For example, acpidmp DSDT | acpidisasm.

/proc/acpi/ac_adapter/AC/state
Shows whether the AC adapter is connected.

/proc/acpi/battery/BAT*/{alarm,info,state}
Detailed information about the battery state. The charge level is read by comparing
the last full capacity from info with the remaining capacity
from state. A more comfortable way to do this is to use one of the special pro-
grams introduced in Section 28.3.3, “ACPI Tools” (page 512). The charge level at
which a battery event (such as warning, low and critical) is triggered can be specified
in alarm.

/proc/acpi/button
This directory contains information about various switches, like the laptop lid and
buttons.

/proc/acpi/fan/FAN/state
Shows if the fan is currently active. Activate or deactivate the fan manually by
writing 0 (on) or 3 (off) into this file. However, both the ACPI code in the kernel

508 Installation and Administration


and the hardware (or the BIOS) overwrite this setting when the system gets too
warm.

/proc/acpi/processor/*
A separate subdirectory is kept for each CPU included in your system.

/proc/acpi/processor/*/info
Information about the energy saving options of the processor.

/proc/acpi/processor/*/power
Information about the current processor state. An asterisk next to C2 indicates that
the processor is idle. This is the most frequent state, as can be seen from the usage
value.

/proc/acpi/processor/*/throttling
Can be used to set the throttling of the processor clock. Usually, throttling is possible
in eight levels. This is independent of the frequency control of the CPU.

/proc/acpi/processor/*/limit
If the performance (outdated) and the throttling are automatically controlled by a
daemon, the maximum limits can be specified here. Some of the limits are deter-
mined by the system. Some can be adjusted by the user.

/proc/acpi/thermal_zone/
A separate subdirectory exists for every thermal zone. A thermal zone is an area
with similar thermal properties whose number and names are designated by the
hardware manufacturer. However, many of the possibilities offered by ACPI are
rarely implemented. Instead, the temperature control is handled conventionally by
the BIOS. The operating system is not given much opportunity to intervene, because
the life span of the hardware is at stake. Therefore, some of the files only have a
theoretical value.

/proc/acpi/thermal_zone/*/temperature
Current temperature of the thermal zone.

/proc/acpi/thermal_zone/*/state
The state indicates if everything is ok or if ACPI applies active or passive
cooling. In the case of ACPI-independent fan control, this state is always ok.

Power Management 509


/proc/acpi/thermal_zone/*/cooling_mode
Select the cooling method controlled by ACPI. Choose from passive (less perfor-
mance, economical) or active cooling mode (full performance, fan noise).

/proc/acpi/thermal_zone/*/trip_points
Enables the determination of temperature limits for triggering specific actions, like
passive or active cooling, suspension (hot), or a shutdown (critical). The
possible actions are defined in the DSDT (device-dependent). The trip points deter-
mined in the ACPI specification are critical, hot, passive, active1, and
active2. Even if not all of them are implemented, they must always be entered
in this file in this order. For example, the entry echo 90:0:70:0:0 >
trip_points sets the temperature for critical to 90 and the temperature
for passive to 70 (all temperatures measured in degrees Celsius).

/proc/acpi/thermal_zone/*/polling_frequency
If the value in temperature is not updated automatically when the temperature
changes, toggle the polling mode here. The command echo X >
/proc/acpi/thermal_zone/*/polling_frequency causes the temper-
ature to be queried every X seconds. Set X=0 to disable polling.

None of these settings, information, and events need to be edited manually. This can
be done with the Powersave daemon (powersaved) and its various front-ends, like
powersave, kpowersave, and wmpowersave. See Section 28.3.3, “ACPI Tools”
(page 512).

28.3.2 Controlling the CPU Performance


The CPU can save energy in three ways. Depending on the operating mode of the
computer, these methods can be combined. Saving energy also means that the system
heats up less and the fans are activated less frequently.

Frequency and Voltage Scaling


PowerNow! and Speedstep are the designations AMD and Intel use for this tech-
nology. However, this technology is also applied in processors of other manufac-
turers. The clock frequency of the CPU and its core voltage are reduced at the same
time, resulting in more than linear energy savings. This means that when the fre-
quency is halved (half performance), far less than half of the energy is consumed.
This technology is independent from APM or ACPI. There are two main approaches
to performing CPU frequency scaling—by the kernel itself or by a userspace appli-

510 Installation and Administration


cation. Therefore, there are different kernel governors that can be set below /sys/
devices/system/cpu/cpu*/cpufreq/.

userspace governor
If the userspace governor is set, the kernel gives the control of CPU frequency
scaling to a userspace application, usually a daemon. In SUSE Linux Enterprise
distributions, this daemon is the powersaved package. When this implemen-
tation is used, the CPU frequency is adjusted in regard to the current system
load. By default, one of the kernel implementations is used. However, on some
hardware or in regard to specific processors or drivers, the userspace implemen-
tation is still the only working solution.

ondemand governor
This is the kernel implementation of a dynamic CPU frequency policy and
should work on most systems. As soon as there is a high system load, the CPU
frequency is immediately increased. It is lowered on a low system load.

conservative governor
This governor is similar to the ondemand implementation, except that a more
conservative policy is used. The load of the system must be high for a specific
amount of time before the CPU frequency is increased.

powersave governor
The cpu frequency is statically set to the lowest possible.

performance governor
The cpu frequency is statically set to the highest possible.

Throttling the Clock Frequency


This technology omits a certain percentage of the clock signal impulses for the
CPU. At 25% throttling, every fourth impulse is omitted. At 87.5%, only every
eighth impulse reaches the processor. However, the energy savings are a little less
than linear. Normally, throttling is only used if frequency scaling is not available
or to maximize power savings. This technology, too, must be controlled by a special
process. The system interface is /proc/acpi/processor/*/throttling.

Putting the Processor to Sleep


The operating system puts the processor to sleep whenever there is nothing to do.
In this case, the operating system sends the CPU a halt command. There are three
states: C1, C2, and C3. In the most economic state, C3, even the synchronization
of the processor cache with the main memory is halted. Therefore, this state can

Power Management 511


only be applied if no other device modifies the contents of the main memory via
bus master activity. Some drivers prevent the use of C3. The current state is dis-
played in /proc/acpi/processor/*/power.

Frequency scaling and throttling are only relevant if the processor is busy, because the
most economic C state is applied anyway when the processor is idle. If the CPU is busy,
frequency scaling is the recommended power saving method. Often the processor only
works with a partial load. In this case, it can be run with a lower frequency. Usually,
dynamic frequency scaling controlled by the kernel ondemand governor or a daemon,
such as powersaved, is the best approach. A static setting to a low frequency is useful
for battery operation or if you want the computer to be cool or quiet.

Throttling should be used as the last resort, for example, to extend the battery operation
time despite a high system load. However, some systems do not run smoothly when
they are throttled too much. Moreover, CPU throttling does not make sense if the CPU
has little to do.

In SUSE Linux Enterprise these technologies are controlled by the powersave daemon.
The configuration is explained in Section 28.5, “The powersave Package” (page 515).

28.3.3 ACPI Tools


The range of more or less comprehensive ACPI utilities includes tools that merely display
information, like the battery charge level and the temperature (acpi, klaptopdaemon,
wmacpimon, etc.), tools that facilitate the access to the structures in /proc/acpi or
that assist in monitoring changes (akpi, acpiw, gtkacpiw), and tools for editing the ACPI
tables in the BIOS (package pmtools).

28.3.4 Troubleshooting
There are two different types of problems. On one hand, the ACPI code of the kernel
may contain bugs that were not detected in time. In this case, a solution will be made
available for download. More often, however, the problems are caused by the BIOS.
Sometimes, deviations from the ACPI specification are purposely integrated in the
BIOS to circumvent errors in the ACPI implementation in other widespread operating
systems. Hardware components that have serious errors in the ACPI implementation
are recorded in a blacklist that prevents the Linux kernel from using ACPI for these
components.

512 Installation and Administration


The first thing to do when problems are encountered is to update the BIOS. If the
computer does not boot at all, one of the following boot parameters may be helpful:

pci=noacpi
Do not use ACPI for configuring the PCI devices.

acpi=ht
Only perform a simple resource configuration. Do not use ACPI for other purposes.

acpi=off
Disable ACPI.

WARNING: Problems Booting without ACPI

Some newer machines (especially SMP systems and AMD64 systems) need ACPI
for configuring the hardware correctly. On these machines, disabling ACPI can
cause problems.

Monitor the boot messages of the system with the command dmesg | grep -2i
acpi (or all messages, because the problem may not be caused by ACPI) after booting.
If an error occurs while parsing an ACPI table, the most important table—the DS-
DT—can be replaced with an improved version. In this case, the faulty DSDT of the
BIOS is ignored. The procedure is described in Section 28.5.4, “Troubleshooting”
(page 522).

In the kernel configuration, there is a switch for activating ACPI debug messages. If a
kernel with ACPI debugging is compiled and installed, experts searching for an error
can be supported with detailed information.

If you experience BIOS or hardware problems, it is always advisable to contact the


manufacturers. Especially if they do not always provide assistance for Linux, they
should be confronted with the problems. Manufacturers will only take the issue seriously
if they realize that an adequate number of their customers use Linux.

Power Management 513


For More Information
Additional documentation and help on ACPI:

• http://www.cpqlinux.com/acpi-howto.html (detailed ACPI HOWTO,


contains DSDT patches)

• http://www.intel.com/technology/iapc/acpi/faq.htm (ACPI
FAQ @Intel)

• http://acpi.sourceforge.net/ (the ACPI4Linux project at Sourceforge)

• http://www.poupinou.org/acpi/ (DSDT patches by Bruno Ducrot)

28.4 Rest for the Hard Disk


In Linux, the hard disk can be put to sleep entirely if it is not needed or it can be run in
a more economic or quieter mode. On modern laptops, you do not need to switch off
the hard disks manually, because they automatically enter an economic operating mode
whenever they are not needed. However, if you want to maximize power savings, test
some of the following methods. Most of the functions can be controlled with powersaved
and the YaST power management module, which is discussed in further detail in Sec-
tion 28.6, “The YaST Power Management Module” (page 524).

The hdparm application can be used to modify various hard disk settings. The option
-y instantly switches the hard disk to the standby mode. -Y puts it to sleep. hdparm
-S x causes the hard disk to be spun down after a certain period of inactivity. Replace
x as follows: 0 disables this mechanism, causing the hard disk to run continuously.
Values from 1 to 240 are multiplied by 5 seconds. Values from 241 to 251 correspond
to 1 to 11 times 30 minutes.

Internal power saving options of the hard disk can be controlled with the option -B.
Select a value from 0 to 255 for maximum saving to maximum throughput. The result
depends on the hard disk used and is difficult to assess. To make a hard disk quieter,
use the option -M. Select a value from 128 to 254 for quiet to fast.

Often, it is not so easy to put the hard disk to sleep. In Linux, numerous processes write
to the hard disk, waking it up repeatedly. Therefore, it is important to understand how
Linux handles data that needs to be written to the hard disk. First, all data is buffered

514 Installation and Administration


in the RAM. This buffer is monitored by the kernel update daemon (kupdated). When
the data reaches a certain age limit or when the buffer is filled to a certain degree, the
buffer content is flushed to the hard disk. The buffer size is dynamic and depends on
the size of the memory and the system load. By default, kupdated is set to short intervals
to achieve maximum data integrity. It checks the buffer every 5 seconds and notifies
the bdflush daemon when data is older than 30 seconds or the buffer reaches a fill level
of 30%. The bdflush daemon then writes the data to the hard disk. It also writes inde-
pendently from kupdated if, for instance, the buffer is full.

WARNING: Impairment of the Data Integrity

Changes to the kernel update daemon settings endanger the data integrity.

Apart from these processes, journaling file systems, like ReiserFS and Ext3, write their
metadata independently from bdflush, which also prevents the hard disk from spinning
down. To avoid this, a special kernel extension has been developed for mobile devices.
See /usr/src/linux/Documentation/laptop-mode.txt for details.

Another important factor is the way active programs behave. For example, good editors
regularly write hidden backups of the currently modified file to the hard disk, causing
the disk to wake up. Features like this can be disabled at the expense of data integrity.

In this connection, the mail daemon postfix makes use of the variable
POSTFIX_LAPTOP. If this variable is set to yes, postfix accesses the hard disk far
less frequently. However, this is irrelevant if the interval for kupdated was increased.

28.5 The powersave Package


The powersave package cares about all the previously-mentioned power saving
functions. Due to the increasing demand for lower energy consumption in general, some
of its features are also important on workstations and servers, such as suspend, standby,
or CPU frequency scaling.

This package contains all power management features of your computer. It supports
hardware using ACPI, APM, IDE hard disks, and PowerNow! or SpeedStep technologies.
The functions from the packages apmd, acpid, ospmd, and cpufreqd (now
cpuspeed) have been consolidated in the powersave package. Daemons from these

Power Management 515


packages, except acpid that acts as a multiplexer for ACPI events, should not be run
concurrently with the powersave daemon.

Even if your system does not contain all the hardware elements listed above, use the
powersave daemon for controlling the power saving function. Because ACPI and APM
are mutually exclusive, you can only use one of these systems on your computer. The
daemon automatically detects any changes in the hardware configuration.

28.5.1 Configuring the powersave Package


The configuration of powersave is distributed to several files. Every configuration option
listed there contains additional documentation about its functionality.

/etc/sysconfig/powersave/common
This file contains general settings for the powersave daemon. For example, the
amount of debug messages in /var/log/messages can be increased by increas-
ing the value of the variable DEBUG.

/etc/sysconfig/powersave/events
The powersave daemon needs this file for processing system events. An event can
be assigned external actions or actions performed by the daemon itself. For external
actions, the daemon tries to run an executable file (usually a Bash script) in /usr/
lib/powersave/scripts/. Predefined internal actions are:

• ignore

• throttle

• dethrottle

• suspend_to_disk

• suspend_to_ram

• standby

• do_suspend_to_disk

• do_suspend_to_ram

516 Installation and Administration


• do_standby

• notify

• screen_saver

• reread_cpu_capabilities

throttle slows down the processor by the value defined in MAX_THROTTLING.


This value depends on the current scheme. dethrottle sets the processor to full
performance. suspend_to_disk, suspend_to_ram, and standby trigger
the system event for a sleep mode. These three actions are generally responsible
for triggering the sleep mode, but they should always be associated with specific
system events.

The directory /usr/lib/powersave/scripts contains scripts for processing


events:

switch_vt
Useful if the screen is displaced after a suspend or standby.

wm_logout
Saves the settings and logs out from GNOME, KDE, or other window managers.

wm_shutdown
Saves the GNOME or KDE settings and shuts down the system.

set_disk_settings
Executes the disk settings made in /etc/sysconfig/powersave/disk.

If, for example, the variable


EVENT_GLOBAL_SUSPEND2DISK="prepare_suspend_to_disk
do_suspend_to_disk" is set, the two scripts or actions are processed in the
specified order as soon as the user gives powersaved the command for the sleep
mode suspend to disk. The daemon runs the external script /usr/lib/
powersave/scripts/prepare_suspend_to_disk. After this script has
been processed successfully, the daemon runs the internal action
do_suspend_to_disk and sets the computer to the sleep mode after the script
has unloaded critical modules and stopped services.

Power Management 517


The actions for the event of a sleep button could be modified as in
EVENT_BUTTON_SLEEP="notify suspend_to_disk". In this case, the
user is informed about the suspend by a pop-up window in X or a message on the
console. Subsequently, the event EVENT_GLOBAL_SUSPEND2DISK is generated,
resulting in the execution of the mentioned actions and a secure system suspend
mode. The internal action notify can be customized using the variable
NOTIFY_METHOD in /etc/sysconfig/powersave/common.

/etc/sysconfig/powersave/cpufreq
Contains variables for optimizing the dynamic CPU frequency settings and whether
the user space or the kernel implementation should be used.

/etc/sysconfig/powersave/battery
Contains battery limits and other battery-specific settings.

/etc/sysconfig/powersave/sleep
In this file, activate the sleep modes and determine which critical modules should
be unloaded and which services should be stopped prior to a suspend or standby
event. When the system is resumed, these modules are reloaded and the services
are restarted. You can even delay a triggered sleep mode, for example, to save files.
The default settings mainly concern USB and PCMCIA modules. A failure of
suspend or standby is usually caused by certain modules. See Section 28.5.4,
“Troubleshooting” (page 522) for more information about identifying the error.

/etc/sysconfig/powersave/thermal
Activates cooling and thermal control. Details about this subject are available in
the file /usr/share/doc/packages/powersave/README.thermal.

/etc/sysconfig/powersave/disk
This configuration file controls the actions and settings made regarding the hard
disk.

/etc/sysconfig/powersave/scheme_*
These are the various schemes that adapt the power consumption to certain deploy-
ment scenarios. A number of schemes are preconfigured and can be used as they
are. Custom schemes can be saved here.

518 Installation and Administration


28.5.2 Configuring APM and ACPI
Suspend and Standby
There are three basic ACPI sleep modes and two APM sleep modes:

Suspend to Disk (ACPI S4, APM suspend)


Saves the entire memory content to the hard disk. The computer is switched off
completely and does not consume any power. This sleep mode is enabled by default
and should work on all systems.

Suspend to RAM (ACPI S3, APM suspend)


Saves the states of all devices to the main memory. Only the main memory continues
consuming power. SUSE Linux Enterprise does not generally support this sleep
mode although you can use it for quite a number of machines.

This sleep mode is enabled by default, but it is only executed if the current machine
is listed in a database as capable of supporting this mode. This database is contained
in the /usr/sbin/s2ram binary provided by the suspend package.

To modify the default parameters (for example, to generally disable the suspend
to ram sleep mode or to force it even for machines not listed in the database),
find more information about available options in the /etc/sysconfig/
powersave/sleep configuration file.

To learn more about the s2ram binary, refer to the README files in /usr/
share/doc/packages/suspend.

Standby (ACPI S1, APM standby)


Switches some devices off (manufacturer-dependent).

Make sure that the following default options are set in the file /etc/sysconfig/
powersave/events for the correct processing of suspend, standby, and resume
(default settings following the installation of SUSE Linux Enterprise):

EVENT_GLOBAL_SUSPEND2DISK=
"prepare_suspend_to_disk screen_saver do_suspend_to_disk"
EVENT_GLOBAL_SUSPEND2RAM=
"prepare_suspend_to_ram screen_saver do_suspend_to_ram"
EVENT_GLOBAL_STANDBY=
"prepare_standby screen_saver do_standby"

Power Management 519


EVENT_GLOBAL_RESUME_SUSPEND2DISK=
"restore_after_suspend_to_disk"
EVENT_GLOBAL_RESUME_SUSPEND2RAM=
"restore_after_suspend_to_ram"
EVENT_GLOBAL_RESUME_STANDBY=
"restore_after_standby"

Custom Battery States


In the file /etc/sysconfig/powersave/battery, define three battery charge
levels (in percent) that trigger system alerts or specific actions when they are reached.

BATTERY_WARNING=12
BATTERY_LOW=7
BATTERY_CRITICAL=2

The actions or scripts to execute when the charge levels drop under the specified limits
are defined in the configuration file /etc/sysconfig/powersave/events.
The standard actions for buttons can be modified as described in Section 28.5.1,
“Configuring the powersave Package” (page 516).

EVENT_BATTERY_NORMAL="ignore"
EVENT_BATTERY_WARNING="notify"
EVENT_BATTERY_LOW="notify"
EVENT_BATTERY_CRITICAL="wm_shutdown"

Adapting Power Consumption to Various Conditions


The system behavior can be adapted to the type of power supply. The power consumption
of the system should be reduced when the system is disconnected from the AC power
supply and operated with the battery. Similarly, the performance should automatically
increase as soon as the system is connected to the AC power supply. The CPU frequency,
the power saving function of IDE, and a number of other parameters can be modified.

The actions to execute when the computer is disconnected from or connected to the AC
power supply are defined in /etc/sysconfig/powersave/events. Select the
schemes to use in /etc/sysconfig/powersave/common:

AC_SCHEME="performance"
BATTERY_SCHEME="powersave"

520 Installation and Administration


The schemes are stored in files in /etc/sysconfig/powersave. The filenames
are in the format scheme_name-of-the-scheme. The example refers to two
schemes: scheme_performance and scheme_powersave. performance,
powersave, presentation, and acoustic are preconfigured. Existing schemes
can be edited, created, deleted, or associated with different power supply states with
the help of the YaST power management module described in Section 28.6, “The YaST
Power Management Module” (page 524).

28.5.3 Additional ACPI Features


If you use ACPI, you can control the response of your system to ACPI buttons (power,
sleep, lid open, and lid closed). Configure execution of the actions in /etc/
sysconfig/powersave/events. Refer to this configuration file for an explanation
of the individual options.

EVENT_BUTTON_POWER="wm_shutdown"
When the power button is pressed, the system responds by shutting down the re-
spective window manager (KDE, GNOME, fvwm, etc.).

EVENT_BUTTON_SLEEP="suspend_to_disk"
When the sleep button is pressed, the system is set to the suspend-to-disk mode.

EVENT_BUTTON_LID_OPEN="ignore"
Nothing happens when the lid is opened.

EVENT_BUTTON_LID_CLOSED="screen_saver"
When the lid is closed, the screen saver is activated.

EVENT_OTHER="ignore"
This event happens if an unknown event is encountered by the daemon. Unknown
events include ACPI hot keys on some machines.

Further throttling of the CPU performance is possible if the CPU load does not exceed
a specified limit for a specified time. Specify the load limit in
PROCESSOR_IDLE_LIMIT and the time-out in CPU_IDLE_TIMEOUT. If the CPU
load stays below the limit longer than the time-out, the event configured in
EVENT_PROCESSOR_IDLE is activated. If the CPU is busy again,
EVENT_PROCESSOR_BUSY is executed.

Power Management 521


28.5.4 Troubleshooting
All error messages and alerts are logged in the file /var/log/messages. If you
cannot find the needed information, increase the verbosity of the messages of powersave
using DEBUG in the file /etc/sysconfig/powersave/common. Increase the
value of the variable to 7 or even 15 and restart the daemon. The more detailed error
messages in /var/log/messages should help you to find the error. The following
sections cover the most common problems with powersave.

ACPI Activated with Hardware Support but Functions


Do Not Work
If you experience problems with ACPI, use the command dmesg|grep -i acpi
to search the output of dmesg for ACPI-specific messages. A BIOS update may be
required to resolve the problem. Go to the home page of your laptop manufacturer, look
for an updated BIOS version, and install it. Ask the manufacturer to comply with the
latest ACPI specification. If the errors persist after the BIOS update, proceed as follows
to replace the faulty DSDT table in your BIOS with an updated DSDT:

1 Download the DSDT for your system from http://acpi.sourceforge


.net/dsdt/index.php. Check if the file is decompressed and compiled as
shown by the file extension .aml (ACPI machine language). If this is the case,
continue with step 3.

2 If the file extension of the downloaded table is .asl (ACPI source language),
compile it with iasl (package pmtools). Enter the command iasl -sa
file.asl. The latest version of iasl (Intel ACPI compiler) is available at
http://developer.intel.com/technology/iapc/acpi/
downloads.htm.

3 Copy the file DSDT.aml to any location (/etc/DSDT.aml is recommended).


Edit /etc/sysconfig/kernel and adapt the path to the DSDT file accord-
ingly. Start mkinitrd (package mkinitrd). Whenever you install the kernel
and use mkinitrd to create an initrd, the modified DSDT is integrated and
loaded when the system is booted.

522 Installation and Administration


CPU Frequency Does Not Work
Refer to the kernel sources (kernel-source) to see if your processor is supported.
You may need a special kernel module or module option to activate CPU frequency
control. This information is available in /usr/src/linux/Documentation/
cpu-freq/*. If a special module or module option is needed, configure it in the file
/etc/sysconfig/powersave/cpufreq by means of the variables
CPUFREQD_MODULE and CPUFREQD_MODULE_OPTS.

Suspend and Standby Do Not Work


ACPI systems may have problems with suspend and standby due to a faulty DSDT
implementation (BIOS). If this is the case, update the BIOS.

On ACPI and APM systems: When the system tries to unload faulty modules, the system
is arrested or the suspend event is not triggered. The same can also happen if you do
not unload modules or stop services that prevent a successful suspend. In both cases,
try to identify the faulty module that prevented the sleep mode. The log files generated
by the powersave daemon in /var/log/suspend2ram.log and /var/log/
suspend2disk.log are very helpful in this regard. If the computer does not enter
the sleep mode, the cause lies in the last module unloaded. Manipulate the following
settings in /etc/sysconfig/powersave/sleep to unload problematic modules
prior to a suspend or standby.

UNLOAD_MODULES_BEFORE_SUSPEND2DISK=""
UNLOAD_MODULES_BEFORE_SUSPEND2RAM=""
UNLOAD_MODULES_BEFORE_STANDBY=""
SUSPEND2DISK_RESTART_SERVICES=""
SUSPEND2RAM_RESTART_SERVICES=""
STANDBY_RESTART_SERVICES=""

If you use suspend or standby in changing network environments or in connection with


remotely mounted file systems, such as Samba and NIS, use automounter to mount
them or add the respective services, for example, smbfs or nfs, in the above-mentioned
variable. If an application accesses the remotely mounted file system prior to a suspend
or standby, the service cannot be stopped correctly and the file system cannot be un-
mounted properly. After resuming the system, the file system may be corrupt and must
be remounted.

Power Management 523


28.5.5 For More Information
• /usr/share/doc/packages/powersave—Local Powersave daemon
documentation

• http://powersave.sourceforge.net—Most recent Powersave daemon


documentation

• http://www.opensuse.org/Projects_Powersave—Project page in
the openSUSE wiki

28.6 The YaST Power Management


Module
The YaST power management module can configure all power management settings
already described. When started from the YaST Control Center with System > Power
Management, the first dialog of the module opens (see Figure 28.1, “Scheme Selection”
(page 524)).

Figure 28.1 Scheme Selection

524 Installation and Administration


In this dialog, select the schemes to use for battery operation and AC operation. To add
or modify the schemes, click Edit Schemes, which opens an overview of the existing
schemes like that shown in Figure 28.2, “Overview of Existing Schemes” (page 525).

Figure 28.2 Overview of Existing Schemes

In the scheme overview, select the scheme to modify then click Edit. To create a new
scheme, click Add. The dialog that opens is the same in both cases and is shown in
Figure 28.3, “Configuring a Scheme” (page 526).

Power Management 525


Figure 28.3 Configuring a Scheme

First, enter a suitable name and description for the new or edited scheme. Determine if
and how the CPU performance should be controlled for this scheme. Decide if and to
what extent frequency scaling and throttling should be used and whether processes with
low priority (niced processes) should be ignored when adjusting the CPU frequency.
In the following dialog for the hard disk, define a Standby Policy for maximum perfor-
mance or for energy saving. The Acoustic Policy controls the noise level of the hard
disk (supported by few hard disks). The Cooling Policy determines the cooling method
to use. Unfortunately, this type of thermal control is rarely supported by the BIOS.
Read /usr/share/doc/packages/powersave/powersave_manual.html
#Thermal to learn how you can use the fan and passive cooling methods.

Global power management settings can also be made from the initial dialog using Battery
Warning, ACPI Settings, or Suspend Permissions. Access these controls by clicking
Other Settings and selecting the appropriate item from the menu. Click Battery Warning
to access the dialog for the battery charge level, shown in Figure 28.4, “Battery Charge
Level” (page 527).

526 Installation and Administration


Figure 28.4 Battery Charge Level

The BIOS of your system notifies the operating system whenever the charge level drops
under certain configurable limits. In this dialog, define three limits: Warning Capacity,
Low Capacity, and Critical Capacity. Specific actions are triggered when the charge
level drops under these limits. Usually, the first two states merely trigger a notification
to the user. The third critical level triggers a shutdown, because the remaining energy
is not sufficient for continued system operation. Select suitable charge levels and the
desired actions then click OK to return to the start dialog.

Power Management 527


Figure 28.5 ACPI Settings

Access the dialog for configuring the ACPI buttons using ACPI Settings. It is shown
in Figure 28.5, “ACPI Settings” (page 528). The settings for the ACPI buttons determine
how the system should respond to certain switches. Configure the system response to
pressing the power button, pressing the sleep button, and closing the laptop lid. Click
OK to complete the configuration and return to the start dialog.

Click Enable Suspend to enter a dialog in which to determine if and how users of this
system may use the suspend or standby functionality. Click OK to return to the main
dialog. Click OK again to exit the module and confirm your power management settings.

528 Installation and Administration


Wireless Communication
Wireless LAN can be used to establish communication between your SUSE Linux
29
Enterprise® machines. This chapter introduces the principles of wireless networking
and the basic configuration for wireless networking.

29.1 Wireless LAN


Wireless LANs have become an indispensable aspect of mobile computing. Today,
most laptops have built-in WLAN cards. The 802.11 standard for the wireless commu-
nication of WLAN cards was prepared by the IEEE organization. Originally, this stan-
dard provided for a maximum transmission rate of 2 Mbit/s. Meanwhile, several sup-
plements have been added to increase the data rate. These supplements define details
such as the modulation, transmission output, and transmission rates:

Wireless Communication 529


Table 29.1 Overview of Various WLAN Standards

Name Band (GHz) Maximum Trans- Note


mission Rate
(Mbit/s)

802.11 2.4 2 Outdated; virtually no end


devices available

802.11b 2.4 11 Widespread

802.11a 5 54 Less common

802.11g 2.4 54 Backward-compatible with


11b

Additionally, there are proprietary standards, like the 802