Sie sind auf Seite 1von 297

This Manual is Compiled / Reprocessed

By

Pakistan Computer Bureau


Any intimation about the errors, omissions, or suggestions for its improvement would be highly appreciated

at info@pcb.gov.pk

PAKISTAN COMPUTER BUREAU


MINISTRY OF INFORMATION TECHNOLOGY
PAKISTAN

November, 2008
Table of Contents

1.Steps to Get You Started 1


1.1. Is Your Hardware Compatible? 1
1.2. Do You Have Enough Disk Space? 1
1.3. Can You Install Using the CD-ROM or DVD 1
1.3.1. Alternative Boot Methods 1
1.3.2. Making an Installation Boot CD-ROM 2
1.4. Preparing for a Hard Drive Installation 3
2. Installing on Intel® and AMD Systems 4
2.1. The Graphical Installation Program User Interface 4
2.1.1. A Note about Virtual Consoles 4
2.2. The Text Mode Installation Program User Interface 5
2.2.1. Using the Keyboard to Navigate 7
2.3. Starting the Installation Program 8
2.3.1. Booting the Installation Program on x86, AMD64, and
8
Intel® 64 Systems
2.3.2. Booting the Installation Program on Itanium Systems 9
2.3.3. Additional Boot Options 10
2.4. Selecting an Installation Method 12
2.5. Installing from DVD/CD-ROM 12
2.5.1. What If the IDE CD-ROM Was Not Found? 13
2.6. Installing from a Hard Drive 13
2.7. Welcome to Red Hat Enterprise Linux 14
2.8. Language Selection 15
2.9. Keyboard Configuration 16
2.10. Enter the Installation Number 17
2.11. Disk Partitioning Setup 18
2.12. Advanced Storage Options 20
2.13. Create Default Layout 21
2.14. Partitioning Your System 23
2.14.1. Graphical Display of Hard Drive(s) 23
2.14.2. Disk Druid's Buttons 23
I
2.14.3. Partition Fields 26
2.14.4. Recommended Partitioning Scheme 26
2.14.5. Adding Partitions 29
2.14.6. Editing Partitions 32
2.14.7. Deleting a Partition 32
2.15. x86, AMD64, and Intel® 64 Boot Loader Configuration 32
2.15.1. Advanced Boot Loader Configuration 34
2.15.2. Rescue Mode 36
2.15.3. Alternative Boot Loaders 36
2.15.4. SMP Motherboards and GRUB 37
2.16. Time Zone Configuration 37
2.17. Set Root Password 38
2.18. Package Group Selection 40
2.19. Preparing to Install 42
2.19.1. Prepare to Install 42
2.20. Installing Packages 43
2.21. Installation Complete 43
2.22. Itanium Systems — Booting Your Machine and Post-
43
Installation Setup
2.22.1. Post-Installation Boot Loader Options 44
2.22.2. Booting Red Hat Enterprise Linux Automatically 44
3. Removing Red Hat Enterprise Linux 46
4. Troubleshooting Installation on an Intel® or AMD System 48
4.1. You are Unable to Boot Red Hat Enterprise Linux 48
4.1.1. Are You Unable to Boot With Your RAID Card? 48
4.1.2. Is Your System Displaying Signal 11 Errors? 48
4.2. Trouble Beginning the Installation 49
4.2.1. Problems with Booting into the Graphical Installation 49
4.3. Trouble During the Installation 49
4.3.1. No devices found to install Red Hat Enterprise Linux
49
Error Message
4.3.2. Saving Traceback Messages Without a Diskette Drive 50
4.3.3. Trouble with Partition Tables 50
4.3.4. Using Remaining Space 50

II
4.3.5. Other Partitioning Problems 50
4.3.6. Other Partitioning Problems for Itanium System Users 51
4.3.7. Are You Seeing Python Errors? 51
4.4. Problems After Installation 52
4.4.1. Trouble With the Graphical GRUB Screen on an x86-
52
based System?
4.4.2. Booting into a Graphical Environment 52
4.4.3. Problems with the X Window System (GUI) 54
4.4.4. Problems with the X Server Crashing and Non-Root
54
Users
4.4.5. Problems When You Try to Log In 54
4.4.6. Is Your RAM Not Being Recognized? 55
4.4.7. Your Printer Does Not Work 56
4.4.8. Problems with Sound Configuration 56
4.4.9. Apache-based httpd service/Sendmail Hangs During
57
Startup
5. The GRUB Boot Loader 58
5.1. Boot Loaders and System Architecture 58
5.2. GRUB 58
5.2.1. GRUB and the x86 Boot Process 58
5.2.2. Features of GRUB 59
5.3. Installing GRUB 60
5.4. GRUB Terminology 61
5.4.1. Device Names 61
5.4.2. File Names and Block lists 62
5.4.3. The Root File System and GRUB 63
5.5. GRUB Interfaces 63
5.5.1. Interfaces Load Order 64
5.6. GRUB Commands 65
5.7. GRUB Menu Configuration File 67
5.7.1. Configuration File Structure 67
5.7.2. Configuration File Directives 67
5.8. Changing Run levels at Boot Time 69
5.9. Additional Resources 70
5.9.1. Installed Documentation 70
III
5.9.2. Useful Websites 70
6. Swap Space 71
6.1. What is Swap Space? 71
6.2. Adding Swap Space 72
6.2.1. Extending Swap on an LVM2 Logical Volume 72
6.2.2. Creating an LVM2 Logical Volume for Swap 72
6.2.3. Creating a Swap File. 73
6.3. Removing Swap Space 74
6.3.1. Reducing Swap on an LVM2 Logical Volume 74
6.3.2. Removing an LVM2 Logical Volume for Swap 74
6.3.3. Removing a Swap File 75
6.4. Moving Swap Space 75
7. Managing Disk Storage 76
7.1. Standard Partitions using parted 76
7.1.1. Viewing the Partition Table 77
7.1.2. Creating a Partition 78
7.1.3. Removing a Partition 80
7.1.4. Resizing a Partition 80
7.2. LVM Partition Management 81
8. Access Control Lists 84
8.1. Mounting File Systems 84
8.1.1. NFS 84
8.2. Setting Access ACLs 84
8.3. Setting Default ACLs 86
8.4. Retrieving ACLs 86
8.5. Archiving File Systems With ACLs 86
8.6. Compatibility with Older Systems 87
8.7. Useful Websites 87
9. Package Management with RPM 88
9.1. RPM Design Goals 88
9.2. Using RPM 90
9.2.1. Finding RPM Packages 90
9.2.2. Installing 90
IV
9.2.3. Uninstalling 93
9.2.4. Upgrading 93
9.2.5. Freshening 94
9.2.6. Querying 95
9.2.7. Verifying 96
9.3. Checking a Package's Signature 97
9.3.1. Importing Keys 98
9.3.2. Verifying Signature of Packages 98
9.4. Practical and Common Examples of RPM Usage 98
9.5. Additional Resources 100
9.5.1. Installed Documentation 100
9.5.2. Useful Websites 101
9.5.3. Related Books 101
10. Samba 102
10.1. Introduction to Samba 102
10.1.1. Samba Features 102
10.2. Samba Daemons and Related Services 103
10.2.1. Samba Daemons 103
11. Date and Time Configuration 104
11.1. Time and Date Properties 104
11.2. Network Time Protocol (NTP) Properties 105
11.3. Time Zone Configuration 106
12. The X Window System 107
12.1. The X11R7.1 Release 107
12.2. Desktop Environments and Window Managers 108
12.2.1. Desktop Environments 108
12.2.2. Window Managers 109
12.3. X Server Configuration Files 111
12.3.1. xorg.conf 111
12.4. Fonts 120
12.4.1. Fontconfig 121
12.4.2. Core X Font System 122
12.5. Runlevels and X 124

V
12.5.1. Runlevel 3 124
12.5.2. Runlevel 5 125
13. X Window System Configuration 127
13.1. Display Settings 127
13.2. Display Hardware Settings 127
13.3. Dual Head Display Settings 128
14. Users and Groups 130
14.1. User and Group Configuration 130
14.1.1. Adding a New User 131
14.1.2. Modifying User Properties 133
14.1.3. Adding a New Group 134
14.1.4. Modifying Group Properties 134
14.2. User and Group Management Tools 135
14.2.1. Command Line Configuration 135
14.2.2. Adding a User 135
14.2.3. Adding a Group 135
14.2.4. Password Aging 136
14.2.5. Explaining the Process 138
14.3. Standard Users 140
14.4. Standard Groups 141
14.5. User Private Groups 143
14.5.1. Group Directories 143
15. Open Office 146
15.1. Introduction to Open Office 146
15.1 System Requirements 146
15.2 How to Run 147
15.1 Starting Writer
148
15.1.1 From the system menu
148
15.2 Creating a Document
148
15.2 .1 Creating A Blank Document
148
15.2.2 Creating a Document from a Template
149
15.2.3 Creating a Document with an Autopilot
149
VI
15.3 Loading an Existing Document
149
15.4 Saving Document
149
15.4.1 Saving a Document
149
15.4.2 Saving As MS Word Document
150
15.5 Closing A Document
150
15.6 Exiting Writer
150
15.7 Formatting Documents
150
15.8 Cut, Copy and Paste
152
15.9 Inserting Pictures and Graphics
152
15.10 Draw Functions
154
15.11 Tables and Lists
156
15.12 Page and Section Breaks
158
15.13 Spell Check, Auto Correct and Word Count
158
15.14 Hyperlinks
160
15.15 Find/Replace
160
15.16 Print Preview/Printing
161
15.17 Navigator
162
15.18 Save as HTML
163
15.19 Tracking Changes
163
15.20 Versioning
164
16.1 What is Calc?
166
16.2 Spreadsheets, sheets and cells
166
16.3 Title bar and Menu bar
166
16.4 Toolbars
166
16.5 Formula bar
166
16.6 Individual cells
167
16.7 Starting new spreadsheets
167

VII
16.7.1 from the File menu
167
16.7.2 from the toolbar
167
16.7.3 from the keyboard
168
16.8 Opening existing spreadsheets
168
16.8.1 from the File menu
168
16.8.2 from the toolbar
168
16.8.3 from the keyboard
168
16.8.4 from a template
168
16.9 Saving spreadsheets
168
16.9.1 from the File menu
168
16.9.2 from the toolbar
168
16.9.3 from the keyboard
168
16.10 Navigating within spreadsheets
169
16.10.1 Going to a particular cell
169
16.10.1.1 Using the mouse
169
16.10.1.2 Using a cell reference
169
16.10.2.3 Using the Navigator
169
16.10.3 Moving from cell to cell
169
16.10.3.1 Using the Tab and Enter keys
169
16.10.3.2 Using the cursor keys
169
6.10.4 Moving from sheet to sheet
170
16.10.4.1Using the keyboard
170
16.10.4.2 Using the mouse
170
16.11 Selecting items in a sheet or spreadsheet
171
16.11.1 Selecting cells
171
16.11.2 Single cell
171
16.11.3 Range of contiguous cells
171

VIII
16.11.4 To select a range of cells by dragging the mouse
171
16.11.5 To select a range of cells without dragging the mouse
171
16.11.6 To select a range of cells without using the mouse
171
16.11.7 Range of non-contiguous cells
172
16.11.8 Selecting columns and rows
172
16.11.8.1 Single column
172
16.11.8.2 Single row
172
16.11.8.3 Multiple columns or rows
172
16.11.8.4 Entire sheet
172
16.12 Selecting sheets
172
16.12.1 Single sheet
172
16.12.2 Multiple contiguous sheets
172
16.12.3 Multiple non contiguous sheets
173
16.12.4 All sheets
173
16.13 Working with columns and rows
173
16.13.1 Inserting columns and rows
173
16.13.2 Single column or row
173
16.13.3 Multiple columns or rows
173
16.14 Deleting columns and rows
173
16.14.1 Single column or row
173
16.14.2 Multiple columns or rows
174
16.15 Working with sheets
174
16.15.1 Inserting new sheets
174
16.15.2 Deleting sheets
174
16.15.2.1 Single sheet
174
16.15.2.2 Multiple sheets
174
16.15.2.3 Renaming sheets
174

IX
16.16 Viewing Calc
175
16.16.1 Using the zoom function
175
16.17 Freezing/Unfreezing rows and columns
175
16.17.1 Freezing single rows or columns
176
16.17.2 Freezing a row and a column
176
16.17.3 Unfreezing
176
16.18 Splitting the window
176
16.18.1 To split the screen horizontally
176
16.18.2 To split the screen vertically
177
16.18.3 Removing split views
177
16.19 Entering data into a sheet
177
16.19.1 Entering numbers
177
16.19.2 Entering text
177
16.19.2.1 Entering numbers as text
177
16.19.3 Entering dates and times
178
16.19.4 Entering data into Calc
178
16.19.5 Inputting data
178
16.20 Moving between cells
178
16.20.1 Using the mouse
178
16.20.2 Using the arrow keys
178
16.20.3 Using the Enter key
178
16.21 Multiple lines of text
179
16.22 Wrapping text
179
16.23 Line breaks
179
16.24 Shrinking to fit cell
179
16.25 Editing data in Calc
179
16.26 Removing Data
179

X
16.26.1 Removing data from a cell
179
16.26.2 Removing data and formatting
179
16.27 Changing part of the data in a cell
180
16.27.1 Keyboard shortcut
180
16.27.2 Mouse
180
16.28 Formatting data in Calc
180
16.28.1 Numbers
180
16.28.2 Font
181
16.28.3 Font effects
181
16.29 Charts and Graphs
181
16.29.1 Creating a chart
181
16.30 Data range and labels
181
16.31 Chart, Axis Titles and Legend
182
16.32 A simple scatter plot
182
16.33 Moving and resizing a chart
183
16.34 Grid lines and background
183
16.35 Data labels
183
16.36 Printing a spreadsheet
183
16.37 Print options
184
16.38 Page breaks
184
16.39 Inserting a page break
184
16.39.1 To insert a page break
184
16.39.2 Row break
184
16.39.3 Column break
184
16.40 Deleting a page break
184
16.40.1 To remove a page break
184
16.41 Headers and footers
185

XI
16.41.1 Setting a header or a footer
185
16.41.2 Margin
185
16.42.3 Spacing
185
16.42.4 Height
185
16.42.5 Custom header
185
16.43 Inserting pictures
186
16.44 Mathematical functions
186
16.45 Statistical analysis functions
191
16.46 Date and time functions
199
16.47 Logical functions
202
16.48 Informational functions
203
16.49 Database functions
205
17.1 Introduction to Draw
208
17.2 The Workplace
208
17.3 The Toolbars
209
17.3.1 The Function Bar
209
17.3.2 The Object Bar
210
17.3.3 The Main Toolbar
210
17.3.4 The Color Bar
210
17.3.5 The Option Bar
212
17.3.6 The Rulers
212
17.3.7 The Status Bar
213
17.4 Drawing Basic Shapes
213
17.4.1 Drawing a segment of a straight line
213
17.4.2 Drawing a rectangle
216
17.4.3 Drawing a circle
216
17.4.4 The Texts
217

XII
17.4.5 Rectangles and Squares
218
17.4.6 Circles, Ellipses and Arcs
219
17.4.7 3D Objects
219
17.4.8 Curves
220
17.4.9 Lines and Arrows
221
17.5 Connectors
221
17.5.1 Connector toolbar
222
17.5.2 Editing Glue points
222
17.6 Selecting Objects
222
17.6.1 Direct selection
222
17.6.2 Selection by framing
222
17.6.3 Moving and Dynamically Adjusting the Size of an Object
223
17.6.4 Dynamic movement of objects
223
17.6.5 Dynamic size modification of objects
224
17.6.6 Rotating an Object
224
17.6.7 Inclination
225
17.6.8 Changing Object Attributes
225
17.7 Using the Stylist
225
17.7.1 Applying a Style
226
17.8 Special Transformations
226
17.9 3 D Rotation Objects
227
17.9.1 3D effects
227
17.10 The Bitmap Image Toolbar
227
17.11 Grouping and Combining Objects
227
17.12 Grouping & Combining Functions
228
17.12.1 Group by common selection
228
17.12.2 Maintaining groups and group dissociation
228

XIII
17.12.3 Combination Functions
228
17.13 Aligning Objects
229
17.14 Distribution of Objects
230
17.15 Managing Object Arrangement
231
17.16 Drawing Aid Tools
231
17.16.1 Zoom using the status bar
231
17.16.2 Zoom Toolbar
231
17.17 Managing Layers
232
17.18 Specific Functions
232
17.19 Duplication
232
18.1 Starting Open Office Impress
234
18.2 Custom or Empty Presentation
235
18.3 Normal View
236
18.4 Alternate Views
237
18.5 Design Templates and Images
240
18.5.1 Design Templates
241
18.6 Drawing Tools
242
18.7 Printing and Saving
246
18.7.1 To print the actual-size Impress presentation
246
18.7.2 Creating a PDF file
246
18.7.3 Saving as PowerPoint
247
18.7.4 Exporting as Alternate Formats
248
18.8 Displaying Your Presentation on the Web
248

16. End User Reference Manual Training Schedule(Day wise) 251

XIV
1.1. Is Your Hardware Compatible?
Hardware compatibility is particularly important if you have an older system or a
system that you built yourself. Red Hat Enterprise Linux 5 should be compatible
with most hardware in systems that were factory built within the last two years.
However, hardware specifications change almost daily, so it is difficult to
guarantee that your hardware is 100% compatible. The most recent list of
supported hardware can be found at:

• http://hardware.redhat.com/hcl/

1.2. Do You Have Enough Disk Space?


Nearly every modern-day operating system (OS) uses disk partitions, and Red
Hat Enterprise Linux is no exception. When you install Red Hat Enterprise
Linux, you may have to work with disk partitions.

The disk space used by Red Hat Enterprise Linux must be separate from the disk
space used by other OSes you may have installed on your system, such as
Windows, OS/2, or even a different version of Linux. For x86, AMD64, and
Intel® 64 systems, at least two partitions (/ and swap) must be dedicated to Red
Hat Enterprise Linux. For Itanium systems, at least three partitions (/, /boot/efi/,
and swap) must be dedicated to Red Hat Enterprise Linux.

Before you start the installation process, you must


• Have enough un partitioned disk space for the installation of Red Hat
Enterprise Linux, or
• Have one or more partitions that may be deleted, thereby freeing up enough
disk space to install Red Hat Enterprise Linux.

1.3. Can You Install Using the CD-ROM or DVD?


There are several methods that can be used to install Red Hat Enterprise Linux.
Installing from a CD-ROM or DVD requires that you have purchased a Red Hat
Enterprise Linux product, you have a Red Hat Enterprise Linux 5.0.0 CD-ROM
or DVD, and you have a DVD/CD-ROM drive on a system that supports booting
from it. Your BIOS may need to be changed to allow booting from your
DVD/CD-ROM drive.

1.3.1. Alternative Boot Methods


Boot DVD/CD-ROM
If you can boot using the DVD/CD-ROM drive, you can create your own CD-
ROM to boot the installation program. This may be useful, for example, if you
are performing an installation over a network or from a hard drive.

Pakistan Computer Bureau 1


USB Pen Drive
If you cannot boot from the DVD/CD-ROM drive, but you can boot using a USB
device, such as a USB pen drive, the following alternative boot method is
available:

To boot using a USB pen drive, use the dd command to copy the diskboot.img
image file from the /images/ directory on the DVD or CD-ROM #1.
For example:
• dd if=diskboot.img of=/dev/sda

Your BIOS must support booting from a USB device in order for this boot
method to work.

1.3.2. Making an Installation Boot CD-ROM


isolinux (not available for Itanium systems) is used for booting the Red Hat
Enterprise Linux installation CD. To create your own CD-ROM to boot the
installation program, use the following instructions:

Copy the isolinux / directory from the Red Hat Enterprise Linux DVD or CD #1
into a temporary directory (referred to here as <path-to-workspace>) using the
following command:
• cp -r <path-to-cd>/isolinux/<path-to-workspace>

Change directories to the <path-to-workspace> directory you have created:


• cd <path-to-workspace>

Make sure the files you have copied have appropriate permissions:
• chmod u+w isolinux/*

Finally, issue the following command to create the ISO image file:
• mkisofs -o file.iso -b isolinux.bin -c boot.cat -no-emul-boot \ -boot-load-
size 4 -boot-info-table -R -J -v -T isolinux/

Note

The above command was split into two lines for printing purposes only. When you
execute this command, be sure to type it as a single command, all on the same line.
Burn the resulting ISO image (named file.iso and located in <path-to-workspace>) to a
CD-ROM as you normally would.

Pakistan Computer Bureau 2


1.4. Preparing for a Hard Drive Installation
Note

Hard drive installations only work from ext2, ext3, or FAT file systems. If you have a
file system other than those listed here, such as reiserfs, you will not be able to perform
a hard drive installation.

Hard drive installations require the use of the ISO or DVD/CD-ROM images. An
ISO image is a file containing an exact copy of a DVD/CD-ROM image. After
placing the required ISO images (the binary Red Hat Enterprise Linux DVD/CD-
ROMs) in a directory, choose to install from the hard drive. You can then point
the installation program at that directory to perform the installation.

To prepare your system for a hard drive installation, you must set the system up
in one of the following ways:

• Using a set of CD-ROMs, or a DVD — Create ISO image files from each
installation CD-ROM, or from the DVD. For each CD-ROM (once for the
DVD), execute the following command on a Linux system:
• dd if=/dev/cdrom of=/tmp/file-name.iso

• Using ISO images — transfer these images to the system to be


installed.

Verifying that ISO images are intact before you attempt an installation helps to
avoid problems. To verify the ISO images are intact prior to performing an
installation, use an md5sum program (many md5sum programs are available for
various operating systems). An md5sum program should be available on the
same Linux machine as the ISO images.

Note

The Red Hat Enterprise Linux installation program has the ability to test the integrity of
the installation media. It works with the CD / DVD, hard drive ISO, and NFS ISO
installation methods. Red Hat recommends that you test all installation media before
starting the installation process, and before reporting any installation-related bugs
(many of the bugs reported are actually due to improperly-burned CDs). To use this
test, type the following command at the boot: prompt (prepend with elilo for Itanium
systems): linux media check

Pakistan Computer Bureau 3


This chapter explains how to perform a Red Hat Enterprise Linux installation
from the DVD/CD-ROM, using the graphical, mouse-based installation
program. The following topics are discussed:

• Becoming familiar with the installation program's user interface


• Starting the installation program
• Selecting an installation method
• Configuration steps during the installation (language, keyboard,
mouse, partitioning, etc.)
• Finishing the installation

2.1. The Graphical Installation Program User Interface


If you have used a graphical user interface (GUI) before, you are already
familiar with this process; use your mouse to navigate the screens, click
buttons, or enter text fields.

You can also navigate through the installation using the keyboard. The Tab
key allows you to move around the screen, the Up and Down arrow keys to
scroll through lists, + and - keys expand and collapse lists, while Space and
Enter selects or removes from selection a highlighted item. You can also use
the Alt-X key command combination as a way of clicking on buttons or
making other screen selections, where X is replaced with any underlined letter
appearing within that screen.

Note

If you are using an x86, AMD64, or Intel® 64 system, and you do not wish to use
the GUI installation program, the text mode installation program is also available.
To start the text mode installation program, use the following command at the boot:
prompt: linux text

It is highly recommended that installs be performed using the GUI


installation program. The GUI installation program offers the full
functionality of the Red Hat Enterprise Linux installation program, including
LVM configuration which is not available during a text mode installation.
Users who must use the text mode installation program can follow the GUI
installation instructions and obtain all needed information.

Note

If you are using an Itanium system, and you do not wish to use the GUI installation
program, the text mode installation program is also available. To start the text
mode installation program, type the following command at the EFI Shell prompt:
elilo linux text

2.1.1. A Note about Virtual Consoles


The Red Hat Enterprise Linux installation program offers more than the
dialog boxes of the installation process. Several kinds of diagnostic messages
Pakistan Computer Bureau 4
are available to you, as well as a way to enter commands from a shell prompt.
The installation program displays these messages on five virtual consoles,
among which you can switch using a single keystroke combination. A virtual
console is a shell prompt in a non-graphical environment, accessed from the
physical machine, not remotely. Multiple virtual consoles can be accessed
simultaneously.

These virtual consoles can be helpful if you encounter a problem while


installing Red Hat Enterprise Linux. Messages displayed on the installation or
system consoles can help pinpoint a problem. Refer to Table 2.1, “Console,
Keystrokes, and Contents” for a listing of the virtual consoles, keystrokes
used to switch to them, and their contents.

Generally, there is no reason to leave the default console (virtual console #6)
for graphical installations unless you are attempting to diagnose installation
problems.

console keystrokes Contents


1 ctrl-alt-f1 installation dialog
2 ctrl-alt-f2 shell prompt
install log (messages
3 ctrl-alt-f3
from installation
system-related
4 ctrl-alt-f4
messages
5 ctrl-alt-f5 other messages
6 ctrl-alt-f6 Graphic Display
Table 2.1 Console, Keystrokes, and Contents

2.2. The Text Mode Installation Program User Interface


The Red Hat Enterprise Linux text mode installation program uses a screen-
based interface that includes most of the on-screen widgets commonly found
on graphical user interfaces. Figure 2.1, “Installation Program Widgets as
seen in Boot Loader Configuration”, and Figure 2.2, “Installation Program
Widgets as seen in Disk Druid”, illustrate the screens that appear during the
installation process.

Note

While text mode installations are not explicitly documented, those using the text
mode installation program can easily follow the GUI installation instructions. One
thing to note is that manipulation of LVM (Logical Volume Management) disk
volumes is only possible in graphical mode. In text mode it is only possible to view
and accept the default LVM setup.

Pakistan Computer Bureau 5


Figure 2.1 Installation Program Widgets as seen in Boot Loader Configuration

Figure 2.2 Installation Program Widgets as seen in Disk Druid

Here is a list of the most important widgets shown in Figure 2.1, “Installation
Program Widgets as seen in Boot Loader Configuration” and Figure 2.2,
“Installation Program Widgets as seen in Disk Druid”:

Window
Windows (usually referred to as dialogs in this manual) appear on your
screen throughout the installation process. At times, one window may overlay
another; in these cases, you can only interact with the window on top. When
Pakistan Computer Bureau 6
you are finished in that window, it disappears, allowing you to continue
working in the window underneath.

Checkbox
Checkboxes allow you to select or deselect a feature. The box displays either
an asterisk (selected) or a space (unselected). When the cursor is within a
checkbox, press Space to select or deselect a feature.

Text Input
Text input lines are regions where you can enter information required by the
installation program. When the cursor rests on a text input line, you may enter
and/or edit information on that line.

Text Widget
Text widgets are regions of the screen for the display of text. At times, text
widgets may also contain other widgets, such as checkboxes. If a text widget
contains more information than can be displayed in the space reserved for it, a
scroll bar appears; if you position the cursor within the text widget, you can
then use the Up and Down arrow keys to scroll through all the information
available. Your current position is shown on the scroll bar by a # character,
which moves up and down the scroll bar as you scroll.

Scroll Bar
Scroll bars appear on the side or bottom of a window to control which part of
a list or document is currently in the window's frame. The scroll bar makes it
easy to move to any part of a file.

Button Widget
Button widgets are the primary method of interacting with the installation
program. You progress through the windows of the installation program by
navigating these buttons, using the Tab and Enter keys. Buttons can be
selected when they are highlighted.

Cursor
Although not a widget the cursor is used to select (and interact with), a
particular widget. As the cursor is moved from widget to widget, it may cause
the widget to change color, or the cursor itself may only appear positioned in
or next to the widget.

2.2.1. Using the Keyboard to Navigate


Navigation through the installation dialogs is performed through a simple set
of keystrokes. To move the cursor, use the Left, Right, Up, and Down arrow
keys. Use Tab, and Shift-Tab to cycle forward or backward through each
widget on the screen. Along the bottom, most screens display a summary of
available cursor positioning keys.

To "press" a button, position the cursor over the button (using Tab, for
example) and press Space or Enter. To select an item from a list of items,
Pakistan Computer Bureau 7
move the cursor to the item you wish to select and press Enter. To select an
item with a checkbox, move the cursor to the checkbox and press Space to
select an item. To deselect, press Space a second time.

Pressing F12 accepts the current values and proceeds to the next dialog; it is
equivalent to pressing the OK button.

Caution

Unless a dialog box is waiting for your input, do not press any keys during the
installation process (doing so may result in unpredictable behavior).

2.3. Starting the Installation Program


To start, first make sure that you have all necessary resources for the
installation. If you have already read through Chapter 1, Steps to Get You
Started, and followed the instructions, you should be ready to start the
installation process. When you have verified that you are ready to begin, boot
the installation program using the Red Hat Enterprise Linux DVD or CD-
ROM #1 or any boot media that you have created.

Note

Occasionally, some hardware components require a driver diskette during the


installation. A driver diskette adds support for hardware that is not otherwise
supported by the installation program.

2.3.1. Booting the Installation Program on x86, AMD64, and Intel®


64 Systems
You can boot the installation program using any one of the following media
(depending upon what your system can support):

Red Hat Enterprise Linux DVD/CD-ROM


• Your machine supports a bootable DVD/CD-ROM drive and you have
the Red Hat Enterprise Linux CD-ROM set or DVD.

Boot CD-ROM
• Your machine supports a bootable CD-ROM drive and you want to
perform network or hard drive installation.

USB pen drive


• Your machine supports booting from a USB device.

PXE boot via network


• Your machine supports booting from the network. This is an advanced
installation path.

Insert the boot media and reboot the system. Your BIOS settings may need to
be changed to allow you to boot from the CD-ROM or USB device.
Pakistan Computer Bureau 8
Tip

To change your BIOS settings on an x86, AMD64, or Intel® 64 system, watch the
instructions provided on your display when your computer first boots. A line of text
appears, telling you which key to press to enter the BIOS settings.

Once you have entered your BIOS setup program, find the section where you
can alter your boot sequence. The default is often C, A or A, C (depending on
whether you boot from your hard drive [C] or a diskette drive [A]). Change
this sequence so that the CD-ROM is first in your boot order and that C or A
(whichever is your typical boot default) is second. This instructs the computer
to first look at the CD-ROM drive for bootable media; if it does not find
bootable media on the CD-ROM drive, it then checks your hard drive or
diskette drive. Save your changes before exiting the BIOS. For more
information, refer to the documentation that came with your system.

After a short delay, a screen containing the boot: prompt should appear. The
screen contains information on a variety of boot options. Each boot option
also has one or more help screens associated with it. To access a help screen,
press the appropriate function key as listed in the line at the bottom of the
screen. As you boot the installation program, be aware of two issues:

Once the boot: prompt appears, the installation program automatically


begins if you take no action within the first minute. To disable this
feature, press one of the help screen function keys.

If you press a help screen function key, there is a slight delay while the help
screen is read from the boot media. Normally, you only need to press Enter to
boot. Be sure to watch the boot messages to review if the Linux kernel detects
your hardware. If your hardware is properly detected, continue to the next
section. If it does not properly detect your hardware, you may need to restart
the installation and use one of the boot options provided further.

2.3.2. Booting the Installation Program on Itanium Systems


Your Itanium system should be able to boot the Red Hat Enterprise Linux
installation program directly from the Red Hat Enterprise Linux CD #1. If
your Itanium cannot boot the installation program from the CD-ROM (or if
you want to perform a hard drive, NFS, FTP, or HTTP installation) you must
boot from an LS-120 diskette.

2.3.2.1. Booting the Installation Program from the DVD/CD-ROM


To boot from the Red Hat Enterprise Linux CD #1 follow these steps:

• Remove all media except Red Hat Enterprise Linux CD #1.


• From the Boot Option menu choose EFI Shell.
• At the Shell> prompt, change to the file system on the CD-ROM. For
example, in the above sample map output, the system partition on the

Pakistan Computer Bureau 9


CD-ROM is fs1. To change to the fs1 file system, type fs1: at the
prompt.
• Type elilo linux to boot into the installation program.

2.3.2.2. Booting the Installation Program from an LS-120 Diskette


If your Itanium cannot boot from Red Hat Enterprise Linux CD #1, you must
boot from an LS-120 diskette. If you want to perform a hard drive, NFS, FTP,
or HTTP installation, you must boot from a boot LS-120 diskette.

You must create an LS-120 boot image file diskette from the boot image file
on CD #1: images/boot.img. To create this diskette in Linux, insert a blank
LS-120 diskette and type the following command at a shell prompt:
• dd if=boot.img of=/dev/hda bs=180k

Replace boot.img with the full path to the boot image file and /dev/hda with
the correct device name for the LS-120 diskette drive.

If you are not using the Red Hat Enterprise Linux CD, the installation
program starts in text mode and you must choose a few basic options for your
system.

To boot from an LS-120 diskette follow these steps:

• Insert the LS-120 diskette you made from the boot image file
boot.img. If you are performing a local CD-ROM installation but
booting off the LS-120 diskette, insert the Red Hat Enterprise Linux
CD #1 also. If you are performing a hard drive, NFS, FTP, or HTTP
installation, you do not need the CD-ROM.
• From the Boot Option menu choose EFI Shell.
• At the Shell> prompt, change the device to the LS-120 drive by typing
the command fs0: using the example map output above.
• Type elilo linux to boot into the installation program.

2.3.3. Additional Boot Options


While it is easiest to boot using a CD-ROM and perform a graphical
installation, sometimes there are installation scenarios where booting in a
different manner may be needed. This section discusses additional boot
options available for Red Hat Enterprise Linux.

For Itanium users:


To pass options to the boot loader on an Itanium system, enter the following
at the EFI Shell prompt: elilo linux option

For x86, AMD64, and Intel® 64 users:


To pass options to the boot loader on an x86, AMD64, or Intel® 64 system,
use the instructions as provided in the boot loader option samples below.

Pakistan Computer Bureau 10


To perform a text mode installation, at the installation boot prompt, type:
linux text ISO images have an md5sum embedded in them. To test the
checksum integrity of an ISO image, at the installation boot prompt, type:
linux mediacheck

The installation program prompts you to insert a CD or select an ISO image


to test, and select OK to perform the checksum operation. This checksum
operation can be performed on any Red Hat Enterprise Linux CD and does
not have to be performed in a specific order (for example, CD #1 does not
have to be the first CD you verify). It is strongly recommended to perform
this operation on any Red Hat Enterprise Linux CD that was created from
downloaded ISO images. This command works with the CD, DVD, hard
drive ISO, and NFS ISO installation methods.

Also in the images/ directory is the boot.iso file. This file is an ISO image
than can be used to boot the installation program. To use the boot.iso, your
computer must be able to boot from its CD-ROM drive, and its BIOS settings
must be configured to do so. You must then burn the boot.iso file onto a
recordable/rewriteable CD-ROM.

If you need to perform the installation in serial mode, type the following
command:
• linux console=<device>

For text mode installations, use:


• linux text console=<device>
In the above command, <device> should be the device you are using (such as
ttyS0 or ttyS1). For example, linux text console=ttyS0.Text mode
installations using a serial terminal work best when the terminal supports
UTF-8. Under UNIX and Linux, Kermit supports UTF-8. For Windows,
Kermit '95 works well.

A Non-UTF-8 capable terminal works as long as only English is used during


the installation process. An enhanced serial display can be used by passing
the utf8 command as a boot-time option to the installation program. For
example:

• linux console=ttyS0 utf8

2.3.3.1. Kernel Options


Options can also be passed to the kernel. For example, to apply updates for
the anaconda installation program from a floppy disk enter:

• Linux updates

For text mode installations, use:

Pakistan Computer Bureau 11


• Linux text updates

This command will prompt you to insert a floppy diskette containing updates
for anaconda. It is not needed if you are performing a network installation and
have already placed the updates image contents in rhupdates/ on the server.
After entering any options, press Enter to boot using those options.

If you need to specify boot options to identify your hardware, please write
them down. The boot options are needed during the boot loader configuration
portion of the installation.

2.4. Selecting an Installation Method


What type of installation method do you wish to use? The following
installation methods are available:

• DVD/CD-ROM

If you have a DVD/CD-ROM drive and the Red Hat Enterprise Linux CD-
ROMs or DVD you can use this method.

Hard Drive
If you have copied the Red Hat Enterprise Linux ISO images to a local hard
drive, you can use this method. You need a boot CD-ROM (use the linux
askmethod boot option).

NFS
If you are installing from an NFS server using ISO images or a mirror image
of Red Hat Enterprise Linux, you can use this method. You need a boot CD-
ROM (use the linux askmethod boot option). Note that NFS installations may
also be performed in GUI mode.

FTP
If you are installing directly from an FTP server, use this method. You need a
boot CD-ROM (use the linux askmethod boot option).

HTTP
If you are installing directly from an HTTP (Web) server, use this method.
You need a boot CD-ROM (use the linux askmethod boot option).

2.5. Installing from DVD/CD-ROM


To install Red Hat Enterprise Linux from a DVD/CD-ROM, place the DVD
or CD #1 in your DVD/CD-ROM drive and boot your system from the
DVD/CD-ROM.

The installation program then probes your system and attempts to identify
your CD-ROM drive. It starts by looking for an IDE (also known as an
ATAPI) CD-ROM drive.
Pakistan Computer Bureau 12
Note

To abort the installation process at this time, reboot your machine and then eject
the boot media. You can safely cancel the installation at any point before the About
to Install screen. Refer to Section 24, “Preparing to Install” for more information.

If your CD-ROM drive is not detected, and it is a SCSI CD-ROM, the


installation program prompts you to choose a SCSI driver. Choose the driver
that most closely resembles your adapter. You may specify options for the
driver if necessary; however, most drivers detect your SCSI adapter
automatically.

If the DVD/CD-ROM drive is found and the driver loaded, the installer will
present you with the option to perform a media check on the DVD/CD-ROM.
This will take some time, and you may opt to skip over this step. However, if
you later encounter problems with the installer, you should reboot and
perform the media check before calling for support. From the media check
dialog, continue to the next stage of the installation process.

2.5.1. What If the IDE CD-ROM Was Not Found?


If you have an IDE (ATAPI) DVD/CD-ROM but the installation program fails
to find it and asks you what type of DVD/CD-ROM drive you have, try the
following boot command. Restart the installation, and at the boot: prompt
enter linux hdX=cdrom. Replace X with one of the following letters,
depending on the interface the unit is connected to, and whether it is
configured as master or slave (also known as primary and secondary):

A — first IDE controller, master


B — first IDE controller, slave
C — second IDE controller, master
D — second IDE controller, slave

If you have a third and/or fourth controller, continue assigning letters in


alphabetical order, going from controller to controller, and master to slave.

2.6. Installing from a Hard Drive


The Select Partition screen applies only if you are installing from a disk
partition (that is, if you selected Hard Drive in the Installation Method
dialog). This dialog allows you to name the disk partition and directory from
which you are installing Red Hat Enterprise Linux.

Pakistan Computer Bureau 13


Figure 2.3 Selecting Partition Dialog for Hard Drive Installation

Enter the device name of the partition containing the Red Hat Enterprise
Linux ISO images. This partition must be formatted with an ext2 or vfat
Filesystem, and cannot be a logical volume. There is also a field labeled
Directory holding images.

If the ISO images are in the root (top-level) directory of a partition, enter a /.
If the ISO images are located in a subdirectory of a mounted partition, enter
the name of the directory holding the ISO images within that partition. For
example, if the partition on which the ISO images is normally mounted as
/home/ and the images are in /home/new/, you would enter /new/. After you
have identified the disk partition, the Welcome dialog appears.

2.7. Welcome to Red Hat Enterprise Linux


The Welcome screen does not prompt you for any input. From this screen you
can access the Release Notes for Red Hat Enterprise Linux 5.0.0 by clicking
on the Release Notes button.

Pakistan Computer Bureau 14


Click on the Next button to continue.

2.8. Language Selection


Using your mouse, select a language to use for the installation (refer to
Figure 2.8, “Language Selection”). The language you select here will
become the default language for the operating system once it is installed.
Selecting the appropriate language also helps target your time zone

configuration later in the installation. The installation program tries to define


the appropriate time zone based on what you specify on this screen.

Pakistan Computer Bureau 15


Figure 2.8 Language Selection

Once you select the appropriate language, click Next to continue.

2.9. Keyboard Configuration


Using your mouse, select the correct layout type (for example, U.S. English)
for the keyboard you would prefer to use for the installation and as the system
default (refer to the figure below).Once you have made your selection, click
Next to continue.

Pakistan Computer Bureau 16


Figure 2.9 Keyboard Configuration

Tip

To change your keyboard layout type after you have completed the installation, use
the Keyboard Configuration Tool. Type the system-config-keyboard command in a
shell prompt to launch the Keyboard Configuration Tool. If you are not root, it
prompts you for the root password to continue.

2.10. Enter the Installation Number


Enter your Installation Number (refer to Figure 2.10, “Installation
Number”). This number will determine the package selection set that is
available to the installer. If you choose to skip entering the installation
number you will be presented with a basic selection of packages to install
later on.

Pakistan Computer Bureau 17


Figure 2.10 Installation Number

2.11. Disk Partitioning Setup


Partitioning allows you to divide your hard drive into isolated sections, where
each section behaves as its own hard drive. Partitioning is particularly useful
if you run multiple operating systems. If you are not sure how you want your
system to be partitioned.

On this screen you can choose to create the default layout or choose to
manual partition using the 'Create custom layout' option of Disk Druid.

The first three options allow you to perform an automated installation without
having to partition your drive(s) yourself. If you do not feel comfortable with
partitioning your system, it is recommended that you do not choose to create a
custom layout and instead let the installation program partition for you.

You can configure an iSCSI target for installation, or disable a dmraid device
from this screen by clicking on the 'Advanced storage configuration' button.

Pakistan Computer Bureau 18


Warning

The Update Agent downloads updated packages to /var/cache/yum/ by default.


If you partition the system manually, and create a separate /var/ partition, be sure
to create the partition large enough (3.0 GB or more) to download package
updates.

Figure 2.11 Disk Partitioning Setup

Warning

If you receive an error after the Disk Partitioning Setup phase of the installation saying
something similar to: "The partition table on device hda was unreadable. To create
new partitions it must be initialized, causing the loss of ALL DATA on this drive."

You may not have a partition table on that drive or the partition table on the drive
may not be recognizable by the partitioning software used in the installation
program. Users who have used programs such as EZ-BIOS have experienced
similar problems, causing data to be lost (assuming the data was not backed up
before the installation began). No matter what type of installation you are

Pakistan Computer Bureau 19


performing, backups of the existing data on your systems should always be
made.

2.12. Advanced Storage Options

Figure 2.12 Advanced Storage Options

From this screen you can choose to disable a dmraid device, in which case the
individual elements of the dmraid device will appear as separate hard drives. You
can also choose to configure an iSCSI (SCSI over TCP/IP) target.
• To configure an ISCSI target invoke the 'Configure ISCSI Parameters'
dialog by selecting 'Add ISCSI target' and clicking on the 'Add Drive'
button. Fill in the details for the ISCSI target IP and provide a unique
ISCSI initiator name to identify this system.
• Click the 'Add target' button to attempt connection to the ISCSI target
using this information.

Figure 2.13 Configure ISCSI Parameters

Pakistan Computer Bureau 20


Please note that you will be able to reattempt with a different ISCSI target IP
should you enter it incorrectly, but in order to change the ISCSI initiator name
you will need to restart the installation.

2.13. Create Default Layout


Create default layout allows you to have some control concerning what data is
removed (if any) from your system. Your options are:
• Remove all partitions on selected drives and create default layout
• Select this option to remove all partitions on your hard drive(s) (this
includes partitions created by other operating systems such as Windows
VFAT or NTFS partitions).

Caution

If you select this option, all data on the selected hard drive(s) is removed by the
installation program. Do not select this option if you have information that you want to
keep on the hard drive(s) where you are installing Red Hat Enterprise Linux.

• Remove Linux partitions on selected drives and create default layout


• select this option to remove only Linux partitions (partitions created from
a previous Linux installation). This does not remove other partitions you
may have on your hard drive(s) (such as VFAT or FAT32 partitions).

• Use free space on selected drives and create default layout


• Select this option to retain your current data and partitions, assuming you
have enough free space available on your hard drive(s).

Pakistan Computer Bureau 21


Figure 2.14 Create Default Layout

Using your mouse, choose the storage drive(s) on which you want Red Hat
Enterprise Linux to be installed. If you have two or more drives, you can choose
which drive(s) should contain this installation. Unselected drives, and any data
on them, are not touched.

Caution

It is always a good idea to back up any data that you have on your systems. For
example, if you are upgrading or creating a dual-boot system, you should back up any
data you wish to keep on your drive(s). Mistakes do happen and can result in the loss of
all your data.

Tip

If you have a RAID card, be aware that some BIOSes do not support booting from the
RAID card. In cases such as these, the /boot/ partition must be created on a partition
outside of the RAID array, such as on a separate hard drive. An internal hard drive is
necessary to use for partition creation with problematic RAID cards.

A /boot/ partition is also necessary for software RAID setups.

Pakistan Computer Bureau 22


If you have chosen to automatically partition your system, you should select
Review and manually edit your /boot/ partition. To review and make any
necessary changes to the partitions created by automatic partitioning, select the
Review option. After selecting Review and clicking Next to move forward, the
partitions created for you in Disk Druid appear. You can make modifications to
these partitions if they do not meet your needs. Click Next once you have made
your selections to proceed.

2.14. Partitioning Your System


If you chose one of the automatic partitioning options and selected Review, you
can either accept the current partition settings (click Next), or modify the setup
using Disk Druid, the manual partitioning tool.

Note

Please note that in the text mode installation it is not possible to work with LVM
(Logical Volumes) beyond viewing the existing setup. LVM can only be set up using
the graphical Disk Druid program in a graphical installation.

If you chose to create a custom layout, you must tell the installation program
where to install Red Hat Enterprise Linux. This is done by defining mount points
for one or more disk partitions in which Red Hat Enterprise Linux is installed.
You may also need to create and/or delete partitions at this time.

Note

If you have not yet planned how to set up your partitions, At a bare minimum, you need
an appropriately-sized root partition, and a swap partition equal to twice the amount of
RAM you have on the system. Itanium system users should have a /boot/efi/ partition of
approximately 100 MB and of type FAT (VFAT), a swap partition of at least 512 MB,
and an appropriately-sized root (/) partition.

Pakistan Computer Bureau 23


Figure 2.15 Partitioning with Disk Druid on x86, AMD64, and Intel® 64 Systems

The partitioning tool used by the installation program is Disk Druid. With the
exception of certain esoteric situations, Disk Druid can handle the partitioning
requirements for a typical installation.

2.14.1. Graphical Display of Hard Drive(s)


Disk Druid offers a graphical representation of your hard drive(s). Click once to
highlight a particular field in the graphical display. Double-click to edit an
existing partition or to create a partition out of existing free space. Above the
display, you can review the Drive name (such as /dev/hda), the Geom (which
shows the hard disk's geometry and consists of three numbers representing the
number of cylinders, heads, and sectors as reported by the hard disk), and the
Model of the hard drive as detected by the installation program.

2.14.2. Disk Druid's Buttons


These buttons control Disk Druid's actions. They are used to change the
attributes of a partition (for example the file system type and mount point) and
also to create RAID devices. Buttons on this screen are also used to accept the

Pakistan Computer Bureau 24


Changes you have made, or to exit Disk Druid. For further explanation, take a
look at each button in order:

New:
Used to request a new partition, when selected, a dialog box appears containing
fields (such as the mount point and size fields) that must be filled in.

Edit:
It’s used to modify attributes of the partition currently selected in the Partitions
section. Selecting Edit opens a dialog box. Some or all of the fields can be
edited, depending on whether the partition information has already been written
to disk. You can also edit free space as represented in the graphical display to
create a new partition within that space. Either highlight the free space and then
select the Edit button, or double-click on the free space to edit it. To make a
RAID device, you must first create (or reuse existing) software RAID partitions.
Once you have created two or more software RAID partitions, select Make RAID
to join the software RAID partitions into a RAID device.

Delete:
It’s used to remove the partition currently highlighted in the Current Disk
Partitions section. You will be asked to confirm the deletion of any partition.

Reset:
It’s used to restore Disk Druid to its original state. All changes made will be lost
if you Reset the partitions.

RAID:
It’s Used to provide redundancy to any or all disk partitions. It should only be
used if you have experience using RAID. To read more about RAID, refer to the
Red Hat Enterprise Linux Deployment Guide.

To make a RAID device, you must first create software RAID partitions. Once
you have created two or more software RAID partitions, select RAID to join the
software RAID partitions into a RAID device.

LVM:
It allows you to create an LVM logical volume. The role of LVM (Logical
Volume Manager) is to present a simple logical view of underlying physical
storage space, such as a hard drive(s). LVM manages individual physical disks —
or to be more precise, the individual partitions present on them. It should only be
used if you have experience using LVM. To read more about LVM, refer to the
Red Hat Enterprise Linux Deployment Guide. Note, LVM is only available in the
graphical installation program.

Pakistan Computer Bureau 25


To create an LVM logical volume, you must first create partitions of type
physical volume (LVM). Once you have created one or more physical volume
(LVM) partitions, select LVM to create an LVM logical volume.

2.14.3. Partition Fields


Above the partition hierarchy are labels which present information about the
partitions you are creating. The labels are defined as follows:

Device:
This field displays the partition's device name.

Mount Point/RAID/Volume:
A mount point is the location within the directory hierarchy at which a volume
exists; the volume is "mounted" at this location. This field indicates where the
partition is mounted. If a partition exists, but is not set, then you need to define
its mount point. Double-click on the partition or click the Edit button.

Type:
This field shows the partition's file system type (for example, ext2, ext3, or vfat).

Format:
This field shows if the partition being created will be formatted.

Size (MB):
This field shows the partition's size (in MB).

Start:
This field shows the cylinder on your hard drive where the partition begins.

End:
This field shows the cylinder on your hard drive where the partition ends. Hide
RAID device/LVM Volume Group members: Select this option if you do not
want to view any RAID device or LVM Volume Group members that have been
created.

2.14.4. Recommended Partitioning Scheme


2.14.4.1. Itanium systems
Unless you have a reason for doing otherwise, we recommend that you create the
following partitions for Itanium systems:

Pakistan Computer Bureau 26


A /boot/efi/ partition (100 MB minimum) — the partition mounted on /boot/efi/
contains all the installed kernels, the initrd images, and ELILO configuration
files.

Warning

You must create a /boot/efi/ partition of type VFAT and at least 100 MB in size as the
first primary partition.

A swap partition (at least 256 MB) — swap partitions are used to support virtual
memory. In other words, data is written to a swap partition when there is not
enough RAM to store the data your system is processing.

If you are unsure about what size swap partition to create, make it twice the
amount of RAM on your machine. It must be of type swap.

Creation of the proper amount of swap space varies depending on a number of


factors including the following (in descending order of importance):

• The applications running on the machine.


• The amount of physical RAM installed on the machine.
• The version of the OS.

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then
an additional 1x physical RAM for any amount above 2 GB, but never less than
32 MB. So, if: M = Amount of RAM in GB, and S = Amount of swap in GB,
then

If M < 2

S = M *2
Else
S=M + 2

Using this formula, a system with 2 GB of physical RAM would have 4 GB of


swap, while one with 3 GB of physical RAM would have 5 GB of swap.
Creating a large swap space partition can be especially helpful if you plan to
upgrade your RAM at a later time. For systems with really large amounts of
RAM (more than 32 GB) you can likely get away with a smaller swap partition
(around 1x, or less, of physical RAM).

A root partition (3.0 GB - 5.0 GB) — this is where "/" (the root directory) is
located. In this setup, all files (except those stored in /boot/efi) are on the root

Pakistan Computer Bureau 27


partition. A 3.0 GB partition allows you to install a minimal installation; while a
5.0 GB root partition lets you perform a full installation, choosing all package
groups. 18.4.2. X86, AMD 64, and Intel@ 64 systems Unless you have a reason
for doing otherwise, we recommend that you create the following partitions for
x86, AMD64, and Intel® 64 systems:

A swap partition (at least 256 MB) — swap partitions are used to support virtual
memory. In other words, data is written to a swap partition when there is not
enough RAM to store the data your system is processing.

If you are unsure about what size swap partition to create, make it twice the
amount of RAM on your machine. It must be of type swap.

Creation of the proper amount of swap space varies depending on a number of


factors including the following (in descending order of importance):

• The applications running on the machine.

• The amount of physical RAM installed on the machine.

• The version of the OS.

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then
an additional 1x physical RAM for any amount above 2 GB, but never less than
32 MB.
So, if:
M = Amount of RAM in GB, and S = Amount of swap in GB, then

If M < 2
S = M *2
Else
S=M+2

Using this formula, a system with 2 GB of physical RAM would have 4 GB of


swap, while one with 3 GB of physical RAM would have 5 GB of swap. Creating
a large swap space partition can be especially helpful if you plan to upgrade your
RAM at a later time.

For systems with really large amounts of RAM (more than 32 GB) you can likely
get away with a smaller swap partition (around 1x, or less, of physical RAM).

A /boot/ partition (100 MB) — the partition mounted on /boot/ contains the
operating system kernel (which allows your system to boot Red Hat Enterprise

Pakistan Computer Bureau 28


Linux), along with files used during the bootstrap process. Due to limitations,
creating a native ext3 partition to hold these files is required. For most users, a
100 MB boot partition is sufficient.

Tip

If your hard drive is more than 1024 cylinders (and your system was manufactured
more than two years ago), you may need to create a /boot/partition if you want the /
(root) partition to use all of the remaining space on your hard drive.

Tip

If you have a RAID card, be aware that some BIOSes do not support booting from the
RAID card. In cases such as these, the /boot/ partition must be created on a partition
outside of the RAID array, such as on a separate hard drive.

A root partition (3.0 GB - 5.0 GB) — this is where "/" (the root directory) is
located. In this setup, all files (except those stored in /boot) are on the root
partition. A 3.0 GB partition allows you to install a minimal installation; while a
5.0 GB root partition lets you perform a full installation, choosing all package
groups.

2.14.5. Adding Partitions


To add a new partition, select the new button. A dialog box appears (refer to
Figure 2.16, “Creating a New Partition”).

Note

You must dedicate at least one partition for this installation, and optionally more.

Pakistan Computer Bureau 29


Figure 2.16 Creating a New Partition

Mount Point:
Enter the partition's mount point. For example, if this partition should be the root
partition, enter /; enter /boot for the /boot partition, and so on. You can also use
the pull-down menu to choose the correct mount point for your partition. For a
swap partition the mount point should not be set - setting the filesystem type to
swap is sufficient.

File System Type:


Using the pull-down menu, select the appropriate file system type for this
partition.

Allowable Drives:
This field contains a list of the hard disks installed on your system. If a hard
disk's box is highlighted, then a desired partition can be created on that hard disk.
If the box is not checked, then the partition will never be created on that hard
disk. By using different checkbox settings, you can have Disk Druid place

Pakistan Computer Bureau 30


partitions where you need them, or let Disk Druid decide where partitions should
go.

Size (MB):
Enter the size (in megabytes) of the partition. Note, this field starts with 100 MB;
unless changed; only a 100 MB partition will be created.

Additional Size Options:


Choose whether to keep this partition at a fixed size, to allow it to "grow" (fill up
the available hard drive space) to a certain point, or to allow it to grow to fill any
remaining hard drive space available.

If you choose fill all space up to (MB), you must give size constraints in the field
to the right of this option. This allows you to keep a certain amount of space free
on your hard drive for future use. Force to be a primary partition: Select whether
the partition you are creating should be one of the first four partitions on the hard
drive. If unselected, the partition is created as a logical partition.

OK:
Select OK once you are satisfied with the settings and wish to create the
partition.

Cancel:
Select cancel if you do not want to create the partition.

2.14.5.1. File System Types


Red Hat Enterprise Linux allows you to create different partition types, based on
the file system they will use. The following is a brief description of the different
file systems available, and how they can be utilized.

ext2
An ext2 file system supports standard UNIX file types (regular files,
directories, symbolic links, etc). It provides the ability to assign long file
names, up to 255 characters.

ext3
The ext3 file system is based on the ext2 file system and has one main advantage
— journaling. Using a journaling file system reduces time spent recovering a file
system after a crash as there is no need to fsck the file system. The ext3 file
system is selected by default and is highly recommended.

Pakistan Computer Bureau 31


physical volume (LVM)
Creating one or more physical volume (LVM) partitions allows you to create an
LVM logical volume. LVM can improve performance when using physical disks.
For more information regarding LVM, refer to the Red Hat Enterprise Linux
Deployment Guide.

software RAID
Creating two or more software RAID partitions allows you to create a RAID
device. For more information regarding RAID, refer to the chapter RAID
(Redundant Array of Independent Disks) in the Red Hat Enterprise Linux
Deployment Guide.

Swap
Swap partitions are used to support virtual memory. In other words, data is
written to a swap partition when there is not enough RAM to store the data your
system is processing. Refer to the Red Hat Enterprise Linux Deployment Guide
for additional information.

Vfat
The VFAT file system is a Linux file system that is compatible with Microsoft
Windows long filenames on the FAT file system. This file system must be used
for the /boot/efi/

2.14.6. Editing Partitions


To edit a partition, select the Edit button or double-click on the existing partition.

Note

If the partition already exists on your disk, you can only change the partition's mount
point. To make any other changes, you must delete the partition and recreate it.

2.14.7. Deleting a Partition


To delete a partition, highlight it in the Partitions section and click the Delete
button. Confirm the deletion when prompted.

2.15. x86, AMD64, and Intel® 64 Boot Loader Configuration


To boot the system without boot media, you usually need to install a boot loader.
A boot loader is the first software program that runs when a computer starts. It is
responsible for loading and transferring control to the operating system kernel
software. The kernel, in turn, initializes the rest of the operating system.

Pakistan Computer Bureau 32


GRUB (Grand Unified Bootloader), which is installed by default, is a very
powerful boot loader. GRUB can load a variety of free operating systems, as well
as proprietary operating systems with chain-loading (the mechanism for loading
unsupported operating systems, such as DOS or Windows, by loading another
boot loader).

Figure 2.17 Boot Loader Configurations

If you do not want to install GRUB as your boot loader, click Change boot
loader, where you can choose not to install a boot loader at all. If you already
have a boot loader that can boot Red Hat Enterprise Linux and do not want to
overwrite your current boot loader, choose Do not install a boot loader by
clicking on the Change boot loader button.

Caution

If you choose not to install GRUB for any reason, you will not be able to boot the
system directly, and you must use another boot method (such as a commercial boot
loader application). Use this option only if you are sure you have another way of
booting the system!

Every bootable partition is listed, including partitions used by other operating


systems. The partition holding the system's root file system has a Label of Red
Hat Enterprise Linux (for GRUB). Other partitions may also have boot labels. To
add or change the boot label for other partitions that have been detected by the
installation program, click once on the partition to select it. Once selected, you
can change the boot label by clicking the Edit button.

Pakistan Computer Bureau 33


Select Default beside the preferred boot partition to choose your default bootable
OS. You cannot move forward in the installation unless you choose a default
boot image.

Note

The Label column lists what you must enter at the boot prompt, in non-graphical boot
loaders, in order to boot the desired operating system.

Once you have loaded the GRUB boot screen, use the arrow keys to choose a
boot label or type e for edit. You are presented with a list of items in the
configuration file for the boot label you have selected. Boot loader passwords
provide a security mechanism in an environment where physical access to your
server is available.

If you are installing a boot loader, you should create a password to protect your
system. Without a boot loader password, users with access to your system can
pass options to the kernel which can compromise your system security. With a
boot loader password in place, the password must first be entered before
selecting any non-standard boot options. However, it is still possible for someone
with physical access to the machine to boot from a diskette, CD-ROM, or USB

Media if the BIOS support it. Security plans which include boot loader passwords
should also address alternate boot methods. If you choose to use a boot loader
password to enhance your system security, be sure to select the checkbox labeled
Use a boot loader password. Once selected, enter a password and confirm it.

To configure more advanced boot loader options, such as changing the drive
order or passing options to the kernel, be sure Configure advanced boot loader
options is selected before clicking Next.

2.15.1. Advanced Boot Loader Configuration


Now that you have chosen which boot loader to install, you can also determine
where you want the boot loader to be installed. You may install the boot loader
in one of two places:

The master boot record (MBR)


This is the recommended place to install a boot loader, unless the MBR already
starts another operating system loader, such as System Commander. The MBR is
a special area on your hard drive that is automatically loaded by your computer's
BIOS, and is the earliest point at which the boot loader can take control of the
boot process. In case if you install it in the MBR, when your machine boots,

Pakistan Computer Bureau 34


GRUB presents a boot prompt. You can then boot Red Hat Enterprise Linux or
any other operating system that you have configured the boot loader to boot.

The first sector of your boot partition


This is recommended if you are already using another boot loader on your
system. In this case, your other boot loader takes control first. You can then
configure that boot loader to start GRUB, which then boots Red Hat Enterprise
Linux.

Figure 2.18 Boot Loader Installation

Tip

If you have a RAID card, be aware that some BIOSes do not support booting from the
RAID card. In cases such as these, the boot loader should not be installed on the MBR
of the RAID array. Rather, the boot loader should be installed on the MBR of the same
drive as the /boot/ partition was created.

If your system only uses Red Hat Enterprise Linux, you should choose the MBR.
Click the Change Drive Order button if you would like to rearrange the drive
order or if your BIOS does not return the correct drive order. Changing the drive
order may be useful if you have multiple SCSI adapters, or both SCSI and IDE
adapters, and you want to boot from the SCSI device.

The Force LBA32 (not normally required) option allows you to exceed the 1024
cylinder limit for the /boot/ partition. If you have a system which supports the
LBA32 extension for booting operating systems above the 1024 cylinder limit,

Pakistan Computer Bureau 35


and you want to place your /boot/ partition above cylinder 1024, you should
select this option.

Tip

While partitioning your hard drive, keep in mind that the BIOS in some older systems
cannot access more than the first 1024 cylinders on a hard drive. If this is the case,

Leave enough room for the /boot Linux partition on the first 1024 cylinders of your
hard drive to boot Linux. The other Linux partitions can be after cylinder 1024.

In parted, 1024 cylinders equals 528MB. For more information, refer to:
http://www.pcguide.com/ref/hdd/bios/size MB504-c.html. To add default options
to the boot command, enter them into the Kernel parameters field. Any options
you enter are passed to the Linux kernel every time it boots.

2.15.2. Rescue Mode


Rescue mode provides the ability to boot a small Red Hat Enterprise Linux
environment entirely from boot media or some other boot method instead of the
system's hard drive. There may be times when you are unable to get Red Hat
Enterprise Linux running completely enough to access files on your system's
hard drive. Using rescue mode, you can access the files stored on your system's
hard drive, even if you cannot actually run Red Hat Enterprise Linux from that
hard drive. If you need to use rescue mode, try the following method:

• Use the CD-ROM to boot an x86, AMD64, or Intel® 64 system, type


linux rescue at the installation boot prompt. Itanium users should type
elilo linux rescue to enter rescue mode.

2.15.3. Alternative Boot Loaders


If you do not wish to use a boot loader, you have several alternatives:

LOADLIN:
You can load Linux from MS-DOS. Unfortunately, this requires a copy of the
Linux kernel (and an initial RAM disk, if you have a SCSI adapter) to be
available on an MS-DOS partition. The only way to accomplish this is to boot
your Red Hat Enterprise Linux system using some other method (for example,
from a boot CD-ROM) and then copy the kernel to an MS-DOS partition.
LOADLIN is available from

ftp://metalab.unc.edu/pub/Linux/system/boot/dualboot/

And associated mirror sites.

Pakistan Computer Bureau 36


SYSLINUX:
SYSLINUX is an MS-DOS program very similar to LOADLIN. It is also
available from

ftp://metalab.unc.edu/pub/Linux/system/boot/loaders/

and associated mirror sites.

Commercial boot loaders:


You can load Linux using commercial boot loaders. For example, System
Commander and Partition Magic are able to boot Linux (but still require GRUB
to be installed in your Linux root partition).

Note

Boot loaders such as LOADLIN and System Commander are considered to be third-
party boot loaders and are not supported by Red Hat.

2.15.4. SMP Motherboards and GRUB


In previous versions of Red Hat Enterprise Linux there were two different kernel
versions, a uniprocessor version and an SMP version. In Red Hat Enterprise
Linux 5.0.0 the kernel is SMP-enabled by default and will take advantage of
multiple core, hyperthreading, and multiple CPU capabilities when they are
present. This same kernel can run on single CPUs with a single core and no
hyperthreading.

2.16. Time Zone Configuration


Set your time zone by selecting the city closest to your computer's physical
location. Click on the map to zoom in to a particular geographical region of the
world. From here there are two ways for you to select your time zone:

Using your mouse, click on the interactive map to select a specific city
(represented by a yellow dot). A red X appears indicating your selection.

You can also scroll through the list at the bottom of the screen to select your time
zone. Using your mouse, click

Pakistan Computer Bureau 37


Figure 2.21 Configuring the Time Zone
Select System Clock uses UTC if you know that your system is set to UTC.

Tip

To change your time zone configuration after you have completed the installation, use
the Time and Date Properties Tool.

Type the system-config-date command in a shell prompt to launch the Time and
Date Properties Tool. If you are not root, it prompts you for the root password to
continue. To run the Time and Date Properties Tool as a text-based application,
use the command timeconfig.

2.17. Set Root Password


Setting up a root account and password is one of the most important steps during
your installation. Your root account is similar to the administrator account used
on Windows NT machines. The root account is used to install packages, upgrade
RPMs, and perform most system maintenance. Logging in as root gives you
complete control over your system.

Pakistan Computer Bureau 38


Note

The root user (also known as the superuser) has complete access to the entire system;
for this reason, logging in as the root user is best done only to perform system
maintenance or administration.

Figure 2.22 Root Password

Use the root account only for system administration. Create a non-root account
for your general use and su - to root when you need to fix something quickly.
These basic rules minimize the chances of a typo or an incorrect command doing
damage to your system.

Tip

To become root, type su - at the shell prompt in a terminal window and then press
Enter. Then, enter the root password and press Enter.

The installation program prompts you to set a root password2 for your system.
You cannot proceed to the next stage of the installation process without entering
a root password.

Pakistan Computer Bureau 39


The root password must be at least six characters long; the password you type is
not echoed to the screen. You must enter the password twice; if the two
passwords do not match, the installation program asks you to enter them again.

You should make the root password something you can remember, but not
something that is easy for someone else to guess. Your name, your phone
number, qwerty, password, root, 123456, and anteater are all examples of bad
passwords. Good passwords mix numerals with upper and lower case letters and
do not contain dictionary words: Aard387vark or 420BMttNT, for example.
Remember that the password is case-sensitive. If you write down your password,
keep it in a secure place. However, it is recommended that you do not write
down this or any password you create.

Note

Do not use one of the example passwords offered in this manual. Using one of
these passwords could be considered a security risk.

Tip

To change your root password after you have completed the installation, use the Root
Password Tool.

Type the system-config-rootpassword command in a shell prompt to launch the


Root Password Tool. If you are not root, it prompts you for the root password to
continue.

2.18. Package Group Selection


Now that you have made most of the choices for your installation, you are ready
to confirm the default package selection or customize packages for your system.
The Package Installation Defaults screen appears and details the default package
set for your Red Hat Enterprise Linux installation. This screen varies depending
on the version of Red Hat Enterprise Linux you are installing. If you choose to
accept the current package list. To customize your package set further, select the
Customize now option on the screen.Clicking Next takes you to the Package
Group Selection screen. You can select package groups, which group
components together according to function (for example, X Window System and
Editors), individual packages, or a combination of the two.

Note

Users of Itanium systems who want support for developing or running 32-bit
applications are encouraged to select the Compatibility Arch Support and

Pakistan Computer Bureau 40


Compatibility Arch Development Support packages to install architecure specific
support for their systems.

To select a component, click on the checkbox beside it (refer to Figure 2.23,


“Package Group Selection”).

Figure 2.23 Package Group Selection

Select each component you wish to install.Once a package group has been
selected, if optional components are available you can click on Optional
packages to view which packages are installed by default, and to add or remove
Optional packages from that group. If there are no optional components this
button will be disabled.

Pakistan Computer Bureau 41


Figure 2.24 Package Group Details

2.19. Preparing to Install


2.19.1. Prepare to Install
A screen preparing you for the installation of Red Hat Enterprise Linux now
appears. For your reference, a complete log of your installation can be found in
/root/install.log once you reboot your system.

Warning

If, for some reason, you would rather not continue with the installation process, this is
your last opportunity to safely cancel the process and reboot your machine. Once you
press the Next button, partitions are written and packages are installed. If you wish to
abort the installation, you should reboot now before any existing information on any
hard drive is rewritten.

To cancel this installation process, press your computer's Reset button or use the
Control-Alt-Delete key combination to restart your machine.

Pakistan Computer Bureau 42


2.20. Installing Packages
At this point there is nothing left for you to do until all the packages have been
installed. How quickly this happens depends on the number of packages you
have selected and your computer's speed.

2.21. Installation Complete


Congratulations! Your Red Hat Enterprise Linux installation is now complete!

The installation program prompts you to prepare your system for reboot.
Remember to remove any installation media if it is not ejected automatically
upon reboot. After your computer's normal power-up sequence has completed,
the graphical boot loader prompt appears at which you can do any of the
following things:

Press Enter — causes the default boot entry to be booted.

Select a boot label, followed by Enter — causes the boot loader to boot the
operating system corresponding to the boot label.

Do nothing — after the boot loader's timeout period, (by default, five seconds)
the boot loader automatically boots the default boot entry.

Do whatever is appropriate to boot Red Hat Enterprise Linux. One or more


screens of messages should scroll by. Eventually, a login: prompt or a GUI login
screen (if you installed the X Window System and chose to start X automatically)
appears. The first time you start your Red Hat Enterprise Linux system in run
level 5 (the graphical run level), the Setup Agent is presented, which guides you
through the Red Hat Enterprise Linux configuration. Using this tool, you can set
your system time and date, install software, register your machine with Red Hat
Network, and more. The Setup Agent lets you configure your environment at the
beginning, so that you can get started using your Red Hat Enterprise Linux
system quickly.

2.22. Itanium Systems — Booting Your Machine and Post-


Installation Setup
This section describes how to boot your Itanium into Red Hat Enterprise Linux
and how to set your EFI console variables so that Red Hat Enterprise Linux is
automatically booted when the machine is powered on. After you reboot your
system at the end of the installation program, type the following command to
boot into Red Hat Enterprise Linux:

Pakistan Computer Bureau 43


elilo
After you type elilo, the default kernel listed in the /boot/efi/elilo.conf
configuration file is loaded. (The first kernel listed in the file is the default). If
you want to load a different kernel, type the label name of the kernel from the
file /boot/efi/elilo.conf after the elilo command. For example, to load the kernel
named linux, type:

elilo linux
If you do not know the names of the installed kernels, you can view the
/boot/efi/elilo.conf file in EFI with the following instructions:

1. At the Shell>prompt, change devices to the system partition (mounted as


/boot/efi in Linux). For example, if fs0 is the system boot partition, type
fs0: at the EFI Shell prompt.

2. Type ls at the fs0:\> to make sure you are in the correct partition.

3. Then type: Shell>type elilo.conf

This command displays the contents of the configuration file. Each stanza
contains a line beginning with label followed by a label name for that kernel. The
label name is what you type after elilo to boot the different kernels.

2.22.1. Post-Installation Boot Loader Options


In addition to specifying a kernel to load, you can also enter other boot options
such as single for single user mode or mem=1024M to force Red Hat Enterprise
Linux to use 1024 MB of memory. To pass options to the boot loader, enter the
following at the EFI Shell prompt (replace linux with the label name of the
kernel you want to boot and option with the boot options you want to pass to the
kernel): elilo linux option

2.22.2. Booting Red Hat Enterprise Linux Automatically


After installing Red Hat Enterprise Linux you can type elilo and any boot options
at the EFI Shell prompt each time you wish to boot your Itanium system.
However, if you wish to configure your system to boot into Red Hat Enterprise
Linux automatically, you need to configure the EFI Boot Manager. To configure
the EFI Boot Manager (may vary slightly depending on your hardware):

1. Boot the Itanium system and choose Boot option maintenance menu from the
EFI Boot Manager menu.
2. Choose Add a Boot Option from the Main Menu.
3. Select the system partition that is mounted as /boot/efi/ in Linux.

Pakistan Computer Bureau 44


4. Select the elilo.efi file.
5. At the Enter New Description: prompt, type Red Hat Enterprise Linux 5, or
any name that you want to appear on the EFI Boot Manager menu.
6. At the Enter Boot Option Data Type: prompt, enter N for No Boot Option if
you do not want to pass options to the ELILO boot loader. This option works
for most cases. If you want to pass options to the boot loader, you can
configure it in the /boot/efi/elilo.conf configuration file instead.
7. Answer Yes to the Save changes to NVRAM prompt. This returns you to the
EFI Boot Maintenance Manager menu.
8. Next, you want to make the Red Hat Enterprise Linux 5 menu item the
default. A list of boot options appears. Move the Red Hat Enterprise Linux 5
menu item up to the top of the list by selecting it with the arrow keys and
pressing the u key to move it up the list. You can move items down the list by
selecting it and pressing the d key. After changing the boot order, choose
Save changes to NVRAM. Choose Exit to return to the Main Menu.
9. Optionally, you can change the boot timeout value by choosing Set Auto
Boot TimeOut => Set Timeout Value from the Main Menu.
10. Return to the EFI Boot Manager by selecting Exit.

2.22.2.1. Using a Startup Script


It is recommended that you configure the ELILO Boot Manager to boot Red Hat
Enterprise Linux automatically. However, if you require additional commands to
be executed before starting the ELILO boot loader, you can create a startup script
named startup.nsh. The last command should be elilo to boot into Linux. The
startup.nsh script should be in the /boot/efi partition (/boot/efi/startup.nsh) and
contain the following text:

• echo -off your set of commands elilo

You can either create this file after booting into Red Hat Enterprise Linux or use
the editor built into the EFI shell. To use the EFI shell, at the Shell> prompt,
change devices to the system partition (mounted as /boot/efi in Linux). For
example, if fs0 is the system boot partition, type fs0: at the EFI Shell prompt.
Type ls to make sure you are in the correct partition. Then type edit startup.nsh.
Type the contents of the file and save it.

The next time the system boots, EFI detects the startup.nsh file and use it to boot
the system. To stop EFI from loading the file, type Ctrl-C. This aborts the
process, and returns you to the EFI shell prompt.

Pakistan Computer Bureau 45


3.1 Removing Red Hat Enterprise Linux
To uninstall Red Hat Enterprise Linux from your x86-based system, you must
remove the Red Hat Enterprise Linux boot loader information from your master
boot record (MBR).

Note

It is always a good idea to backup any data that you have on your system(s). Mistakes
do happen and can result in the loss all of your data.

In DOS and Windows, use the Windows fdisk utility to create a new MBR with
the undocumented flag /mbr. This ONLY rewrites the MBR to boot the primary
DOS partition. The command should look like the following:

• fdisk /mbr

If you need to remove Linux from a hard drive and have attempted to do this
with the default DOS (Windows) fdisk, you will experience the Partitions exist
but they do not exist problem. The best way to remove non-DOS partitions is
with a tool that understands partitions other than DOS.

To begin, insert the Red Hat Enterprise Linux CD #1 and boot your system.
Once you have booted off the CD, a boot prompt appears. At the boot prompt,
type: Linux rescue. This starts the rescue mode program. You are prompted for
your keyboard and language requirements. Enter these values as you would
during the installation of Red Hat Enterprise Linux.

Next, a screen appears telling you that the program attempts to find a Red Hat
Enterprise Linux install to rescue. Select Skip on this screen. After selecting
Skip, you are given a command prompt where you can access the partitions you
would like to remove.

First, type the command list-harddrives. This command lists all hard drives on
your system that are recognizable by the installation program, as well as their
sizes in megabytes.

Warning

Be careful to remove only the necessary Red Hat Enterprise Linux partitions. Removing
other partitions could result in data loss or a corrupted system environment.

Pakistan Computer Bureau 46


To remove partitions, use the partitioning utility parted. Start parted, where
/dev/had is the device on which to remove the partition:

• parted /dev/hda

Using the print command, view the current partition table to determine the minor
number of the partition to remove:

• print

The print command also displays the partition's type (such as Linux-swap, ext2,
ext3, and so on). Knowing the type of the partition helps you in determining
whether to remove the partition. Remove the partition with the command rm. For
example, to remove the partition with minor number 3:
• rm 3

Important

The changes start taking place as soon as you press [Enter], so review the command
before committing to it.

After removing the partition, use the print command to confirm that it is removed
from the partition table. Once you have removed the Linux partitions and made
all of the changes you need to make, type quit to quit parted.

After quitting parted, type exit at the boot prompt to exit rescue mode and reboot
your system, instead of continuing with the installation. The system should
reboot automatically. If it does not, you can reboot your computer using Control-
Alt-Delete.

Pakistan Computer Bureau 47


4.1. You are Unable to Boot Red Hat Enterprise Linux
4.1.1. Are You Unable to Boot With Your RAID Card?
If you have performed an installation and cannot boot your system properly, you
may need to reinstall and create your partitions differently. Some BIOSes do not
support booting from RAID cards. At the end of an installation, a text-based
screen showing the boot loader prompt (for example GRUB) and a flashing
cursor may be all that appears. If this is the case, you must repartition your
system.Whether you choose automatic or manual partitioning, you must install
your /boot partition outside of the RAID array, such as on a separate hard drive.
An internal hard drive is necessary to use for partition creation with problematic
RAID cards.

You must also install your preferred boot loader (GRUB or LILO) on the MBR of
a drive that is outside of the RAID array. This should be the same drive that hosts
the /boot/ partition. Once these changes have been made, you should be able to
finish your installation and boot the system properly.

4.1.2. Is Your System Displaying Signal 11 Errors?


A signal 11 errors, commonly know as a segmentation fault, means that the
program accessed a memory location that was not assigned to it. A signal 11
error may be due to a bug in one of the software programs that is installed, or
faulty hardware. If you receive a fatal signal 11 error during your installation, it
is probably due to a hardware error in memory on your system's bus. Like other
operating systems, Red Hat Enterprise Linux places its own demands on your
system's hardware. Some of this hardware may not be able to meet those
demands, even if they work properly under another OS.

Ensure that you have the latest installation updates and images from Red Hat.
Review the online errata to see if newer versions are available. If the latest
images still fail, it may be due to a problem with your hardware. Commonly,
these errors are in your memory or CPU-cache. A possible solution for this error
is turning off the CPU-cache in the BIOS, if your system supports this. You
could also try to swap your memory around in the motherboard slots to check if
the problem is either slot or memory related.

Another option is to perform a media check on your installation CD-ROMs. The


Red Hat Enterprise Linux installation program has the ability to test the integrity
of the installation media.

Pakistan Computer Bureau 48


It works with the CD, DVD, hard drive ISO, and NFS ISO installation methods.
Red Hat recommends that you test all installation media before starting the
installation process, and before reporting any installation-related bugs (many of
the bugs reported are actually due to improperly-burned CDs). To use this test,
type the following command at the boot: or yaboot:
prompt (prepend with elilo for Itanium systems):

• linux mediacheck

For more information concerning signal 11 errors, refer to:

• http://www.bitwizard.nl/sig11/

4.2. Trouble Beginning the Installation


4.2.1. Problems with Booting into the Graphical Installation
There are some video cards that have trouble booting into the graphical
installation program. If the installation program does not run using its default
settings, it tries to run in a lower resolution mode. If that still fails, the
installation program attempts to run in text mode.

One possible solution is to try using the resolution= boot option. This option
may be most helpful for laptop users. Another solution to try is the driver=
option to specify the driver that should be loaded for your video card. If this
works, it should be reported as a bug as the installer has failed to autodetect your
videocard.

Note

To disable frame buffer support and allow the installation program to run in text mode,
try using the nofb boot option. This command may be necessary for accessibility with
some screen reading hardware.

4.3. Trouble during the Installation


4.3.1. No devices found to install Red Hat Enterprise Linux Error
Message
If you receive an error message stating No devices found to install Red Hat
Enterprise Linux, there is probably a SCSI controller that is not being recognized
by the installation program. You can also refer to the Red Hat Hardware
Compatibility List, available online at:

• http://hardware.redhat.com/hcl/

Pakistan Computer Bureau 49


4.3.2. Saving Traceback Messages Without a Diskette Drive
If you receive a traceback error message during installation, you can usually save
it to a diskette. If you do not have a diskette drive available in your system, you
can scp the error message to a remote system.

When the traceback dialog appears, the traceback error message is automatically
written to a file named /tmp/anacdump.txt. Once the dialog appears, switch over
to a new tty (virtual console) by pressing the keys Ctrl-Alt-F2 and scp the
message written to /tmp/anacdump.txt to a known working remote system.

4.3.3. Trouble with Partition Tables


The partition table on device hda was unreadable. To create new partitions it must be
initialized, causing the loss of ALL DATA on this drive. you may not have a partition
table on that drive or the partition table on the drive may not be recognizable by the
partitioning software used in the installation program.

Users who have used programs such as EZ-BIOS have experienced similar problems,
causing data to be lost (assuming the data was not backed up before the installation
began) that could not be recovered. No matter what type of installation you are
performing, backups of the existing data on your systems should always be made.

4.3.4. Using Remaining Space


You have a swap and a / (root) partition created, and you have selected the root
partition to use the remaining space, but it does not fill the hard drive.

If your hard drive is more than 1024 cylinders, you must create a /boot partition
if you want the / (root) partition to use all of the remaining space on your hard
drive.

4.3.5. Other Partitioning Problems


If you are using Disk Druid to create partitions, but cannot move to the next
screen, you probably have not created all the partitions necessary for Disk
Druid's dependencies to be satisfied. You must have the following partitions as a
bare minimum:

• A / (root) partition
• A <swap> partition of type swap

Tip

When defining a partition's type as swap, do not assign it a mount point. Disk Druid
automatically assigns the mount point for you.

Pakistan Computer Bureau 50


4.3.6. Other Partitioning Problems for Itanium System Users
If you are using Disk Druid to create partitions, but cannot move to the next
screen, you probably have not created all the partitions necessary for Disk
Druid's dependencies to be satisfied. You must have the following partitions as a
bare minimum:

• A /boot/efi/ partition of type VFAT


• A / (root) partition
• A <swap> partition of type swap

Tip

When defining a partition's type as swap, you do not have to assign it a mount point.
Disk Druid automatically assigns the mount point for you.

4.3.7. Are You Seeing Python Errors?


During some upgrades or installations of Red Hat Enterprise Linux, the
installation program (also known as anaconda) may fail with a Python or
traceback error. This error may occur after the selection of individual packages
or while trying to save the upgrade log in the /tmp/directory. The error may
look similar to:

Traceback (innermost last):


File "/var/tmp/anaconda-
7.1//usr/lib/anaconda/iw/progress_gui.py", line 20,

in run
rc = self.todo.doInstall ()
File "/var/tmp/anaconda-7.1//usr/lib/anaconda/todo.py",
line 1468, in doInstall
self.fstab.savePartitions ()
File "fstab.py", line 221, in savePartitions sys.exit(0)
SystemExit: 0
Local variables in innermost frame:
self: <fstab.GuiFstab instance at 8446fe0>

sys: <module 'sys' (built-in)>


ToDo object: (itodo ToDo p1 (dp2 S'method' p3
(iimage
CdromInstallMethod
p4 (dp5 S'progressWindow' p6 <failed>

Pakistan Computer Bureau 51


This error occurs in some systems where links to /tmp/ are symbolic to other
locations or have been changed since creation. These symbolic or changed links
are invalid during the installation process, so the installation program cannot
write information and fails.

If you experience such an error, first try to download any available errata for
anaconda. Errata can be found at:

• http://www.redhat.com/support/errata/

The anaconda website may also be a useful reference and can be found online at:

• http://rhlinux.redhat.com/anaconda/

You can also search for bug reports related to this problem. To search Red Hat's
bug tracking system, go to:

• http://bugzilla.redhat.com/bugzilla/

Finally, if you are still facing problems related to this error, register your product
and contact our support team. To register your product, go to:

• http://www.redhat.com/apps/activate/

4.4. Problems after Installation


4.4.1. Trouble with the Graphical GRUB Screen on an x86-based
System?
If you are experiencing problems with GRUB, you may need to disable the
graphical boot screen. To do this, become the root user and edit the
/boot/grub/grub.conf file. Within the grub.conf file, comment out the line
which begins with splashimage by inserting the # character at the beginning of
the line. Press Enter to exit the editing mode. Once the boot loader screen has
returned, type b to boot the system.

Once you reboot, the grub.conf file is reread and any changes you have made
take effect. You may re-enable the graphical boot screen by uncommenting (or
adding) the above line back into the grub.conf file.

4.4.2. Booting into a Graphical Environment


If you have installed the X Window System but are not seeing a graphical
desktop environment once you log into your Red Hat Enterprise Linux system,

Pakistan Computer Bureau 52


you can start the X Window System graphical interface using the command
startx. Once you enter this command and press Enter, the graphical desktop
environment is displayed. Note, however, that this is just a one-time fix and does
not change the log in process for future log ins.

To set up your system so that you can log in at a graphical login screen, you
must edit one file, /etc/inittab, by changing just one number in the runlevel
section. When you are finished, reboot the computer. The next time you log in,
you are presented with a graphical login prompt. Open a shell prompt. If you are
in your user account, become root by typing the su command. Now, type gedit
/etc/inittab to edit the file with gedit. The file /etc/inittab opens. Within the first
screen, a section of the file which looks like the following appears:

# Default runlevel. The runlevels used by RHS are:


# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do
not have networking)

# 3 - Full multiuser mode


# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
# id:3:initdefault:

To change from a console to a graphical login, you should change the number in
the line id:3:initdefault: from a 3 to a 5.

Warning

Change only the number of the default runlevel from 3 to 5.

Your changed line should look like the following:

• id:5:initdefault:

When you are satisfied with your change, save and exit the file using the Ctrl-Q
keys. A window appears and asks if you would like to save the changes. Click
Save. The next time you log in after rebooting your system, you are presented
with a graphical login prompt.

Pakistan Computer Bureau 53


4.4.3. Problems with the X Window System (GUI)
• If you are having trouble getting X (the X Window System) to start, you
may not have installed it during your installation.

• If you want X, you can either install the packages from the Red Hat
Enterprise Linux CD-ROMs or perform an upgrade.

• If you elect to upgrade, select the X Window System packages, and


choose GNOME, KDE, or both, during the upgrade package selection
process.

4.4.4. Problems with the X Server Crashing and Non-Root


Users
If you are having trouble with the X server crashing when anyone other than root
logs in, you may have a full file system (or, a lack of available hard drive
space).To verify that this is the problem you are experiencing, run the following
command:

• df -h

The df command should help you diagnose which partition is full. For additional
information about df and an explanation of the options available (such as the -h
option used in this example), refer to the df man page by typing man df at a shell
prompt.

A key indicator is 100% full or a percentage above 90% or 95% on a partition.


The /home/ and /tmp/ partitions can sometimes fill up quickly with user files.
You can make some room on that partition by removing old files. After you free
up some disk space, try running X as the user that was unsuccessful before.

4.4.5. Problems When You Try to Log In


• If you did not create a user account in the Setup Agent, log in as root and
use the password you assigned to root.

• If you cannot remember your root password, boot your system as linux
single. Itanium users must enter boot commands with elilo followed by
the boot command.

• If you are using an x86-based system and GRUB is your installed boot
loader, type e for edit when the GRUB boot screen has loaded. You are

Pakistan Computer Bureau 54


presented with a list of items in the configuration file for the boot label
you have selected.

• Choose the line that starts with kernel and type e to edit this boot entry.
At the end of the kernel line, add:
o Single
o Press Enter to exit edit mode.
o Once the boot loader screen has returned, type b to boot the
system.

Once you have booted into single user mode and have access to the # prompt,
you must type passwd root, which allows you to enter a new password for root.
At this point you can type shutdown -r now to reboot the system with the new
root password.

• If you cannot remember your user account password, you must become
root. To become root, type su - and enter your root password when
prompted. Then, type passwd <username>. This allows you to enter a
new password for the specified user account.

• If the graphical login screen does not appear, check your hardware for
compatibility issues. The Hardware Compatibility List can be found at:

o http://hardware.redhat.com/hcl/

4.4.6. Is Your RAM Not Being Recognized?


Sometimes, the kernel does not recognize all of your memory (RAM). You can
check this with the cat /proc/meminfo command. Verify that the displayed
quantity is the same as the known amount of RAM in your system. If they are
not equal, add the following line to the /boot/grub/grub.conf:

• mem=xxM

Replace xx with the amount of RAM you have in megabytes. In


/boot/grub/grub.conf, the above example would look similar to the following:

# NOTICE: You have a /boot partition. This means that


# all kernel paths are relative to /boot/
default=0
timeout=30
splashimage=(hd0,0)/grub/splash.xpm.gz

Pakistan Computer Bureau 55


title Red Hat Enterprise Linux (2.6.9-5.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-5.EL ro root=/dev/hda3 mem=128M

Once you reboot, the changes made to grub.conf are reflected on your system.
Once you have loaded the GRUB boot screen, type e for edit. You are presented
with a list of items in the configuration file for the boot label you have selected.

Choose the line that starts with kernel and type e to edit this boot entry. At the
end of the kernel line, add

• mem=xxM

where xx equals the amount of RAM in your system. Press Enter to exit edit
mode. Once the boot loader screen has returned, type b to boot the system.

Itanium users must enter boot commands with elilo followed by the boot
command. Remember to replace xx with the amount of RAM in your system.

• Press Enter to boot.

4.4.7. Your Printer Does Not Work


If you are not sure how to set up your printer or are having trouble getting it to
work properly, try using the Printer Configuration Tool. Type the system-config-
printer command at a shell prompt to launch the Printer Configuration Tool. If
you are not root, it prompts you for the root password to continue.

4.4.8. Problems with Sound Configuration


If, for some reason, you do not hear sound and know that you do have a sound
card installed, you can run the Sound Card Configuration Tool (system-config-
soundcard) utility.

To use the Sound Card Configuration Tool, choose Main Menu => System
=>Administration => Soundcard Detection in GNOME, or Main Menu =>
Administration =>Soundcard Detection in KDE. A small text box pops up
prompting you for your root password.

You can also type the system-config-soundcard command at a shell prompt to


launch the Sound Card Configuration Tool. If you are not root, it prompts you
for the root password to continue. If the Sound Card Configuration Tool does not

Pakistan Computer Bureau 56


work (if the sample does not play and you still do not have audio sounds), it is
likely that your sound card is not yet supported in Red Hat Enterprise Linux.

4.4.9. Apache-based httpd service/Sendmail Hangs During


Startup
If you are having trouble with the Apache-based httpd service or Sendmail
hanging at startup, make sure the following line is in the /etc/hosts file:

• 127.0.0.1 localhost.localdomain localhost

Pakistan Computer Bureau 57


When a computer with Red Hat Enterprise Linux is turned on, the operating
system is loaded into memory by a special program called a boot loader. A boot
loader usually exists on the system's primary hard drive (or other media device)
and has the sole responsibility of loading the Linux kernel with its required files
or (in some cases) other operating systems into memory.

5.1. Boot Loaders and System Architecture


Each architecture is capable of running Red Hat Enterprise Linux that uses a
different boot loader. The following table lists the boot loaders available for each
architecture:

Architecture Boot Loaders

AMD® AMD64 GRUB

IBM®eServer™System i™ OS/400®

IBM®eServer™System p™ YABOOT

IBM®System z® z/IPL

IBM®System z® z/IPL

Intel®Itanium™ ELILO

X86 GRUB

Table 5.1 Boot Loaders by Architecture

This chapter discusses commands and configuration options for the GRUB boot
loader included with Red Hat Enterprise Linux, for the x86 architecture.

5.2. GRUB
The GNU GRand Unified Boot loader (GRUB) is a program which enables the
selection of the installed operating system or kernel to be loaded at system boot
time. It also allows the user to pass arguments to the kernel.

5.2.1. GRUB and the x86 Boot Process


GRUB loads itself into memory in the following stages:

1. The Stage 1 or primary boot loader is read into memory by the BIOS
from the MBR1. The primary boot loader exists on less than 512 bytes of

Pakistan Computer Bureau 58


disk space within the MBR and is capable of loading either the Stage 1.5
or Stage 2 boot loader.
2. The Stage 1.5 boot loader is read into memory by the Stage 1 boot loader,
if necessary. Some hardware requires an intermediate step to get to the
Stage 2 boot loader. This is sometimes true when the /boot/ partition is
above the 1024 cylinder head of the hard drive or when using LBA mode.
The Stage 1.5 boot loader is found either on the /boot/ partition or on a
small part of the MBR and the /boot/ partition.
3. The Stage 2 or secondary boot loader is read into memory. The secondary
boot loader displays the GRUB menu and command environment. This
interface allows the user to select which kernel or operating system to
boot, pass arguments to the kernel, or look at system parameters.
4. The secondary boot loader reads the operating system or kernel as well as
the contents of /boot/sysroot/ into memory. Once GRUB determines
which operating system or kernel to start, it loads it into memory and
transfers control of the machine to that operating system.

The method used to boot Red Hat Enterprise Linux is called direct loading
because the boot loader loads the operating system directly. There is no
intermediary between the boot loader and the kernel. The boot process used by
other operating systems may differ. For example, the Microsoft®Windows®
operating system, as well as other operating systems, is loaded using chain
loading. Under this method, the MBR points to the first sector of the partition
holding the operating system, where it finds the files necessary to actually boot
that operating system.GRUB supports both direct and chain loading boot
methods, allowing it to boot almost any operating system.

Warning

During installation, Microsoft's DOS and Windows installation programs completely


overwrite the MBR, destroying any existing boot loaders. If creating a dual-boot
system, it is best to install the Microsoft operating system first.

5.2.2. Features of GRUB


1. GRUB contains several features that make it preferable to other boot
loaders available, for the x86 architecture. Below is a partial list of some
of the more important features:

2. GRUB provides a true command-based, pre-OS environment on x86


machines. This feature affords the user maximum flexibility in loading
operating systems with specified options or gathering information about

Pakistan Computer Bureau 59


the system. For years, many non-x86 architectures have employed pre-OS
environments that allow system booting from a command line.

3. GRUB supports Logical Block Addressing (LBA) mode. LBA places the
addressing conversion used to find files in the hard drive's firmware, and
is used on many IDE and all SCSI hard devices. Before LBA, boot
loaders could encounter the 1024-cylinder BIOS limitation, where the
BIOS could not find a file after the 1024 cylinder head of the disk. LBA
support allows GRUB to boot operating systems from partitions beyond
the 1024-cylinder limit, so long as the system BIOS supports LBA mode.
Most modern BIOS revisions support LBA mode.

4. GRUB can read ext2 partitions. This functionality allows GRUB to access
its configuration file, /boot/grub/grub.conf, every time the system boots,
eliminating the need for the user to write a new version of the first stage
boot loader to the MBR when configuration changes are made. The only
time a user needs to reinstall GRUB on the MBR is if the physical
location of the /boot/ partition is moved on the disk.

5.3. Installing GRUB


If GRUB was not installed during the installation process, it can be installed
afterward. Once installed, it automatically becomes the default boot loader.
Before installing GRUB, make sure to use the latest GRUB package available or
use the GRUB package from the installation CD-ROMs. For instructions on
installing packages, refer to the chapter titled Package Management with RPM in
the Red Hat Enterprise Linux Deployment Guide. Once the GRUB package is
installed, open a root shell prompt and run the command : /sbin/grub-install
<location>, where <location> is the location that the GRUB Stage 1 Boot loader
should be installed. For example, the following command installs GRUB to the
MBR of the master IDE device on the primary IDE bus:

• /sbin/grub-install /dev/hda

The next time the system boots, the GRUB graphical boot loader menu appears
before the kernel loads into memory.

Important

If GRUB is installed on a RAID 1 array, the system may become unbootable in the
event of disk failure. An unsupported workaround is provided online at the following
URL: http://www.dur.ac.uk/a.d.stribblehill/mirrored_grub.html

Pakistan Computer Bureau 60


5.4. GRUB Terminology
One of the most important things to understand before using GRUB is how the
program refers to devices, such as hard drives and partitions. This information is
particularly important when configuring GRUB to boot multiple operating
systems.

5.4.1. Device Names


When referring to a specific device with GRUB, do so using the following
format (note that the parentheses and comma are very important syntactically):

• (<type-of-device><bios-device-number>,<partition-number>)

The <type-of-device> specifies the type of device from which GRUB boots. The
two most common options are hd for a hard disk or fd for a 3.5 diskette. A lesser
used device type is also available called nd for a network disk. Instructions on
configuring GRUB to boot over the network are available online at

• http://www.gnu.org/software/grub/manual/.

The <bios-device-number> is the BIOS device number. The primary IDE hard
drive is numbered 0 and a secondary IDE hard drive is numbered 1. This syntax
is roughly equivalent to that used for devices by the kernel. For example, the a in
hda for the kernel is analogous to the 0 in hd0 for GRUB, the b in hdb is
analogous to the 1 in hd1, and so on.

The <partition-number> specifies the number of a partition on a device. Like the


<bios-device-number>, most types of partitions are numbered starting at 0.
However, BSD partitions are specified using letters, with a corresponding to 0, b
corresponding to 1, and so on.

Tip

The numbering system for devices under GRUB always begins with 0, not 1. Failing to
make this distinction is one of the most common mistakes made by new users.

To give an example, if a system has more than one hard drive, GRUB refers to
the first hard drive as (hd0) and the second as (hd1). Likewise, GRUB refers to
the first partition on the first drive as (hd0,0) and the third partition on the
second hard drive as (hd1,2).

In general the following rules apply when naming devices and partitions under
GRUB:

Pakistan Computer Bureau 61


It does not matter if system hard drives are IDE or SCSI, all hard drives begin
with the letters hd. The letters fd are used to specify 3.5 diskettes.

To specify an entire device without respect to partitions, leave off the comma
and the partition number. This is important when telling GRUB to configure the
MBR for a particular disk. For example, (hd0) specifies the MBR on the first
device and (hd3) specifies the MBR on the fourth device.

If a system has multiple drive devices, it is very important to know how the drive
boot order is set in the BIOS. This is a simple task if a system has only IDE or
SCSI drives, but if there is a mix of devices, it becomes critical that the type of
drive with the boot partition be accessed first.

5.4.2. File Names and Block lists


When typing commands to GRUB that reference a file, such as a menu list, it is
necessary to specify an absolute file path immediately after the device and
partition numbers. The following illustrates the structure of such a command:

• (<device-type><device-number>,<partition-number>)</path/to/file>

In this example, replace <device-type> with hd, fd, or nd. Replace <device-
number> with the integer for the device. Replace </path/to/file> with an absolute
path relative to the top-level of the device. It is also possible to specify files to
GRUB that do not actually appear in the file system, such as a chain loader that
appears in the first few blocks of a partition. To load such files, provide a
blocklist that specifies block by block where the file is located in the partition.
Since a file is often comprised of several different sets of blocks, blocklists use a
special syntax. Each block containing the file is specified by an offset number of
blocks, followed by the number of blocks from that offset point. Block offsets
are listed sequentially in a comma-delimited list. The following is a sample
blocklist:

• 0+50,100+25,200+1

This sample blocklist specifies a file that starts at the first block on the partition
and uses blocks 0 through 49, 100 through 124, and 200. Knowing how to write
blocklists is useful when using GRUB to load operating systems which require
chain loading. It is possible to leave off the offset number of blocks if starting at
block 0. As an example, the chain loading file in the first partition of the first
hard drive would have the following name:

• (hd0,0)+1

Pakistan Computer Bureau 62


The following shows the chainloader command with a similar blocklist
designation at the GRUB command line after setting the correct device and
partition as root:

• chainloader +1

5.4.3. The Root File System and GRUB


The use of the term root file system has a different meaning in regard to GRUB.
It is important to remember that GRUB's root file system has nothing to do with
the Linux root file system. The GRUB root file system is the top level of the
specified device. For example, the image file (hd0,0)/grub/splash.xpm.gz is
located within the /grub/ directory at the top-level (or root) of the (hd0,0)
partition (which is actually the /boot/ partition for the system).

Next, the kernel command is executed with the location of the kernel file as an
option. Once the Linux kernel boots, it sets up the root file system that Linux

users are familiar with. The original GRUB root file system and its mounts are
forgotten; they only existed to boot the kernel file.

5.5. GRUB Interfaces


GRUB features three interfaces which provide different levels of functionality.
Each of these interfaces allows users to boot the Linux kernel or another
operating system. The interfaces are as follows:

Note

The following GRUB interfaces can only be accessed by pressing any key within the
three seconds of the GRUB menu bypass screen.

Menu Interface
This is the default interface shown when GRUB is configured by the installation
program. A menu of operating systems or preconfigured kernels are displayed as
a list, ordered by name. Use the arrow keys to select an operating system or
kernel version and press the Enter key to boot it. If you do nothing on this
screen, then after the time out period expires GRUB will load the default option.
Press the e key to enter the entry editor interface or the c key to load a command
line interface.

Menu Entry Editor Interface


To access the menu entry editor, press the e key from the boot loader menu. The
GRUB commands for that entry are displayed here, and users may alter these

Pakistan Computer Bureau 63


command lines before booting the operating system by adding a command line
(o inserts a new line after the current line and O inserts a new line before it),
editing one (e), or deleting one (d).

After all changes are made, the b key executes the commands and boots the
operating system. The Esc key discards any changes and reloads the standard
menu interface. The c key loads the command line interface.

Tip

For information about changing runlevels using the GRUB menu entry editor, refer to
Section 8, “Changing Runlevels at Boot Time”.

Command Line Interface


The command line interface is the most basic GRUB interface, but it is also the
one that grants the most control. The command line makes it possible to type any

Relevant GRUB commands followed by the Enter key to execute them. This
interface features some advanced shell-like features, including Tab key
completion based on context, and Ctrl key combinations when typing
commands, such as Ctrl-a to move to the beginning of a line and Ctrl-e to move
to the end of a line. In addition, the arrow, Home, End, and Delete keys work as
they do in the bash shell.

5.5.1. Interfaces Load Order


When GRUB loads its second stage boot loader, it first searches for its
configuration file. Once found, the menu interface bypass screen is displayed. If
a key is pressed within three seconds, GRUB builds a menu list and displays the
menu interface. If no key is pressed, the default kernel entry in the GRUB menu
is used.

• If the configuration file cannot be found, or if the configuration file is


unreadable, GRUB loads the command line interface, allowing the user to
type commands to complete the boot process.

• If the configuration file is not valid, GRUB prints out the error and asks
for input. This helps the user see precisely where the problem occurred.
Pressing any key reloads the menu interface, where it is then possible to
edit the menu option and correct the problem based on the error reported
by GRUB. If the correction fails, GRUB reports an error and reloads the
menu interface.

Pakistan Computer Bureau 64


5.6. GRUB Commands
GRUB allows a number of useful commands in its command line interface.
Some of the commands accept options after their name; these options should be
separated from the command and other options on that line by space characters.
The following is a list of useful commands:

Boot
Boots the operating system or chain loader that was last loaded.

chainloader </path/to/file>
Loads the specified file as a chain loader. If the file is located on the first sector
of the specified partition, use the blocklist notation, +1, instead of the file name.
The following is an example chainloader command:

• chainloader +1

Displaymem
It displays the current use of memory, based on information from the BIOS. This
is useful to determine how much RAM a system has prior to booting it.

initrd </path/to/initrd>
It enables users to specify an initial RAM disk to use when booting. An initrd is
necessary when the kernel needs certain modules in order to boot properly, such
as when the root partition is formatted with the ext3 file system.

The following is an example initrd command:

• initrd /initrd-2.6.8-1.523.img
• install <stage-1><install-disk><stage-2>pconfig-file
• Installs GRUB to the system MBR.

<stage-1>
Signifies a device, partition, and file where the first boot loader image can be
found, such as (hd0,0)/grub/stage1.

<install-disk>
Specifies the disk where the stage 1 boot loader should be installed, such as
(hd0).

<stage-2>

Pakistan Computer Bureau 65


Passes the stage 2 boot loader location to the stage 1 boot loader, such as
(hd0,0)/grub/stage2.

• p<config-file>

This option tells the install command to look for the menu configuration file
specified by <config-file>, such as (hd0,0)/grub/grub.conf.

Warning

The install command overwrites any information already located on the MBR.

kernel </path/to/kernel><option-1><option-N>
It specifies the kernel file to load when booting the operating system. Replace
</path/to/kernel> with an absolute path from the partition specified by the root

command. Replace <option-1> with options for the Linux kernel, such as
root=/dev/VolGroup00/LogVol00 to specify the device on which the root
partition for the system is located. Multiple options can be passed to the kernel in
a space separated list. The following is an example kernel command:

• kernel /vmlinuz-2.6.8-1.523 ro root=/dev/VolGroup00/LogVol00

The option in the previous example specifies that the root file system for Linux
is located on the hda5 partition.

• root (<device-type><device-number>,<partition>)

Configures the root partition for GRUB, such as (hd0,0), and mounts the
partition. The following is an example root command:

• root (hd0,0)

rootnoverify (<device-type><device-number>,<partition>)
It configures the root partition for GRUB, just like the root command, but does
not mount the partition.

Other commands are also available; type help --all for a full list of commands.
For a description of all GRUB commands, refer to the documentation available
online at http://www.gnu.org/software/grub/manual/.

Pakistan Computer Bureau 66


5.7. GRUB Menu Configuration File
The configuration file (/boot/grub/grub.conf), which is used to create the list of
operating systems to boot in GRUB's menu interface, essentially allows the user
to select a pre-set group of commands to execute.

5.7.1. Configuration File Structure


The GRUB menu interface configuration file is /boot/grub/grub.conf. The
commands to set the global preferences for the menu interface are placed at the
top of the file, followed by stanzas for each operating kernel or operating system
listed in the menu.

The following is a very basic GRUB menu configuration file designed to boot
either Red Hat Enterprise Linux or Microsoft Windows 2000:

• default=0
• timeout=10
• splashimage=(hd0,0)/grub/splash.xpm.gz
• hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-2.el5PAE)
• root (hd0,0)
• kernel /boot/vmlinuz-2.6.18-2.el5PAE ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.18-2.el5PAE.img

# section to load Windows

• title Windows rootnoverify (hd0,0) chainloader +1

This file configures GRUB to build a menu with Red Hat Enterprise Linux as the
default operating system and sets it to autoboot after 10 seconds. Two sections
are given, one for each operating system entry, with commands specific to the
system disk partition table.

Note

Note that the default is specified as an integer. This refers to the first title line in
the GRUB configuration file. For the Windows section to be set as the default in
the previous example, change the default=0 to default=1.

5.7.2. Configuration File Directives


The following are directives commonly used in the GRUB menu configuration
file:

Pakistan Computer Bureau 67


• chainloader </path/to/file>

Loads the specified file as a chain loader. Replace </path/to/file> with the
absolute path to the chain loader. If the file is located on the first sector of the
specified partition, use the blocklist notation, +1.

• color <normal-color><selected-color>

Allows specific colors to be used in the menu, where two colors are configured
as the foreground and background. Use simple color names such as red/black.
For example:

• color red/black green/blue


• default=<integer>
• Replace <integer> with the default entry title number to be loaded if the
menu interface times out.
• fallback=<integer>
• Replace <integer> with the entry title number to try if the first attempt fails.

Hiddenmenu
Prevents the GRUB menu interface from being displayed, loading the default
entry when the timeout period expires. The user can see the standard GRUB
menu by pressing the Esc key.

• initrd </path/to/initrd>

Enables users to specify an initial RAM disk to use when booting. Replace
</path/to/initrd> with the absolute path to the initial RAM disk.

kernel </path/to/kernel><option-1><option-N>
Specifies the kernel file to load when booting the operating system. Replace
</path/to/kernel> with an absolute path from the partition specified by the root
directive. Multiple options can be passed to the kernel when it is loaded.

password=<password>
Prevents a user who does not know the password from editing the entries for
this menu option. Optionally, it is possible to specify an alternate menu
configuration file after the password=<password> directive. In this case, GRUB
restarts the second stage boot loader and uses the specified alternate
configuration file to build the menu. If an alternate menu configuration file is left

Pakistan Computer Bureau 68


out of the command, a user who knows the password is allowed to edit the
current configuration file.

root (<device-type><device-number>,<partition>)
Configures the root partition for GRUB, such as (hd0,0), and mounts the
partition.

rootnoverify (<device-type><device-number>,<partition>)
Configures the root partition for GRUB, just like the root command, but does not
mount the partition.

timeout=<integer>
Specifies the interval, in seconds, that GRUB waits before loading the entry
designated in the default command.

splashimage=<path-to-image>
Specifies the location of the splash screen image to be used when GRUB boots.

title group-title
Specifies a title to be used with a particular group of commands used to load a
kernel or operating system.

To add human-readable comments to the menu configuration file, begin the line
with the hash mark character (#).

5.8. Changing Runlevels at Boot Time


Under Red Hat Enterprise Linux, it is possible to change the default runlevel at
boot time. To change the runlevel of a single boot session, use the following
instructions:

When the GRUB menu bypass screen appears at boot time, press any key to
enter the GRUB menu (within the first three seconds).

• Press the a key to append to the kernel command.

Add <space><runlevel> at the end of the boot options line to boot to the desired
runlevel.For example, the following entry would initiate a boot process into
runlevel 3:

• grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3

Pakistan Computer Bureau 69


5.9. Additional Resources
This chapter is only intended as an introduction to GRUB. Consult the following
resources to discover more about how GRUB works.

5.9.1. Installed Documentation


• /usr/share/doc/grub-<version-number>/

This directory contains good information about using and configuring GRUB,
where <version-number> corresponds to the version of the GRUB package
installed.

info grub
The GRUB info page contains a tutorial, a user reference manual, a programmer
reference manual, and a FAQ document about GRUB and its usage.

5.9.2. Useful Websites


http://www.gnu.org/software/grub/
• The home page of the GNU GRUB project. This site contains information
concerning the state of GRUB development and an FAQ.
http://kbase.redhat.com/faq/FAQ_43_4053.shtm
• Details booting operating systems other than Linux.
http://www.linuxgazette.com/issue64/kohli.html
• An introductory article discussing the configuration of GRUB on a system
from scratch, including an overview of GRUB command line options.

Pakistan Computer Bureau 70


6.1. What is Swap Space?
It’s an area on disk that temporarily holds a process memory image. When physical
memory demand is sufficiently low, process memory images are brought back into
physical memory from the swap area on disk. Having sufficient swap space enables the
system to keep some physical memory free at all times. This type of memory
management is often referred to as virtual memory and allows the total number of
processes to exceed physical memory. Virtual memory enables the execution of a
process within physical memory only as needed. Swap space can be a dedicated swap
partition (recommended), a swap file, or a combination of swap partitions and swap
files. Space allocation criteria should be equal to 2x physical RAM for up to 2 GB of
physical RAM, and then an additional 1x physical RAM for any amount above 2 GB,
but never less than 32 MB. Simply if, Memory in Ram is 512MB then Swap Space will
be

• 512*2 = 1024MB

Or

• if M = Amount of RAM in GB, and S = Amount of swap in GB, then

• If M < 2
• S = M *2
• Else
• S=M+2

Using this formula, a system with 2 GB of physical RAM would have 4 GB of


swap, while the other with 3 GB of physical RAM would have 5 GB of swap.
Creating a large swap space partition can be especially helpful if you plan to
upgrade your RAM at a later time. For systems with really large amounts of
RAM (more than 32 GB) you can likely get away with a smaller swap partition
(around 1x, or less, of physical RAM).

Important

File systems and LVM2 volumes assigned as swap space cannot be in use when being
modified. For example, no system processes can be assigned the swap space, as well as
no amount of swap should be allocated and used by the kernel. Use the free and cat
/proc/swaps commands to verify how much and where swap is in use.

The best way to achieve swap space modifications is to boot your system in rescue
mode, and then follow the instructions (for each scenario) in the remainder of this
chapter. Refer to the Red Hat Enterprise Linux Installation Guide for instructions on
booting into rescue mode. When prompted to mount the file system, select Skip.

Pakistan Computer Bureau 71


6.2. Extending / Adding Swap Space
Sometimes it happens that you want to add more swap space even after
installation. For example, you may upgrade the amount of RAM in your system
from 128 MB to 256 MB, but there is only 256 MB of swap space. It might be
advantageous to increase the amount of swap space to 512 MB if you perform
memory-intense operations or run applications that require a large amount of
memory. It is recommended that you extend an existing logical volume. To
extend or add swap space, basically you have three options:

• create a new swap partition


• create a new swap file
• extend swap on an existing LVM2 logical volume

6.2.1. Extending Swap on an LVM2 Logical Volume


In our example we assume /dev/VolGroup00/LogVol01 is the volume you want
to extend. To extend an LVM2 swap logical volume please

1. Disable the swapping for the associated logical volume:

• # swapoff -v /dev/VolGroup00/LogVol01

2. Resize the LVM2 logical volume by 256 MB:

• # lvm lvresize /dev/VolGroup00/LogVol01 -L +256M

3. Format the new swap space:

• # mkswap /dev/VolGroup00/LogVol01

4. Enable the extended logical volume:

• # swapon –va

5. Test that the logical volume has been extended properly:

• # cat /proc/swaps # free

6.2.2. Creating an LVM2 Logical Volume for Swap


In our example we assume /dev/VolGroup00/LogVol02 is the swap volume you
want to add. To add a swap volume group please
1. Create the LVM2 logical volume of size 256 MB:

Pakistan Computer Bureau 72


• # lvm lvcreate VolGroup00 -n LogVol02 -L 256M

2. Format the new swap space:

• # mkswap /dev/VolGroup00/LogVol02

3. Add the following entry to the /etc/fstab file:

• /dev/VolGroup00/LogVol02 swap swap defaults 0 0

4. Enable the extended logical volume:

• # swapon –va

5. Test that the logical volume has been extended properly:

• # cat /proc/swaps # free

6.2.3. Creating a Swap File


To add a swap file: Determine the size of the new swap file in megabytes and
multiply by 1024 to determine the number of blocks. For example, the block size
of a 64 MB swap file is 65536. At a shell prompt as root, type the following
command with count being equal to the desired block size:

• dd if=/dev/zero of=/swapfile bs=1024 count=65536

Setup the swap file with the command:

• mkswap /swapfile

To enable the swap file immediately but not automatically at boot time:

• swapon /swapfile

To enable it at boot time, edit /etc/fstab to include the following entry:

• /swapfile swap swap defaults 0 0


The next time the system boots, it enables the new swap file.

After adding the new swap file and enabling it, verify it is enabled by viewing
the output of the command cat /proc/swaps or free.

Pakistan Computer Bureau 73


6.3. Removing Swap Space
Sometimes it can be prudent to reduce swap space after installation. For
example, say you downgraded the amount of RAM in your system from 1 GB to
512 MB, but there is 2 GB of swap space still assigned. It might be
advantageous to reduce the amount of swap space to 1 GB, since the larger 2
GB could be wasting disk space.You have three options: remove an entire
LVM2 logical volume used for swap, remove a swap file, or reduce swap space
on an existing LVM2 logical volume.

6.3.1. Reducing Swap on an LVM2 Logical Volume


To reduce an LVM2 swap logical volume (assuming dev/VolGroup00/LogVol01
is the volume you want to extend):

1. Disable swapping for the associated logical volume:

• # swapoff -v /dev/VolGroup00/LogVol01

2. Reduce the LVM2 logical volume by 512 MB:

• # lvm lvreduce /dev/VolGroup00/LogVol01 -L -512M

3. Format the new swap space:

• # mkswap /dev/VolGroup00/LogVol01

4. Enable the extended logical volume:

• # swapon –va

5. Test that the logical volume has been reduced properly:

• # cat /proc/swaps # free

6.3.2. Removing an LVM2 Logical Volume for Swap


The swap logical volume cannot be in use (no system locks or processes on the
volume). The easiest way to achieve this is to boot your system in rescue mode.
Refer to for instructions on booting into rescue mode. When prompted to mount
the file system, select Skip.

Pakistan Computer Bureau 74


To remove a swap volume group
(Assuming /dev/VolGroup00/LogVol02) is the swap volume you want to remove:

1. Disable swapping for the associated logical volume:

• # swapoff -v /dev/VolGroup00/LogVol02

2. Remove the LVM2 logical volume of size 512 MB:

• # lvm lvremove /dev/VolGroup00/LogVol02

3. Remove the following entry from the /etc/fstab file:

• /dev/VolGroup00/LogVol02 swap swap defaults 0 0

4. Test that the logical volume has been extended properly:

• # cat /proc/swaps # free

6.3.3. Removing a Swap File


To remove a swap file:
1. At a shell prompt as root, execute the following command to disable the swap
file (where /swapfile is the swap file):

• # swapoff -v /swapfile

2. Remove its entry from the /etc/fstab file.

3. Remove the actual file:

• # rm /swapfile

6.4. Moving Swap Space


To move swap space from one location to another, follow the steps for removing
swap space, and then follow the steps for adding swap space.

Pakistan Computer Bureau 75


7.1. Standard Partitions using parted
The utility parted allows users to:

ƒ View the existing partition table


ƒ Change the size of existing partitions
ƒ Add partitions from free space or additional hard drives

By default, the parted package is included when installing Red Hat Enterprise
Linux. To start parted, log in as root and type the command parted /dev/sda at a
shell prompt (where /dev/sda is the device name for the drive you want to
configure).

A device containing a partition must not be in use if said partition is to be


removed or resized. Similarly, when creating a new partition on a device, said
device must not be in use. For a device to not be in use, none of the partitions on
the device can be mounted, and any swap space on the device must not be
enabled. As well, the partition table should not be modified while it is in use
because the kernel may not properly recognize the changes. If the partition table
does not match the actual state of the mounted partitions, information could be
written to the wrong partition, resulting in lost and overwritten data. The easiest
way to achieve this is to boot your system in rescue mode. When prompted to
mount the file system, select Skip. Alternately, if the drive does not contain any
partitions in use (system processes that use or lock the file system from being
unmounted), you can unmount them with the umount command and turn off all
the swap space on the hard drive with the swapoff command.

Table below contains a list of commonly used parted commands. The sections
that follow explain some of these commands and arguments in more detail.

Command Description
check minor-num Perform a simple check of the file system
Copy file system from one partition to
cp fromto another; from and to are the minor
numbers of the partitions
Help Display list of available commands
mktable label Create a disk label for the partition table
Create a file system of type
mkfs minor-numfile-system-type
file-system-type
Make a partition without creating a new
mkpart part-typefs-typestart-mbend-mb
file system
Make a partition and create the specified
Mkpartfs part-typefs-typestart-mbend-mb file system

move minor-numstart-mbend-mb

Pakistan Computer Bureau 76


Name the partition for Mac and PC98
name minor-numname
Print Display the partition table
Quit Quit parted
Rescue a lost partition from start-mb to
rescuestart-mbend-mb
end-mb
Resize the partition from start-mb to end-
resize minor-numstart-mbend-mb
mb
rm minor-num Remove the partition
select device Select a different device to configure
Set the flag on a partition; state is either
set minor-numflagstate
on or off
Toggle the state of FLAG on partition
toggle [NUMBER [FLAG]
NUMBER
unit UNIT Set the default unit to UNIT

7.1.1. Viewing the Partition Table


After starting parted, use the command print to view the partition table. A table
similar to the following appears:
Model: ATA ST3160812AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 107MB 107MB primary ext3 boot
2 107MB 105GB 105GB primary ext3
3 105GB 107GB 2147MB primary linux-swap
4 107GB 160GB 52.9GB extended root
5 107GB 133GB 26.2GB logical ext3
6 133GB 133GB 107MB logical ext3
7 133GB 160GB 26.6GB logical lvm

The first line contains the disk type, manufacturer, model number and interface,
and the second line displays the disk label type. The remaining output below the
fourth line shows the partition table. In the partition table, the Minor number is
the partition number. For example, the partition with minor number 1
corresponds to /dev/sda1. The Start and End values are in megabytes. Valid Types
are metadata, free, primary, extended, or logical. The File system is the file
system type, which can be any of the following:

ƒ ext2
ƒ ext3
ƒ fat16
ƒ fat32
ƒ hfs
ƒ jfs
Pakistan Computer Bureau 77
ƒ linux-swap
ƒ ntfs
ƒ reiserfs
ƒ hp-ufs
ƒ sun-ufs
ƒ xfs

If a File system of a device shows no value, this means that its file system type is
unknown. The Flags column lists the flags set for the partition. Available flags
are boot, root, swap, hidden, raid, lvm, or lba.

Tip

To select a different device without having to restart parted, use the select command
followed by the device name (for example, /dev/sda). Doing so allows you to view or
configure the partition table of a device.

7.1.2. Creating a Partition


Warning

Do not attempt to create a partition on a device that is in use.

Before creating a partition, boot into rescue mode (or unmount any partitions on
the device and turn off any swap space on the device). Start parted, where
/dev/sda is the device on which to create the partition:
ƒ parted /dev/sda
View the current partition table to determine if there is enough free space:
ƒ print
If there is not enough free space, you can resize an existing partition.

7.1.2.1. Making the Partition


From the partition table, determine the start and end points of the new partition
and what partition type it should be. You can only have four primary partitions
(with no extended partition) on a device. If you need more than four partitions,
you can have three primary partitions, one extended partition, and multiple

logical partitions within the extended. For example, to create a primary partition
with an ext3 file system from 1024 megabytes until 2048 megabytes on a hard
drive type the following command:

ƒ mkpart primary ext3 1024 2048

Pakistan Computer Bureau 78


Tip

If you use the mkpartfs command instead, the file system is created after the partition is
created. However, parted does not support creating an ext3 file system. Thus, if you
wish to create an ext3 file system, use mkpart and create the file system with the mkfs
command as described later.

The changes start taking place as soon as you press Enter, so review the
command before executing to it. After creating the partition, use the print
command to confirm that it is in the partition table with the correct partition
type, file system type, and size. Also remember the minor number of the new
partition so that you can label it. You should also view the output of

ƒ cat /proc/partitions
to make sure the kernel recognizes the new partition.

7.1.2.2. Formating the Partition


The partition still does not have a file system. Create the file system:
ƒ /sbin/mkfs -t ext3 /dev/sda6
Warning

Formatting the partition permanently destroys any data that currently exists on the
partition.

7.1.2.3. Labeling the Partition


Next, give the partition a label. For example, if the new partition is /dev/sda6 and
you want to label it /work:
ƒ e2label /dev/sda6 /work
By default, the installation program uses the mount point of the partition as the
label to make sure the label is unique. You can use any label you want.

7.1.2.4. Creating the Mount Point


As root, create the mount point:
ƒ mkdir /work
7.1.2.5. Add to /etc/fstab
As root, edit the /etc/fstab file to include the new partition. The new line should
look similar to the following:
ƒ LABEL=/work /work ext3 defaults 1 2
The first column should contain LABEL= followed by the label you gave the
partition. The second column should contain the mount point for the new
partition, and the next column should be the file system type (for example, ext3
Pakistan Computer Bureau 79
or swap). If you need more information about the format, read the man page with
the command man fstab.
If the fourth column is the word defaults, the partition is mounted at boot time.
To mount the partition without rebooting, as root, type the command:
ƒ mount /work
7.1.3. Removing a Partition
Warning

Do not attempt to remove a partition on a device that is in use.

Before removing a partition, boot into rescue mode (or unmount any partitions
on the device and turn off any swap space on the device). Start parted, where
/dev/sda is the device on which to remove the partition:

ƒ parted /dev/sda
View the current partition table to determine the minor number of the partition to
remove:
ƒ print

Remove the partition with the command rm. For example, to remove the
partition with minor number 3:
ƒ rm 3
The changes start taking place as soon as you press Enter, so review the
command before committing to it. After removing the partition, use the print
command to confirm that it is removed from the partition table. You should also
view the output of

ƒ cat /proc/partitions

to make sure the kernel knows the partition is removed. The last step is to
remove it from the /etc/fstab file. Find the line that declares the removed
partition, and remove it from the file.

7.1.4. Resizing a Partition


Warning

Do not attempt to resize a partition on a device that is in use.

Before resizing a partition, boot into rescue mode (or unmount any partitions on
the device and turn off any swap space on the device). Start parted, where
/dev/sda is the device on which to resize the partition:
Pakistan Computer Bureau 80
ƒ parted /dev/sda
View the current partition table to determine the minor number of the partition to
resize as well as the start and end points for the partition:
ƒ print

To resize the partition, use the resize command followed by the minor number
for the partition, the starting place in megabytes, and the end place in megabytes.
For example:
ƒ resize 3 1024 2048
Warning

A partition cannot be made larger than the space available on the device

After resizing the partition, use the print command to confirm that the partition
has been resized correctly, is the correct partition type, and is the correct file
system type. After rebooting the system into normal mode, use the command df
to make sure the partition was mounted and is recognized with the new size.

7.2. LVM Partition Management


The following commands can be found by issuing lvm help at a command
prompt.
Command Description
dumpconfig Dump the active configuration
formats List the available metadata
formats
help Display the help commands
lvchange Change the attributes of logical
volume(s)
lvcreate Create a logical volume
lvdisplay Display information about a
logical volume
lvextend Add space to a logical volume
lvmchange Due to use of the device mapper,
this command has been
deprecated
lvmdiskscan List devices that may be used as
physical volumes
lvmsadc Collect activity data
lvmsar Create activity report
lvreduce Reduce the size of a logical
volume
lvremove Remove logical volume(s) from
the system
lvrename Rename a logical volume
Pakistan Computer Bureau 81
lvresize Resize a logical volume
lvs Display information about logical
volumes
lvscan List all logical volumes in all
volume groups
pvchange Change attributes of physical
volume(s)
pvcreate Initialize physical volume(s) for
use by LVM
pvdata Display the on-disk metadata for
physical volume(s)
pvdisplay Display various attributes of
physical volume(s)
pvmove Move extents from one physical
volume to another
pvremove Remove LVM label(s) from
physical volume(s)
pvresize Resize a physical volume in use
by a volume group
pvs Display information about
physical volumes
pvscan List all physical volumes
segtypes List available segment types
vgcfgbackup Backup volume group
configuration
vgcfgrestore Restore volume group
configuration
vgchange Change volume group attributes
vgck Check the consistency of a
volume group
vgconvert Change volume group metadata
format
vgcreate Create a volume group
vgdisplay Display volume group
information
vgexport Unregister a volume group from
the system
vgextend Add physical volumes to a
volume group
vgimport Register exported volume group
with system
vgmerge Merge volume groups
vgmknodes Create the special files for
volume group devices in /dev/
vgreduce Remove a physical volume from
a volume group
vgremove Remove a volume group
vgs Display information about
volume groups

Pakistan Computer Bureau 82


vgscan Search for all volume groups
vgsplit Move physical volumes into a
new volume group
version Display software and driver
version information

Pakistan Computer Bureau 83


Files and directories have permission sets for the owner of the file, the group
associated with the file, and all other users for the system. However, these
permission sets have limitations. For example, different permissions cannot be
configured for different users. Thus, Access Control Lists (ACLs) were
implemented. The Red Hat Enterprise Linux 5 kernel provides ACL support for
the ext3 file system and NFS-exported file systems. ACLs are also recognized on
ext3 file systems accessed via Samba. Along with support in the kernel, the acl
package is required to implement ACLs. It contains the utilities used to add,
modify, remove, and retrieve ACL information. The cp and mv commands copy
or move any ACLs associated with files and directories.

8.1. Mounting File Systems


Before using ACLs for a file or directory, the partition for the file or directory
must be mounted with ACL support. If it is a local ext3 file system, it can be
mounted with the following command:
ƒ mount -t ext3 -o acl <device-name><partition>
For example:
ƒ mount -t ext3 -o acl /dev/VolGroup00/LogVol02 /work

Alternatively, if the partition is listed in the /etc/fstab file, the entry for the
partition can include the acl option:
ƒ LABEL=/work /work ext3 acl 1 2
If an ext3 file system is accessed via Samba and ACLs have been enabled for it,
the ACLs are recognized because Samba has been compiled with the --with-acl-
support option. No special flags are required when accessing or mounting a
Samba share.

8.1.1. NFS
By default, if the file system being exported by an NFS server supports ACLs and
the NFS client can read ACLs, ACLs are utilized by the client system. To disable
ACLs on NFS shares when configuring the server, include the no_acl option in
the /etc/exports file. To disable ACLs on an NFS share when mounting it on a
client, mount it with the no_acl option via the command line or the /etc/fstab file.

8.2. Setting Access ACLs


There are two types of ACLs: access ACLs and default ACLs. An access ACL
is the access control list for a specific file or directory. A default ACL can only

Pakistan Computer Bureau 84


be associated with a directory; if a file within the directory does not have an
access ACL, it uses the rules of the default ACL for the directory. Default ACLs
are optional. ACLs can be configured:

ƒ Per user
ƒ Per group
ƒ Via the effective rights mask
ƒ For users not in the user group for the file

The setfacl utility sets ACLs for files and directories. Use the -m option to add or
modify the ACL of a file or directory:
ƒ setfacl -m <rules><files>
Rules (<rules>) must be specified in the following formats. Multiple rules can
be specified in the same command if they are separated by commas.

u:<uid>:<perms>
Sets the access ACL for a user. The user name or UID may be specified. The
user may be any valid user on the system.

g:<gid>:<perms>
Sets the access ACL for a group. The group name or GID may be specified.
The group may be any valid group on the system.

m:<perms>
Sets the effective rights mask. The mask is the union of all permissions of the
owning group and all of the user and group entries.

o:<perms>
Sets the access ACL for users other than the ones in the group for the file.

White space is ignored. Permissions (<perms>) must be a combination of the


characters r, w, and x for read, write, and execute. If a file or directory already
has an ACL, and the setfacl command is used, the additional rules are added to
the existing ACL or the existing rule is modified. For example, to give read and
write permissions to user andrius:
ƒ setfacl -m u:andrius:rw /project/somefile
To remove all the permissions for a user, group, or others, use the -x option and
do not specify any permission (s):

Pakistan Computer Bureau 85


ƒ setfacl -x <rules><files>
For example, to remove all permissions from the user with UID 500:
ƒ setfacl -x u:500 /project/somefile

8.3. Setting Default ACLs


To set a default ACL, add d: before the rule and specify a directory instead of a
file name. For example, to set the default ACL for the /share/ directory to read
and execute for users not in the user group (an access ACL for an individual file
can override it):
ƒ setfacl -m d:o:rx /share

8.4. Retrieving ACLs


To determine the existing ACLs for a file or directory, use the getfacl command.
In the example below, the getfacl is used to determine the existing ACLs for a
file.
ƒ getfacl home/john/picture.png
The above command returns the following output:
# file: home/john/picture.png # owner: john # group: john user::rw-
group::r-- other::r--

If a directory with a default ACL is specified, the default ACL is also displayed
as illustrated below.

[john@main /]$ getfacl home/sales/# file: home/sales/ # owner: john # group:


john user::rw- user:barryg:r-- group::r-- mask::r-- other::r-- default:user::rwx
default:user:john:rwx default:group::r-x default:mask::rwx default:other::r-x

8.5. Archiving File Systems With ACLs


Warning

The tar and dump commands do not backup ACLs.

The star utility is similar to the tar utility in that it can be used to generate
archives of files. The star package is required to use this utility. The command
line options for Star are as follows

Option Description
-c Creates an archive file.
-n Do not extract the files; use in
conjunction with -x to show what
extracting the files does.

Pakistan Computer Bureau 86


-r Replaces files in the archive. The
files are written to the end of the
archive file, replacing any files with
the same path and file name.
-t Displays the contents of the archive
file.
-u Updates the archive file. The files are
written to the end of the archive if they
do not exist in the archive or if the files
are newer than the files of the same
name in the archive. This option only
work if the archive is a file or an
unblocked tape that may backspace.
-x Extracts the files from the archive. If
used with -U and a file in the archive is
older than the corresponding file on the
file system, the file is not extracted.
-help Displays the most important options.
-xhelp Displays the least important options.
-/ Do not strip leading slashes from file
names when extracting the files from an
archive. By default, they are striped
when files are extracted.
-acl When creating or extracting, archive or
restore any ACLs associated with the
files and directories.

8.6. Compatibility with Older Systems


If an ACL has been set on any file on a given file system that files system has the
ext_attr attribute. This attribute can be seen using the following command:
ƒ tune2fs -l <filesystem-device>
A file system that has acquired the ext_attr attribute can be mounted with older
kernels, but those kernels do not enforce any ACLs which have been set.
Versions of the e2fsck utility included in version 1.22 and higher of the e2fsprogs
package (including the versions in Red Hat Enterprise Linux 2.1 and 4) can
check a file system with the ext_attr attribute. Older versions refuse to check it.

8.7. Useful Websites


Refer to the follow resources for more information.

ƒ http://acl.bestbits.at/ — Website for ACLs

Pakistan Computer Bureau 87


The RPM Package Manager (RPM) is an open packaging system, which runs on
Red Hat Enterprise Linux as well as other Linux and UNIX systems.
Red Hat, Inc. encourages other vendors to use RPM for their own products.
RPM is distributed under the terms of the GPL. The utility works only with
packages built for processing by the rpm package. For the end user, RPM makes
system updates easy. Installing, uninstalling, and upgrading RPM packages can
be accomplished with short commands. RPM maintains a database of installed
packages and their files, so you can invoke powerful queries and verifications on
your system. If you prefer a graphical interface, you can use the Package
Management Tool to perform many RPM commands.

Important

When installing a package, please ensure it is compatible with your operating system
and architecture. This can usually be determined by checking the package name.

During upgrades, RPM handles configuration files carefully, so that you never
lose your customizations — something that you cannot accomplish with regular
.tar, .gz files. For the developer, RPM allows you to take software source
code and package it into source and binary packages for end users. This process
is quite simple and is driven from a single file and optional patches that you
create. This clear delineation between pristine sources and your patches
along with build instructions eases the maintenance of the package as new
versions of the software are released.

Note

Because RPM makes changes to your system, you must be logged in as root to install,
remove, or upgrade an RPM package.

9.1. RPM Design Goals


To understand how to use RPM, it can be helpful to understand the design goals
of RPM:

Upgradability
With RPM, you can upgrade individual components of your system without

Completely reinstalling. When you get a new release of an operating

Pakistan Computer Bureau 88


system Based on RPM (such as Red Hat Enterprise Linux), you
do not need to reinstall on your machine (as you do with operating systems
based on other packaging systems). RPM allows intelligent, fully-
automated, in-place upgrades of your system. Configuration files in
packages are preserved across upgrades, so you do not lose your
customizations. There is no special upgrade files needed to upgrade a
package because the same RPM file is used to install and upgrade the
package on your system.

Powerful Querying
RPM is designed to provide powerful querying options. You can do
searches through your entire database for packages or just for certain files.
You can also easily find out what package a file belongs to and from
where the package came. The files an RPM package contains are in a
compressed archive, with a custom binary header containing useful
information about the package and its contents, allowing you to query
individual packages quickly and easily.

System Verification
Another powerful RPM feature is the ability to verify packages. If you are
worried that you deleted an important file for some package, you can
verify the package. You are then notified of any anomalies, if any — at
which point, you can reinstall the package if necessary. Any configuration
files that you modified are preserved during reinstallation.

Pristine Sources
A crucial design goal was to allow the use of pristine software
sources, as distributed by the original authors of the software. With RPM,
you have the pristine sources along with any patches that were used, plus
complete build instructions. This is an important advantage for several
reasons. For instance, if a new version of a program is released, you do not
necessarily have to start from scratch to get it to compile. You can look at
the patch to see what you might need to do. All the compiled-in defaults,
and all of the changes that were made to get the software to build properly,
are easily visible using this technique. The goal of keeping sources pristine
may seem important only for developers, but it results in higher quality

Pakistan Computer Bureau 89


software for end users, too.

9.2. Using RPM


RPM has five basic modes of operation (not counting package building):
installing, uninstalling, upgrading, querying, and verifying. This section contains
an overview of each mode.

9.2.1. Finding RPM Packages


Before using any RPM packages, you must know where to find them. An
Internet search returns many RPM repositories, but if you are looking for RPM
packages built by Red Hat, they can be found at the following locations:

ƒ The Red Hat Enterprise Linux CD-ROMs


ƒ The Red Hat Errata Page available at
http://www.redhat.com/apps/support/errata/
ƒ Red Hat Network

9.2.2. Installing
RPM packages typically have file names like foo-1.0-1.i386.rpm. The file name
includes the package name (foo), version (1.0), release (1), and architecture
(i386). To install a package, log in as root and type the following command at
a shell prompt:
ƒ rpm -ivh foo-1.0-1.i386.rpm
Alternatively, the following command can also be used:
ƒ rpm -Uvh foo-1.0-1.i386.rpm
If the installation is successful, the following output is displayed:

Preparing...
########################################### [100%]
1:foo ###########################################
[100%]

As you can see, RPM prints out the name of the package and then prints a
succession of hash marks as a progress meter while the package is installed. The
signature of a package is checked automatically when installing or upgrading a
package. The signature confirms that the package was signed by an authorized

Pakistan Computer Bureau 90


party. For example, if the verification of the signature fails, an error message
such as the following is displayed:

ƒ error: V3 DSA signature: BAD, key ID 0352860f


If it is a new, header-only, signature, an error message such as the following is
displayed:
ƒ error: Header V3 DSA signature: BAD, key ID
0352860f
If you do not have the appropriate key installed to verify the signature, the
message contains the word NOKEY such as:
ƒ warning: V3 DSA signature: NOKEY, key ID
0352860f

Warning

If you are installing a kernel package, you should use rpm -ivh instead.

9.2.2.1. Package Already Installed


If a package of the same name and version is already installed, the following
output is displayed:

Preparing...
########################################### [100%]
package
foo-1.0-1 is already installed

However, if you want to install the package anyway, you can use the --
replacepkgs option, which tells RPM to ignore the error:
ƒ rpm -ivh --replacepkgs foo-1.0-1.i386.rpm

This option is helpful if files installed from the RPM were deleted or if you want
the original configuration files from the RPM to be installed.

9.2.2.2. Conflicting Files


If you attempt to install a package that contains a file which has already been
installed by another package, the following is displayed:

Pakistan Computer Bureau 91


Preparing...
########################################### [100%]
file
/usr/bin/foo from install of foo-1.0-1 conflicts
with file from package bar-2.0.20

To make RPM ignore this error, use the --replacefiles option:

ƒ rpm -ivh --replacefiles foo-1.0-1.i386.rpm

9.2.2.3. Unresolved Dependency


RPM packages may sometimes depend on other packages, which mean that they
require other packages to be installed to run properly. If you try to install a
package which has an unresolved dependency, output similar to the following is
displayed:
error: Failed dependencies: bar.so.2 is needed by foo-
1.0-1 Suggested
resolutions: bar-2.0.20-3.i386.rpm

If you are installing a package from the Red Hat Enterprise Linux CD-
ROM set, it usually suggests the package(s) needed to resolve the dependency.
Find the suggested package(s) on the Red Hat Enterprise Linux CD-
ROMs or from Red Hat Network, and add it to the command:

ƒ rpm -ivh foo-1.0-1.i386.rpm bar-2.0.20-


3.i386.rpm
If installation of both packages is successful, output similar to the following is
displayed:
Preparing...
########################################### [100%]
1:foo
########################################### [ 50%]
2:bar

########################################### [100%]

If it does not suggest a package to resolve the dependency, you can try the –
redhat provides option to determine which package contains the required
file. You need the rpmdb-redhat package installed to use this option.
ƒ rpm -q --redhatprovides bar.so.2

Pakistan Computer Bureau 92


If the package that contains bar.so.2 is in the installed database from the
rpmdb-redhat package, the name of the package is displayed:
ƒ bar-2.0.20-3.i386.rpm
To force the installation anyway (which is not recommended since the package
may not run correctly), use the --nodeps option.

9.2.3. Uninstalling
Uninstalling a package is just as simple as installing one. Type the following
command at a shell prompt:
ƒ rpm -e foo
Note

Notice that we used the package namefoo, not the name of the original package
filefoo-1.0-1.i386.rpm. To uninstall a package, replace foo with the actual
package name of the original package.

You can encounter a dependency error when uninstalling a package if another


installed package depends on the one you are trying to remove. For example:

error: Failed dependencies: foo is needed by (installed)


bar-2.0.20-3.i386.rpm

To make RPM ignore this error and uninstall the package anyway (which may
break the package dependent on it) use the --nodeps option.

9.2.4. Upgrading
Upgrading a package is similar to installing one. Type the following command
at a shell prompt:

ƒ rpm -Uvh foo-2.0-1.i386.rpm

As part of upgrading a package, RPM automatically uninstalls any old versions


of the foo package. Note that -U will also install a package even when there are
no previous versions of the package installed.
Tip

It is not advisable to use the -U option for installing kernel packages, because RPM
replaces the previous kernel package. This does not affect a running system, but if the

Pakistan Computer Bureau 93


new kernel is unable to boot during your next restart, there would be no other kernel to
boot instead.Using the -i option adds the kernel to your GRUB boot menu
(/etc/grub.conf). Similarly, removing an old, unneeded kernel removes the
kernel from GRUB.

Because RPM performs intelligent upgrading of packages with configuration


files, you may see a message like the following:
ƒ saving /etc/foo.conf as /etc/foo.conf.rpmsave
This message means that changes you made to the configuration file may not be
forward compatible with the new configuration file in the package, so RPM
saved your original file and installed a new one. You should investigate the
differences between the two configuration files and resolve them as soon as
possible, to ensure that your system continues to function properly. If you
attempt to upgrade to a package with an older version number (that is, if a
more updated version of the package is already installed), the output is similar to
the following:

ƒ package foo-2.0-1 (which is newer than foo-1.0-


1) is already installed

To force RPM to upgrade anyway, use the --oldpackage option:

ƒ rpm -Uvh --oldpackage foo-1.0-1.i386.rpm

9.2.5. Freshening
Freshening is similar to upgrading, except that only existent packages are
upgraded. Type the following command at a shell prompt:
ƒ rpm -Fvh foo-1.2-1.i386.rpm

RPM's freshen option checks the versions of the packages specified on the
command line against the versions of packages that have already been installed
on your system. When a newer version of an already-installed package is
processed by RPM's freshen option, it is upgraded to the newer version.
However, RPM's freshen option does not install a package if no previously-
installed package of the same name exists. This differs from RPM's upgrade

Pakistan Computer Bureau 94


option, as an upgrade does install packages whether or not an older version of
the package was already installed. Freshening works for single packages or
package groups. If you have just downloaded a large number of different
packages, and you only want to upgrade those packages that are already
installed on your system, freshening does the job. Thus, you do not have to
delete any unwanted packages from the group that you downloaded before using
RPM. In this case, issue the following command:

ƒ rpm -Fvh *.rpm

RPM automatically upgrades only those packages that are already installed.

9.2.6. Querying
The RPM database stores information about all RPM packages installed in your
system. It is stored in the directory /var/lib/rpm/, and is used to query
what packages are installed, what versions each package is, and any changes to
any files in the package since installation, among others.
To query this database, use the -q option. The rpm -q package name
command displays the package name, version, and release number of the
installed package name. For example, using rpm -q foo to query installed
package foo might generate the following output:

ƒ foo-2.0-1
You can also use the following Package Selection Options with -q to further
refine or qualify
Your query:

ƒ -a — queries all currently installed packages.

ƒ -f <filename> — queries the RPM database for which package owns


<filename>. When specifying a file, specify the absolute path of the
file (for example, rpm -f /bin/ls).
ƒ -p <packagefile> — queries the uninstalled package <packagefile>.

There are a number of ways to specify what information to display about queried
packages. The following options are used to select the type of information for
which you are searching. These are called Information Query Options.

Pakistan Computer Bureau 95


ƒ -i displays package information including name, description, release,
size, build date, install date, vendor, and other miscellaneous information.
ƒ -l displays the list of files that the package contains.
ƒ -s displays the state of all the files in the package.
ƒ -d displays a list of files marked as documentation (man pages, info
pages, READMEs, etc.).
ƒ -c displays a list of files marked as configuration files. These are the files
you edit after installation to adapt and customize the package to your
system (for example, sendmail.cf, passwd, inittab, etc.).

9.2.7. Verifying
Verifying a package compares information about files installed from a package
with the same information from the original package. Among other things,
verifying compares the size, MD5 sum, permissions, type, owner, and group of
each file. The command rpm -V verifies a package. You can use any of the
Package Verify Options listed for querying to specify the packages you
wish to verify. A simple use of verifying is rpm -V foo, which verifies that all
the files in the foo package are as they were when they were originally
installed. For example:

To verify a package containing a particular file:


ƒ rpm -Vf /usr/bin/foo

In this example, /usr/bin/foo is the absolute path to the file used to query a
package.

To verify ALL installed packages throughout the system:


ƒ rpm -Va

To verify an installed package against an RPM package file:


ƒ rpm -Vp foo-1.0-1.i386.rpm

This command can be useful if you suspect that your RPM databases are corrupt.
If everything verified properly, there is no output. If there are any discrepancies,
they are displayed. The format of the output is a string of eight characters (a c
denotes a configuration file) and then the file name. Each of the

Pakistan Computer Bureau 96


eight characters denotes the result of a comparison of one attribute of the file to
the value of that attribute recorded in the RPM database. A single period (.)
means the test passed. The following characters denote specific discrepancies:
ƒ 5 — MD5 checksum
ƒ S — file size
ƒ L — symbolic link
ƒ T — file modification time
ƒ D — device
ƒ U — user
ƒ G — group
ƒ M — mode (includes permissions and file type)
ƒ ? — unreadable file

If you see any output, use your best judgment to determine if you should remove
the package, reinstall it, or fix the problem in another way.

9.3. Checking a Package's Signature


If you wish to verify that a package has not been corrupted or tampered with,
examine only the md5sum by typing the following command at a shell prompt
(where <rpm-file> is the file name of the RPM package):

ƒ rpm -K --nosignature <rpm-file>


The message <rpm-file>: md5 OK is displayed. This brief message means
that the file was not corrupted by the download. To see a more verbose message,
replace -K with -Kvv in the command.

On the other hand, how trustworthy is the developer who created the package? If
the package is signed with the developer's GnuPG key, you know that the
developer really is who they say they are. An RPM package can be signed using
Gnu Privacy Guard (or GnuPG), to help you make certain your
downloaded package is trustworthy.
GnuPG is a tool for secure communication; it is a complete and free replacement
for the encryption technology of PGP, an electronic privacy program. With
GnuPG, you can authenticate the validity of documents and
encrypt/decrypt data to and from other recipients. GnuPG is capable of
decrypting and verifying PGP 5.x files as well.
During installation, GnuPG is installed by default. That way you can

Pakistan Computer Bureau 97


immediately start using GnuPG to verify any packages that you receive from Red
Hat. Before doing so, you must first import Red Hat's public key.

9.3.1. Importing Keys


To verify Red Hat packages, you must import the Red Hat GPG key. To do so,
execute the following command at a shell prompt:
ƒ rpm --import /usr/share/rhn/RPM-GPG-KEY
To display a list of all keys installed for RPM verification, execute the command:
ƒ rpm -qa gpg-pubkey*
For the Red Hat key, the output includes:
ƒ gpg-pubkey-db42a60e-37ea5438

To display details about a specific key, use rpm -qi followed by the output
from the previous command:

ƒ rpm -qi gpg-pubkey-db42a60e-37ea5438

9.3.2. Verifying Signature of Packages


To check the GnuPG signature of an RPM file after importing the builder's
GnuPG key, use the following command (replace <rpm-file> with
the filename of the RPM package):
ƒ rpm -K <rpm-file>
If all goes well, the following message is displayed: md5 gpg OK. This means
that the signature of the package has been verified, and that it is not corrupt.

9.4. Practical and Common Examples of RPM Usage


RPM is a useful tool for both managing your system and diagnosing and fixing
problems. The best way to make sense of all of its options is to look at some
examples.

ƒ Perhaps you have deleted some files by accident, but you are not sure
what you deleted. To verify your entire system and see what might be
missing, you could try the following command:
o rpm -Va

Pakistan Computer Bureau 98


If some files are missing or appear to have been corrupted, you should probably
either re-install the package or uninstall and then re-install the package.
ƒ At some point, you might see a file that you do not recognize. To find
out which package owns it, enter:
o rpm -qf /usr/bin/ggv
The output would look like the following:
ƒ ggv-2.6.0-2
We can combine the above two examples in the following scenario. Say you are
having problems with /usr/bin/paste. You would like to verify the
package that owns that program, but you do not know which package owns
paste. Enter the following command,

ƒ rpm -Vf /usr/bin/paste

and the appropriate package is verified.

Do you want to find out more information about a particular program? You can
try the following command to locate the documentation which came with the
package that owns that program:

ƒ rpm -qdf /usr/bin/free

The output would be similar to the following:


ƒ /usr/share/doc/procps-3.2.3/BUGS /usr/share/doc/procps-3.2.3/FAQ
ƒ /usr/share/doc/procps-3.2.3/NEWS /usr/share/doc/procps-3.2.3/TODO
ƒ /usr/share/man/man1/free.1.gz /usr/share/man/man1/pgrep.1.gz
ƒ /usr/share/man/man1/pkill.1.gz /usr/share/man/man1/pmap.1.gz
ƒ /usr/share/man/man1/ps.1.gz /usr/share/man/man1/skill.1.gz
ƒ /usr/share/man/man1/slabtop.1.gz /usr/share/man/man1/snice.1.gz
ƒ /usr/share/man/man1/tload.1.gz /usr/share/man/man1/top.1.gz
ƒ /usr/share/man/man1/uptime.1.gz /usr/share/man/man1/w.1.gz
ƒ /usr/share/man/man1/watch.1.gz /usr/share/man/man5/sysctl.conf.5.gz
ƒ /usr/share/man/man8/sysctl.8.gz /usr/share/man/man8/vmstat.8.gz
You may find a new RPM, but you do not know what it does. To find information
about it, use the following command:

o rpm -qip crontabs-1.10-7.noarch.rpm


The output would be similar to the following:
Name : crontabs Relocations: (not relocatable)
Version : 1.10 Vendor: Red
Hat, Inc. Release : 7 Build Date: Mon 20 Sep 2004

Pakistan Computer Bureau 99


05:58:10 PM EDT Install Date: (not installed) Build
Host: tweety.build.redhat.com Group : System
Environment/Base Source RPM: crontabs-1.10-7.src.rpm
Size : 1004 License: Public Domain Signature :
DSA/SHA1, Wed 05 Jan 2005 06:05:25 PM EST, Key ID
219180cddb42a60e Packager : Red Hat, Inc.
<http://bugzilla.redhat.com/bugzilla> Summary : Root
crontab files used to schedule the execution of
programs. Description : The crontabs package
contains root crontab files. Crontab is the program
used to install, uninstall, or list the tables used
to drive the cron daemon. The cron daemon checks the
crontab files to see when particular commands are
Scheduled to be executed. If commands are scheduled,
then it executes them.

ƒ Perhaps you now want to see what files the crontabs RPM installs. You
would enter the following:

o rpm -qlp crontabs-1.10-5.noarch.rpm

The output is similar to the following:


ƒ /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly
ƒ /etc/crontab /usr/bin/run-parts
These are just a few examples. As you use RPM, you may find more uses for it.

9.5. Additional Resources


RPM is an extremely complex utility with many options and methods for
querying, installing, upgrading, and removing packages. Refer to the following
resources to learn more about RPM.

9.5.1. Installed Documentation

ƒ rpm --help — This command displays a quick reference of RPM


parameters.
ƒ man rpm — The RPM man page gives more detail about RPM parameters
than the rpm--help command.

Pakistan Computer Bureau 100


9.5.2. Useful Websites
ƒ http://www.rpm.org/ — The RPM website.
ƒ http://www.redhat.com/mailman/listinfo/rpm-list/
— The RPM mailing list is archived here. To subscribe, send mail to
<rpm-list-request@redhat.com> with the word subscribe in the
subject line.

9.5.3. Related Books


ƒ Red Hat RPM Guide by Eric Foster-Johnson; Wiley, John & Sons,
Incorporated — This book is a comprehensive guide to RPM, from
installing packages to building RPMs.

Pakistan Computer Bureau 101


Samba is an open source implementation of the Server Message Block (SMB)
protocol. It allows the networking of Microsoft Windows®, Linux, UNIX,
and other operating systems together, enabling access to Windows-based file
and printer shares. Samba's use of SMB allows it to appear as a Windows
server to Windows clients.

10.1. Introduction to Samba


The third major release of Samba, version 3.0.0, introduced numerous
improvements from prior versions, including:

• The ability to join an Active Directory domain by means of LDAP and


Kerberos
• Built in Unicode support for internationalization
• Support for Microsoft Windows XP Professional client connections to
Samba servers without needing local registry hacking
• Two new documents developed by the Samba.org team, which include
a 400+ page reference manual, and a 300+ page implementation and
integration manual.

10.1.1. Samba Features


Samba is a powerful and versatile server application. Even seasoned system
administrators must know its abilities and limitations before attempting
installation and configuration.

What Samba can do:


• Serve directory trees and printers to Linux, UNIX, and Windows
clients
• Assist in network browsing (with or without NetBIOS)
• Authenticate Windows domain logins
• Provide Windows Internet Name Service (WINS) name server
resolution
• Act as a Windows NT®-style Primary Domain Controller (PDC)
• Act as a Backup Domain Controller (BDC) for a Samba-based PDC
• Act as an Active Directory domain member server
• Join a Windows NT/2000/2003 PDC

What Samba cannot do:


• Act as a BDC for a Windows PDC (and vice versa)
• Act as an Active Directory domain controller

Pakistan Computer Bureau 102


10.2. Samba Daemons and Related Services
10.2.1. Samba Daemons
Samba is comprised of three daemons (smbd, nmbd, and winbindd). Two
services (smb and windbind) control how the daemons are started, stopped,
and other service-related features. Each daemon is listed in detail, as well as
which specific service has control over it.

smbd
The smbd server daemon provides file sharing and printing services to
Windows clients. In addition, it is responsible for user authentication,
resource locking, and data sharing through the SMB protocol. The default
ports on which the server listens for SMB traffic are TCP ports 139 and 445.
The smbd daemon is controlled by the smb service. nmbd.

The nmbd server daemon understands and replies to NetBIOS name service
requests such as those produced by SMB/CIFS in Windows-based systems.
These systems include Windows 95/98/ME, Windows NT, Windows 2000,
Windows XP, and LanManager clients. It also participates in the browsing
protocols that make up the Windows Network Neighborhood view. The
default port that the server listens to for NMB traffic is UDP port 137. The
nmbddaemon is controlled by the smbservice.

winbindd
The winbind service resolves user and group information on a server running
Windows NT 2000 or Windows Server 2003. This makes Windows user /
group information understandable by UNIX platforms. This is achieved by
using Microsoft RPC calls, Pluggable Authentication Modules (PAM), and
the Name Service Switch (NSS). This allows Windows NT domain users to
appear and operate as UNIX users on a UNIX machine. Though bundled with
the Samba distribution, the winbind service is controlled separately from the
smbservice.
The winbindd daemon is controlled by the winbind service and does not
require the smb service to be started in order to operate. Winbindd is also used
when Samba is an Active Directory member, and may also be used on a
Samba domain controller (to implement nested groups and/or interdomain
trust). Because winbind is a client-side service used to connect to Windows
NT-based servers, further discussion of winbind is beyond the scope of this
manual.

Pakistan Computer Bureau 103


 

The Time and Date Properties Tool allows the user to change the system date and
time, to configure the time zone used by the system, and to setup the Network
Time Protocol (NTP) daemon to synchronize the system clock with a time server.
You must be running the X Window System and have root privileges to use the
tool. There are three ways to start the application:
• From the desktop, go to Applications (the main menu on the panel) =>
System Settings => Date & Time
• From the desktop, right-click on the time in the toolbar and select Adjust
Date and Time.
• Type the command system-config-date, system-config-time, or dateconfig at
a shell prompt (for example, in an XTerm or a GNOME terminal).

11.1. Time and Date Properties


As shown in Figure 11.1, “Time and Date Properties”, the first tabbed window
that appears is for configuring the system date and time.

Figure 11.1 Time and Date Properties

To change the date, use the arrows to the left and right of the month to change the
month, use the arrows to the left and right of the year to change the year, and
click on the day of the week to change the day of the week.

Pakistan Computer Bureau 104


 

To change the time, use the up and down arrow buttons beside the Hour, Minute
and Second in the Time section. Clicking the OK button applies any changes
made to the date and time, the NTP daemon settings, and the time zone settings. It
also exits the program.

11.2. Network Time Protocol (NTP) Properties


As shown in Figure 11.2, “NTP Properties”, the second tabbed window that
appears is for configuring NTP.

Figure 11.2 NTP Properties

The Network Time Protocol (NTP) daemon synchronizes the system clock with a
remote time server or time source. The application allows you to configure an
NTP daemon to synchronize your system clock with a remote server. To enable
this feature, select Enable Network Time Protocol. This enables the NTP Servers
list and other options. You can choose one of the predefined servers, edit a
predefined server by clicking the Edit or add a new server name by clicking Add.
Your system does not start synchronizing with the NTP server until you click OK.
After clicking OK, the configuration is saved and the NTP daemon is started (or
restarted if it is already running). Clicking the OK button applies any changes
made to the date and time, the NTP daemon settings, and the time zone settings. It

Pakistan Computer Bureau 105


 

Also exits the program.

11.3. Time Zone Configuration


As shown in Figure 11.3, “Timezone Properties”, the third tabbed window that
appears is for configuring the system time zone. To configure the system time
zone, click the Time Zone tab. The time zone can be changed by either using the
interactive map or by choosing the desired time zone from the list below the map.
To use the map, click on the desired region. The map zooms into the region
selected, after which you may choose the city specific to your time zone. A red X
appears and the time zone selection changes in the list below the map.

Alternatively, you can also use the list below the map. In the same way that the
map lets you choose a region before choosing a city, the list of time zones is now
a treelist, with cities and countries grouped within their specific continents. Non-
geographic time zones have also been added to address needs in the scientific
community. Click OK to apply the changes and exit the program.

Figure 11.3 Time zone Properties

If your system clock is set to use UTC, select the System clock uses UTC option.
UTC stands for the Universal Time, Coordinated, also known as Greenwich Mean
Time (GMT).

Pakistan Computer Bureau 106


While the heart of Red Hat Enterprise Linux is the kernel, for many users, the
face of the operating system is the graphical environment provided by the X
Window System, also called X. Other windowing environments have existed in
the UNIX world, including some that predate the release of the X Window
System in June 1984. Nonetheless, X has been the default graphical environment
for most UNIX-like operating systems, including Red Hat Enterprise Linux, for
many years.

The graphical environment for Red Hat Enterprise Linux is supplied by the
X.Org Foundation, an open source organization created to manage development
and strategy for the X Window System and related technologies. X.Org is a
large-scale, rapidly developing project with hundreds of developers around the
world. It features a wide degree of support for a variety of hardware devices and
architectures, and can run on a variety of different operating systems and
platforms. This release for Red Hat Enterprise Linux specifically includes the
X11R7.1 release of the X Window System. The X Window System uses a
client-server architecture. The X server (the Xorg binary) listens for connections
from X client applications via a network or local loopback interface. The server
communicates with the hardware, such as the video card, monitor, keyboard, and
mouse. X client applications exist in the user-space, creating a graphical user
interface (GUI) for the user and passing user requests to the X server.

12.1. The X11R7.1 Release


Red Hat Enterprise Linux 5.0.0 now uses the X11R7.1 release as the base X
Window System, which includes several video driver, EXA, and platform
support enhancements over the previous release, among others. In addition, this
release also includes several automatic configuration features for the X server.
X11R7.1 is the first release to take specific advantage of the modularisation of
the X Window System. This modularisaton, which splits X into logically
distinct modules, makes it easier for open source developers to contribute code
to the system.

Important

Red Hat Enterprise Linux no longer provides the XFree86™ server packages. Before
upgrading a system to the latest version of Red Hat Enterprise Linux, be sure that the
system's video card is compatible with the X11R7.1 release by checking the Red Hat
Hardware Compatibility List located online at http://hardware.redhat.com/.

In the X11R7.1 release, all libraries, headers, and binaries now live under /usr/

Pakistan Computer Bureau 107


instead of /usr/X11R6. The /etc/X11/ directory contains configuration files for X
client and server applications. This includes configuration files for the X server
itself, the xfs font server, the X display managers, and many other base
components. The configuration file for the newer Fontconfig-based font
architecture is still /etc/fonts/fonts.conf. For more on configuring and adding
fonts, refer to Section 4, “Fonts”.

Because the X server performs advanced tasks on a wide array of hardware, it


requires detailed information about the hardware it works on. The X server
automatically detects some of this information; other details must be configured.
The installation program installs and configures X automatically, unless the
X11R7.1 release packages are not selected for installation. However, if there are
any changes to the monitor, video card or other devices managed by the X
server, X must be reconfigured. The best way to do this is to use the X
Configuration Tool (system-config-display), particularly for devices that are
not detected manually.

In Red Hat Enterprise Linux's default graphical environment, the X


Configuration Tool is available at System (on the panel) => Administration
=> Display. Changes made with the X Configuration Tool take effect after
logging out and logging back in. For more information about X Configuration
Tool, refer to X Window System Configuration. In some situations,
reconfiguring the X server may require manually editing its configuration file,
/etc/X11/xorg.conf. For information about the structure of this file, refer to
Section 3, “X Server Configuration Files”.

12.2. Desktop Environments and Window Managers


Once an X server is running, X client applications can connect to it and create a
GUI for the user. A range of GUIs are possible with Red Hat Enterprise Linux,
from the rudimentary Tab Window Manager to the highly developed and
interactive GNOME desktop environment that most Red Hat Enterprise Linux
users are familiar with. To create the latter, more comprehensive GUI, two main
classes of X client application must connect to the X server: a desktop
environment and a window manager.

12.2.1. Desktop Environments


A desktop environment integrates various X clients to create a common
graphical user environment and development platform. Desktop environments

Pakistan Computer Bureau 108


have advanced features allowing X clients and other running processes to
communicate with one another, while also allowing all applications written to
work in that environment to perform advanced tasks, such as drag and drop
operations. Red Hat Enterprise Linux provides two desktop environments:

• GNOME
• The default desktop environment for Red Hat Enterprise Linux based on
the GTK+ 2 graphical toolkit.

• KDE
• An alternative desktop environment based on the Qt 3 graphical toolkit.
Both GNOME and KDE have advanced productivity applications, such as word
processors, spreadsheets, and Web browsers; both also provide tools to
customize the look and feel of the GUI. Additionally, if both the GTK+ 2 and
the Qt libraries are present, KDE applications can run in GNOME and vice-
versa.

12.2.2. Window Managers


Window managers are X client programs which are either part of a desktop
environment or, in some cases, stand-alone. Their primary purpose is to control
the way graphical windows are positioned, resized, or moved. Window
managers also control title bars, window focus behavior, and user-specified key
and mouse button bindings. Four window managers are included with Red Hat
Enterprise Linux:

kwin
The KWin window manager is the default window manager for KDE. It is an
efficient window manager which supports custom themes.
metacity
The Metacity window manager is the default window manager for GNOME.
It is a simple and efficient window manager which also supports custom

themes. To run this window manager, you need to install the metacity
package.

Pakistan Computer Bureau 109


Mwm
The Motif Window Manager (mwm) is a basic, stand-alone window
manager. Since it is designed to be a stand-alone window manager, it should
not be used in conjunction with GNOME or KDE. To run this window
manager, you need to install the open motif package.

Twm

The minimalist Tab Window Manager (twm, which provides the most basic
tool set of any of the window managers, can be used either as a stand-alone
or with a desktop environment. It is installed as part of the X11R7.1 release.
To run any of the aforementioned window managers, you will first need to
boot into Runlevel 3. For instructions on how to do this, refer to Section
2.2.1, “Run levels”.

Once you are logged in to Run level 3, you will be presented with a terminal
prompt, not a graphical environment. To start a window manager, type xinit –e
<path-to-window-manager> at the prompt. <path-to-window-manager> is the
location of the window manager binary file. The binary file can be located by
typing which window-manager-name, where window-manager-name is the name
of the window manager you want to run.

For example:
user@host# which twm/usr/bin/twm
user@host# xinit -e /usr/bin/twm

The first command above returns the absolute path to the twm window manager,
the second command starts twm. To exit a window manager, close the last
window or press Ctrl-Alt-Backspace. Once you have exited the window
manager, you can log back into Runlevel 5 by typing startx at the prompt.

12.2.2.1. Runlevels
Before you can configure access to services, you must understand Linux
runlevels. A runlevel is a state, or mode, that is defined by the services listed in
the directory /etc/rc.d/rc<x>.d, where <x> is the number of the runlevels. The
following runlevels exist:

Pakistan Computer Bureau 110


• 0 — Halt
• 1 — Single-user mode
• 2 — Not used (user-definable)
• 3 — Full multi-user mode
• 4 — Not used (user-definable)
• 5 — Full multi-user mode (with an X-based login screen)
• 6 — Reboot

If you use a text login screen, you are operating in runlevel 3. If you use a
graphical login screen, you are operating in runlevel 5. The default runlevel can
be changed by modifying the /etc/inittab file, which contains a line near the top
of the file similar to the following:
• id:5:initdefault:

Change the number in this line to the desired runlevel. The change does not take
effect until you reboot the system.

12.3. X Server Configuration Files


The X server is a single binary executable (/usr/bin/Xorg). Associated
configuration files are stored in the /etc/X11/ directory (as is a symbolic link — X
— which points to /usr/bin/Xorg). The configuration file for the X server is
/etc/X11/xorg.conf.

The directory /usr/lib/xorg/modules/ contains X server modules that can be


loaded dynamically at runtime. By default, only some modules in
/usr/lib/xorg/modules/ are automatically loaded by the X server. To load optional
modules, they must be specified in the X server configuration file,
/etc/X11/xorg.conf. For more information about loading modules, refer to
Section 3.1.5, “Module”. When Red Hat Enterprise Linux 5.0.0 is installed, the
configuration files for X are created using information gathered about the system
hardware during the installation process.

12.3.1. xorg.conf
While there is rarely a need to manually edit the /etc/X11/xorg.conf file, it is
useful to understand the various sections and optional parameters available,
especially when troubleshooting.

Pakistan Computer Bureau 111


12.3.1.1. The Structure
The /etc/X11/xorg.conf file is comprised of many different sections which
address specific aspects of the system hardware. Each section begins with a
Section "<section-name>" line (where <section-name> is the title for the
section) and ends with an End Section line. Each section contains lines that
include option names and one or more option values. These are sometimes
enclosed in double quotes ("). Lines beginning with a hash mark (#) are not
read by the X server and are used for human-readable comments.

Some options within the /etc/X11/xorg.conf file accept a Boolean switch which
turns the feature on or off. Acceptable Boolean values are:

• 1, on, true, or yes — Turns the option on.


• 0, off, false, or no — Turns the option off.

The following are some of the more important sections in the order in which
they appear in a typical /etc/X11/xorg.conf file. More detailed information about
the X server configuration file can be found in the xorg.conf man page.

12.3.1.2. Server Flags


The optional Server Flags section contains miscellaneous global X server
settings. Any settings in this section may be overridden by options placed in the
Server Layout section (refer to Section 3.1.3, “Server Layout” for details). Each
entry within the Server Flags section is on its own line and begins with the term
Option followed by an option enclosed in double quotation marks ("). The
following is a sample Server Flags section:
• Section "Server Flags" Option "DontZap" "true" End Section
The following lists some of the most useful options:

• "DontZap" "<boolean>" — When the value of <boolean> is set to true,

this setting prevents the use of the Ctrl-Alt-Backspace key combination to


immediately terminate the X server.
• "DontZoom" "<boolean>" — When the value of <boolean> is set to true,
this setting prevents cycling through configured video resolutions using the
Ctrl-Alt-Keypad-Plus and Ctrl-Alt-Keypad-Minus key combinations.

Pakistan Computer Bureau 112


12.3.1.3. Server Layout
The Server Layout section binds together the input and output devices controlled
by the X server. At a minimum, this section must specify one output device and
one input device. By default, a monitor (output device) and keyboard (input
device) are specified. The following example illustrates a typical Server Layout
section:

Section "ServerLayout" Identifier "Default Layout" Screen 0 "Screen0" 0 0


InputDevice "Mouse0" "CorePointer" InputDevice "Keyboard0"
"CoreKeyboard" EndSection

The following entries are commonly used in the Server Layout section:

Identifier
Specifies a unique name for this Server Layout section.

Screen
Specifies the name of a Screen section to be used with the X server. More than
one Screen option may be present. The following is an example of a typical
Screen entry:

Screen 0 "Screen0" 0 0

The first number in this example Screen entry (0) indicates that the first monitor
connector or head on the video card uses the configuration specified in the
Screen section with the identifier "Screen0". An example of a Screen section with
the identifier "Screen0" can be found in Section 3.1.9, “Screen”.
• If the video card has more than one head, another Screen entry with a
different number and a different Screen section identifier is necessary .

• The numbers to the right of "Screen0" give the absolute X and Y


coordinates for the upper-left corner of the screen (0 0 by default).

• InputDevice
Specifies the name of an Input Device section to be used with the X server. It
is advisable that there be at least two InputDevice entries: one for the default
mouse and one for the default keyboard. The options CorePointer and
CoreKeyboard indicate that these are the primary mouse and keyboard.

Pakistan Computer Bureau 113


• Option "<option-name>"
An optional entry which specifies extra parameters for the section. Any
options listed here override those listed in the ServerFlags section. Replace
<option-name> with a valid option listed for this section in the xorg.conf main
page.

It is possible to put more than one ServerLayout section in the


/etc/X11/xorg.conf file. By default, the server only reads the first one it
encounters, however. If there is an alternative ServerLayout section, it can be
specified as a command line argument when starting an X session.

12.3.1.4. Files
The Files section sets paths for services vital to the X server, such as the font
path. This is an optional section, these paths are normally detected
automatically. This section may be used to override any automatically detected
defaults. The following example illustrates a typical Files section:

Section "Files" RgbPath "/usr/share/X11/rgb.txt" FontPath "unix/:7100"


EndSection

The following entries are commonly used in the Files section:

• RgbPath
Specifies the location of the RGB color database. This database defines all valid
color names in X and ties them to specific RGB values.

• FontPath
Specifies where the X server must connect to obtain fonts from the xfs font
server. By default, the FontPath is unix/:7100. This tells the X server to obtain
font information using UNIX-domain sockets for inter-process communication
• (IPC) on port 7100.

• ModulePath
An optional parameter which specifies alternate directories which store X
server modules.

Pakistan Computer Bureau 114


12.3.1.5. Module
By default, the X server automatically loads the following modules from the
/usr/lib/xorg/modules/ directory:

• extmod
• dbe
• glx
• freetype
• type1
• record
• dri

The default directory for loading these modules can be changed by specifying a
different directory with the optional ModulePath parameter in the Files section.
Refer to Section 3.1.4, “Files” for more information on this section. Adding a
Module section to /etc/X11/xorg.conf instructs the X server to load the modules
listed in this section instead of the default modules.For example, the following
typical Module section:

Section "Module" Load "fbdevhw" EndSection

Instructs the X server to load the fbdevhw instead of the default modules. As
such, if you add a Module section to /etc/X11/xorg.conf, you will need to specify
any default modules you want to load as well as any extra modules.

12.3.1.6. Input Device


Each InputDevice section configures one input device for the X server. Systems
typically have at least one InputDevice section for the keyboard. It is perfectly
normal to have no entry for a mouse, as most mouse settings are automatically
detected. The following example illustrates a typical InputDevice section for a
keyboard:

Section "InputDevice" Identifier "Keyboard0" Driver "kbd" Option "XkbModel"


"pc105" Option "XkbLayout" "us" EndSection

The following entries are commonly used in the InputDevice section:

• Identifier
Specifies a unique name for this InputDevice section. This is a required entry.

• Driver
Pakistan Computer Bureau 115
Specifies the name of the device driver X must load for the device.

• Option
Specifies necessary options pertaining to the device.

A mouse may also be specified to override any autodetected defaults for the
device. The following options are typically included when adding a mouse in
the xorg.conf:

• Protocol
Specifies the protocol used by the mouse, such as IMPS/2.

• Device
Specifies the location of the physical device.

• Emulate3Buttons
Specifies whether to allow a two-button mouse to act like a three-button
mouse when both mouse buttons are pressed simultaneously.

12.3.1.7. Monitor
Each Monitor section configures one type of monitor used by the system. This is
an optional entry as well, as most monitors are now automatically detected. The
easiest way to configure a monitor is to configure X during the installation
process or by using the X Configuration Tool. For more information about
using the X Configuration Tool, refer to X Window System Configuration. This
example illustrates a typical Monitor section for a monitor:

Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor"


ModelName "DDC Probed Monitor - ViewSonic G773-2" DisplaySize 320
240
HorizSync 30.0 - 70.0 VertRefresh 50.0 - 180.0 EndSection

Warning

Be careful when manually editing values in the Monitor section of /etc/X11/xorg.conf.


Inappropriate values can damage or destroy a monitor. Consult the monitor's
documentation for a listing of safe operating parameters.

The following are commonly entries used in the Monitor section:

• Identifier
Specifies a unique name for this Monitor section. This is a required entry.

Pakistan Computer Bureau 116


• VendorName
An optional parameter which specifies the vendor of the monitor.

• ModelName
An optional parameter which specifies the monitor's model name.

• DisplaySize
An optional parameter which specifies, in millimeters, the physical size of the
monitor's picture area.

• HorizSync
Specifies the range of horizontal sync frequencies compatible with the
monitor in kHz. These values help the X server determine the validity of
built-in or specified Modeline entries for the monitor.

• VertRefresh
Specifies the range of vertical refresh frequencies supported by the monitor,
in kHz. These values help the X server determine the validity of built in or
specified Modeline entries for the monitor.

• Modeline
An optional parameter which specifies additional video modes for the monitor
at particular resolutions, with certain horizontal sync and vertical refresh
resolutions. Refer to the xorg.conf man page for a more detailed explanation
of Modeline entries.

• Option "<option-name>"
An optional entry which specifies extra parameters for the section. Replace
<option-name> with a valid option listed for this section in the xorg.conf man
page.

12.3.1.8. Device
Each Device section configures one video card on the system. While one Device
section is the minimum, additional instances may occur for each video card
installed on the machine. The best way to configure a video card is to configure

X during the installation process or by using the X Configuration Tool. For


more about using the X Configuration Tool, refer to X Window System
Configuration. The following example illustrates a typical Device section for a

Pakistan Computer Bureau 117


video card:

Section "Device" Identifier "Videocard0" Driver "mga" VendorName


"Videocard vendor" BoardName "Matrox Millennium G200" VideoRam
8192 Option "dpms" EndSection

The following entries are commonly used in the Device section:

• Identifier
Specifies a unique name for this Device section. This is a required entry.

• Driver
Specifies which driver the X server must load to utilize the video card. A list
of drivers can be found in /usr/share/hwdata/videodrivers, which is installed
with the hwdata package.

• Vendor Name
An optional parameter which specifies the vendor of the video card.

• BoardName
An optional parameter which specifies the name of the video card.

• VideoRam
An optional parameter which specifies the amount of RAM available on
the video card in kilobytes. This setting is only necessary for video cards
the X server cannot probe to detect the amount of video RAM.

• BusID
An entry which specifies the bus location of the video card. On systems with
only one video card a BusID entry is optional and may not even be present in
the default /etc/X11/xorg.conf file. On systems with more than one video
Card, however, a BusID entry must be present.

• Screen
An optional entry which specifies which monitor connector or head on the
video card the Device section configures. This option is only useful for video
cards with multiple heads. If multiple monitors are connected to different
heads on the same video card, separate Device sections must exist and each of
these sections must have a different Screen value. Values for the Screen entry
must be an integer. The first head on the video card has a value of 0. The
Pakistan Computer Bureau 118
value for each additional head increments this value by one.

• Option "<option-name>"
An optional entry which specifies extra parameters for the section. Replace
<option-name> with a valid option listed for this section in the xorg.conf man
page. One of the more common options is "dpms" (for Display Power
Management Signaling, a VESA standard), which activates the Service Star
energy compliance setting for the monitor.

12.3.1.9. Screen
Each Screen section binds one video card (or video card head) to one monitor by
referencing the Device section and the Monitor section for each. While one Screen
section is the minimum, additional instances may occur for each video card and
monitor combination present on the machine. The following example illustrates a
typical Screen section:
Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0"
DefaultDepth 16 SubSection "Display" Depth 24 Modes "1280x1024"
"1280x960" "1152x864" "1024x768" "800x600" "640x480" EndSubSection
SubSection "Display" Depth 16 Modes "1152x864" "1024x768" "800x600"
"640x480" EndSubSection EndSection

The following entries are commonly used in the Screen section:

• Identifier
Specifies a unique name for this Screen section. This is a required entry.

• Device
Specifies the unique name of a Device section. This is a required entry.

• Monitor
Specifies the unique name of a Monitor section. This is only required if a
specific Monitor section is defined in the xorg.conf file. Normally, monitors
are automatically detected.
• Default Depth
Specifies the default color depth in bits. In the previous example, 16 (which

provides thousands of colors) is the default. Only one DefaultDepth is


permitted, although this can be overridden with the Xorg command line option

Pakistan Computer Bureau 119


-depth <n>,where <n> is any additional depth specified.

• Subsection "Display"
Specifies the screen modes available at a particular color depth. The Screen
section can have multiple Display subsections, which are entirely optional
since screen modes are automatically detected.
This subsection is normally used to override autodetected modes.

• Option "<option-name>"
An optional entry which specifies extra parameters for the section. Replace
<option-name> with a valid option listed for this section in the xorg.conf
man page.

12.3.1.10. DRI
The optional DRI section specifies parameters for the Direct Rendering
Infrastructure (DRI). DRI is an interface which allows 3D software applications
to take advantage of 3D hardware acceleration capabilities built into most
modern video hardware. In addition, DRI can improve 2D performance via
hardware acceleration, if supported by the video card driver. This section rarely
appears, as the DRI Group and Mode are automatically initialized to default
values. If a different Group or Mode is desired, then adding this section to the
xorg.conf file will override those defaults. The following example illustrates a
typical DRI section:
• Section "DRI" Group 0 Mode 0666 EndSection
Since different video cards use DRI in different ways, do not add to this
section without first referring to http://dri.sourceforge.net/.

12.4. Fonts
Red Hat Enterprise Linux uses two subsystems to manage and display fonts
under X:
• Fontconfig and xfs.

The newer Fontconfig font subsystem simplifies font management and provides
advanced display features, such as anti-aliasing. This system is used
automatically for applications programmed using the Qt 3 or GTK+ 2 graphical
toolkit. For compatibility, Red Hat Enterprise Linux includes the original font
subsystem, called the core X font subsystem. This system, which is over 15

Pakistan Computer Bureau 120


years old, is based around the X Font Server (xfs). This section discusses how to
configure fonts for X using both systems.

12.4.1. Fontconfig
The Fontconfig font subsystem allows applications to directly access fonts on
the system and use Xft or other rendering mechanisms to render Fontconfig
fonts with advanced anti-aliasing. Graphical applications can use the Xft library
with Fontconfig to draw text to the screen. Over time, the Fontconfig/Xft font
subsystem replaces the core X font subsystem.

Important

The Fontconfig font subsystem does not yet work for OpenOffice.org, which uses its
own font rendering technology.

It is important to note that Fontconfig uses the etc/fonts/fonts.conf configuration


file, which should not be edited by hand.

Tip

Due to the transition to the new font system, GTK+ 1.2 applications are not affected by
any changes made via the Font Preferences dialog (accessed by selecting System (on the
panel) => Preferences => Fonts). For these applications, a font can be configured by
adding the following lines to the file .gtkrc.mine:

style "user-font" { fontset = "<font-specification>" } widget_class "*"


style "user-font"

Replace <font-specification> with a font specification in the style used by


traditional X applications, such as -adobe-helvetica-medium-r-normal--*-120-*-
*-*-*-*-*. A full list of core fonts can be obtained by running xlsfonts or created
interactively using the xfontsel command.

12.4.1.1. Adding Fonts to Fontconfig


Adding new fonts to the Fontconfig subsystem is a straightforward process.

1. To add fonts system-wide, copy the new fonts into the /usr/share/fonts/
directory. It is a good idea to create a new subdirectory, such as local/ or
similar, to help distinguish between user-installed and default fonts.

Pakistan Computer Bureau 121


2. To add fonts for an individual user, copy the new fonts into the .fonts/
directory in the user's home directory.
3. Use the fc-cache command to update the font information cache, as in the
following example: fc-cache <path-to-font-directory>

In this command, replace <path-to-font-directory> with the directory containing


the new fonts (either /usr/share/fonts/local/ or /home/<user>/.fonts/).

Tip

Individual users may also install fonts graphically, by typing fonts:/// into theNautilus
address bar, and dragging the new font files there.

Important

If the font file name ends with a .gz extension, it is compressed and cannot be used until
uncompressed. To do this, use the gunzip command or double-click the file and drag the
font to a directory in Nautilus.

12.4.2. Core X Font System


For compatibility, Red Hat Enterprise Linux provides the core X font subsystem,
which uses the X Font Server (xfs) to provide fonts to X client applications. The
X server looks for a font server specified in the FontPath directive within the
Files section of the /etc/X11/xorg.conf configuration file. Refer to Section 3.1.4,
“Files” for more information about the FontPath entry. The X server connects to
the xfs server on a specified port to acquire font information. For this reason, the
xfs service must be running for X to start.

12.4.2.1. xfs Configuration


The /etc/rc.d/init.d/xfs script starts the xfs server. Several options can be
configured within its configuration file, /etc/X11/fs/config. The following lists
common options:

• Alternate-servers
Specifies a list of alternate font servers to be used if this font server is not
available. A comma must separate each font server in a list.

• Catalogue
Specifies an ordered list of font paths to use. A comma must separate each font
path in a list. Use the string :unscaled immediately after the font path to make
the unscaled fonts in that path load first. Then specify the entire path again, so
Pakistan Computer Bureau 122
that other scaled fonts are also loaded.

• Client-limit
Specifies the maximum number of clients the font server services. The default
is 10.

• Clone-self
Allows the font server to clone a new version of itself when the client-limit is
hit. By default, this option is on.

• Default-point-size
Specifies the default point size for any font that does not specify this value.
The value for this option is set in decipoints. The default of 120 corresponds to
a 12 point font.

• Default-resolutions
Specifies a list of resolutions supported by the X server. Each resolution in the
list must be separated by a comma.

• defer glyphs
Specifies whether to defer loading glyphs (the graphic used to visually
represent a font). To disable this feature use none, to enable this feature for all
fonts use all, or to turn this feature on only for 16-bit fonts use 16.

• Error-file
Specifies the path and file name of a location where xfs errors are logged.

• No-listen
Prevents xfs from listening to particular protocols. By default, this option is set
to tcp to prevent xfs from listening on TCP ports for security reasons.

Tip

If xfs is used to serve fonts over the network, remove this line.

• Port
Specifies the TCP port that xfs listens on if no-isten does not exist or is
commented out.

• Use-syslog
Specifies whether to use the system error log.
Pakistan Computer Bureau 123
12.4.2.2. Adding Fonts to xfs
To add fonts to the core X font subsystem (xfs), follow these steps:

1. If it does not already exist, create a directory called /usr/share/fonts/local/


using the following command as root:
mkdir /usr/share/fonts/local/

If creating the /usr/share/fonts/local/ directory is necessary, it must be added to


the xfs path using the following command as root:

chkfontpath --add /usr/share/fonts/local/

2. Copy the new font file into the /usr/share/fonts/local/ directory


3. Update the font information by issuing the following command as root:
ttmkfdir -d /usr/share/fonts/local/ -o
/usr/share/fonts/local/fonts.scale

4. Reload the xfs font server configuration file by issuing the following
command as root:
service xfs reload

12.5. Run levels and X


In most cases, the Red Hat Enterprise Linux installer configures a machine to
boot into a graphical login environment, known as Runlevel 5. It is possible,
however, to boot into a text-only multi-user mode called Runlevel 3 and begin an
X session from there. For more information about runlevels, refer to Section
2.2.1, “Runlevels”. The following subsections review how X starts up in both
runlevel 3 and runlevel

12.5.1. Run level 3


When in run level 3, the best way to start an X session is to log in and type
startx. The startx command is a front-end to the xinit command, which launches
the X server (Xorg) and connects X client applications to it. Because the user is
already logged into the system at run level 3, startx does not launch a display
manager or authenticate users. Refer to Section 5.2, “Runlevel 5” for more
information about display managers. When the startx command is executed, it
searches for the .xinitrc file in the user's home directory to define the desktop

Pakistan Computer Bureau 124


environment and possibly other X client applications to run. If no .xinitrc file is
present, it uses the system default /etc/X11/xinit/xinitrc file instead.

The default xinitrc script then searches for user-defined files and default system
files, including .Xresources, .Xmodmap, and .Xkbmap in the user's home
directory, and Xresources, Xmodmap, and Xkbmap in the /etc/X11/ directory.
The Xmodmap and Xkbmap files, if they exist, are used by the xmodmap utility to
configure the keyboard. The Xresources file is read to assign specific preference
values to applications.
After setting these options, the xinitrc script executes all scripts located in the
/etc/X11/xinit/xinitrc.d/ directory. One important script in this directory is
xinput.sh, which configures settings such as the default language. Next, the
xinitrc script attempts to execute .Xclients in the user's home directory and
turns to /etc/X11/xinit/Xclients if it cannot be found. The purpose of the
Xclients file is to start the desktop environment or, possibly, just a basic
window manager. The .Xclients script in the user's home directory starts the
user-specified desktop environment in the .Xclients-default file. If .Xclients
does not exist in the user's home directory, the standard /etc/X11/xinit/Xclients
script attempts to start another desktop environment, trying GNOME first and
then KDE followed by twm. When in run level 3, the user is returned to a text
mode user session after ending an X session.

12.5.2. Run level 5


When the system boots into run level 5, a special X client application called a
display manager is launched. A user must authenticate using the display manager
before any desktop environment or window managers are launched.

Depending on the desktop environments installed on the system, three different


display managers are available to handle user authentication.

• GNOME
The default display manager for Red Hat Enterprise Linux, GNOME allows the
user to configure language settings, shutdown, restart or log in to the system.

• KDE
KDE's display manager which allows the user to shutdown, restart or log
in to the system.

• xdm
Pakistan Computer Bureau 125
A very basic display manager which only lets the user log in to the system.

When booting into runlevel 5, the prefdm script determines the preferred display
manager by referencing the /etc/sysconfig/desktop file. A list of options for this file
is available in this file:
/usr/share/doc/initscripts-<version-number>/sysconfig.txt
where <version-number> is the version number of the initscripts package. Each
of the display managers reference the /etc/X11/xdm/Xsetup_0 file to set up the
login screen. Once the user logs into the system, the /etc/X11/xdm/GiveConsole
script runs to assign ownership of the console to the user. Then, the
/etc/X11/xdm/Xsession script runs to accomplish many of the tasks normally
performed by the xinitrc script when starting X from runlevel 3, including setting
system and user resources, as well as running the scripts in the
/etc/X11/xinit/xinitrc.d/ directory.

Users can specify which desktop environment they want to utilize when they
authenticate using the GNOME or KDE display managers by selecting it from the

Sessions menu item (accessed by selecting System (on the panel) => Preferences
=> More Preferences => Sessions). If the desktop environment is not specified
in the display manager, the /etc/X11/xdm/Xsession script checks the .xsession and
.Xclients files in the user's home directory to decide which desktop environment
to load. As a last resort, the /etc/X11/xinit/Xclients file is used to select a desktop
environment or window manager to use in the same way as runlevel 3.

When the user finishes an X session on the default display (:0) and logs out, the
/etc/X11/xdm/TakeConsole script runs and reassigns ownership of the
console to the root user. The original display manager, which continues
running after the user logged in, takes control by spawning a new display
manager. This restarts the X server, displays a new login window, and starts
the entire process over again. The user is returned to the display manager
after logging out of X from runlevels 5.

Pakistan Computer Bureau 126


During installation, the system's monitor, video card, and display settings are
configured. To change any of these settings after installation, use the X
Configuration Tool.

To start the X Configuration Tool, go to System (on the panel) =>


Administration => Display, or type the command system-config-
display at a shell prompt (for example, in an XTerm or GNOME terminal). If
the X Window System is not running, a small version of X is started to run the
program. After changing any of the settings, log out of the graphical desktop and
log back in to enable the changes.

13.1. Display Settings


The Settings tab allows users to change the resolution and color
depth. The display of a monitor consists of tiny dots called pixels. The
number of pixels displayed at one time is called the resolution. For example, the
resolution 1024x768 means that 1024 horizontal pixels and 768 vertical pixels are
used. The higher the resolution values, the more images the monitor can display at
one time. The color depth of the display determines how many possible colors are
displayed. A higher color depth means more contrast between colors.

Figure 13.1 Display Settings

13.2. Display Hardware Settings


When the X Configuration Tool is started, it probes the monitor and video
card. If the hardware is probed properly, the information for it is shown on the
Pakistan Computer Bureau 127
Hardware tab.

Figure 13.2. Display Hardware Settings

To change the monitor type or any of its settings, click the corresponding
Configure button. To change the video card type or any of its settings, click the
Configure button beside its settings.

13.3. Dual Head Display Settings


If multiple video cards are installed on the system, dual head monitor support is
available and is configured via the Dual head tab.

Pakistan Computer Bureau 128


Figure 13.3 Dual Head Display Settings

• To enable use of Dual head, check the Use dual head checkbox.
• To configure the second monitor type, click the corresponding
Configure button. You can also configure the other Dual head
settings by using the corresponding drop-down list.

For the Desktop layout option, selecting Spanning Desktops


allows both monitors to use an enlarged usable workspace. Selecting
Individual Desktops shares the mouse and keyboard among the
displays, but restricts windows to a single display.

Pakistan Computer Bureau 129


The control of users and groups is a core element of Red Hat Enterprise Linux
system administration. Users can be either people (meaning accounts tied to
physical users) or accounts which exist for specific applications to use. Groups
are logical expressions of organization, tying users together for a common
purpose. Users within a group can read, write, or execute files owned by that
group. Each user and group has a unique numerical identification number
called a userid (UID) and a groupid (GID), respectively. A user who creates a
file is also the owner and group owner of that file. The file is assigned separate
read, write, and execute permissions for the owner, the group, and everyone
else. The file owner can be changed only by the root user, and access
permissions can be changed by both the root user and file owner. Red Hat
Enterprise Linux also supports access control lists (ACLs) for files and
directories which allow permissions for specific users outside of the owner to
be set.

14.1. User and Group Configuration


The User Manager allows you to view, modify, add, and delete local users and
groups. To use the User Manager, you must be running the X Window System,
have root privileges and have the system-config-users RPM package installed.
To start the User Manager from the desktop, go to System (on the panel) =>
Administration => Users & Groups. You can also type the command system-
config-users at a shell prompt (for example, in an XT ermora Gnome terminal).

Figure 14.1. User Manager

Pakistan Computer Bureau 130


To view a list of local users on the system, click the Users tab. To view a list
of local groups on the system, click the Groups tab. To find a specific user or
group, type the first few letters of the name in the Search filter field. Press
Enter or click the Apply filter button. The filtered list is displayed. To sort the
users or groups, click on the column name. To view a list of local users on the
system, click the Users tab. To view a list of local groups on the system, click
the Groups tab. To find a specific user or group, type the first few letters of
the name in the Search filter field. Press Enter or click the Apply filter button.
The filtered list is displayed. To sort the click on the column name, the users
or groups are sorted according to the value of that column. Red Hat Enterprise
Linux reserves user IDs below 500 for system users. By default, User
Manager does not display system users. To view all users, including the
system users, go to Edit => Preferences and uncheck Hide system users and
groups from the dialog box.

14.1.1. Adding a New User


To add a new user, click the Add User button. A window as shown in
Figure 14.2, “New User” appears. Type the username and full name for the
new user in the appropriate fields. Type the user's password in the Password
and Confirm Password fields. The password must be at least six characters.

Tip

It is advisable to use a much longer password, as this makes it more difficult for an
intruder to guess it and access the account without permission. It is also
recommended that the password not be based on a dictionary term; use a
combination of letters, numbers and special characters.

Select a login shell. If you are not sure which shell to select, accept the default
value of /bin/bash. The default home directory is /home/<username>/. You
can change the home directory that is created for the user, or you can choose
not to create the home directory by unselecting Create home directory. If you
select to create the home directory, default configuration files are copied from
the /etc/skel/ directory into the new home directory. Red Hat Enterprise Linux
uses a user private group (UPG) scheme. The UPG scheme does not add or
change anything in the standard UNIX way of handling groups; it offers a new
convention. Whenever you

Pakistan Computer Bureau 131


Create a new user, by default, a unique group with the same name as the user
is created. If you do not want to create this group, unselect Create a private
group for the user. To specify a user ID for the user, select Specify user ID
manually. If the option is not selected, the next available user ID above 500 is
assigned to the new user. Because Red Hat Enterprise Linux reserves user IDs
below 500 for system users, it is not advisable to manually assign user IDs 1-
499. Click OK to create the user.

To configure more advanced user properties, such as password expiration,


modify the user's properties after adding the user.

Pakistan Computer Bureau 132


14.1.2. Modifying User Properties
To view the properties of an existing user, click on the Users tab, select the
user from the user list, and click Properties from the menu (or choose File =>
Properties from the pull down menu).

Figure 14.3. User Properties

The User Properties window is divided into multiple tabbed pages:

• User Data — shows the basic user information configured when you added
the user. Use this tab to change the user's full name, password, home
directory, or login shell.
• Account Info — Select Enable account expiration if you want the account
to expire on a certain date. Enter the date in the provided fields. Select
Local password is locked to lock the user account and prevent the user
from logging into the system.
• Password Info — displays the date that the user's password last changed. To
force the user to change passwords after a certain number of days, select
Enable password expiration and enter a desired value in the Days before
change required: field. The number of days before the user's password expires,

Pakistan Computer Bureau 133


the number of days before the user is warned to change passwords, and days
before the account becomes inactive can also be changed.
• Groups — Allows you to view and configure the Primary Group of the user.
As well as other groups that you want the user to be a member of it.

14.1.3. Adding a New Group


To add a new user group, click the Add Group button. Type the name of the
new group to create. To specify a group ID for the new group, select Specify
group ID manually and select the GID. Note that Red Hat Enterprise Linux
also reserves group IDs lower than 500 for system groups.

Figure 14.4 New Group

Click OK to create the group. The new group appears in the group list.

14.1.4. Modifying Group Properties


To view the properties of an existing group, select the group from the group
list and click Properties from the menu (or choose File => Properties from the
pull down menu.

Figure 14.5 Group Properties

Pakistan Computer Bureau 134


The Group Users tab displays which users are members of the group. Use this
tab to add or remove users from the group. Click OK to save your changes.

14.2. User and Group Management Tools


Managing users and groups can be a tedious task; this is why Red Hat
Enterprise Linux provides tools and conventions to make them easier to
manage. The easiest way to manage users and groups is through the graphical
application, User Manager (system-config-users). For more information on
User Manager. The following command line tools can also be used to manage
users and groups:

• useradd, usermod, and userdel — Industry-standard methods of adding,


deleting and modifying user accounts
• groupadd, groupmod, and groupdel — Industry-standard methods of
adding, deleting, and modifying user groups
• gpasswd — Industry-standard method of administering the /etc/groupfile
• pwck, grpck — Tools used for the verification of the password, group, and
associated shadow files
• pwconv, pwunconv — Tools used for the conversion of passwords to
shadow passwords and back to standard passwords

14.2.1. Command Line Configuration


If you prefer command line tools or do not have the X Window System
installed, use this section to configure users and groups.

14.2.2. Adding a User


To add a user to the system:
1. Issue the useraddcommand to create a locked user account:
• useradd <username>

2. Unlock the account by issuing the passwdcommand to assign a password


and set password aging guidelines:
• passwd <username>

14.2.3. Adding a Group


To add a group to the system, use the command groupadd:
groupadd <group-name>

Pakistan Computer Bureau 135


Option Description

-g<gid> Group ID for the group, which must be unique and


greater than

-r Create a system group with a GID less than 500


-f When used with -g<gid> and <gid> already exists,
groupadd will choose another unique <gid> for the group.
Table 14.2 group add Command Line Options

14.2.4. Password Aging


For security reasons, it is advisable to require users to change their passwords
periodically. This can be done when adding or editing a user on the Password
Info tab of the User Manager. To configure password expiration for a user from
a shell prompt, use the chage command.

Important

Shadow passwords must be enabled to use the chage command.

Option Description

-m<days> Specifies the minimum number of days between which


the user must change passwords. If the value is 0, the
password does not expire.
-M<days> Specifies the maximum number of days for which th
password is valid. When the number of days specified by
this option plus the number of days specified with the -d
option is less than the current day, the user must chang
-d<days> Specifies the number of days since January 1, 1970 the
password was changed
-I<days> Specifies the number of inactive days after the password
expiration before locking the account. If the value is 0,
the account is not locked after the password expires.

Pakistan Computer Bureau 136


-E<date> Specifies the date on which the account is locked, in
the format YYYY-MM-DD. Instead of the date, the
number of days since January 1, 1970 can also be
used.
-W<days> Specifies the number of days before the password
expiration date to warn the user.
Table 14.3 change Command Line Options
Tip

If the chage command is followed directly by a username (with no options), it


displays the current password aging values and allows them to be changed.

You can configure a password to expire the first time a user logs in. This forces
users to change passwords the first time they log in.
Note

This process will not work if the user logs in using the SSH protocol.

1.Lock the user password — If the user does not exist, use the useradd
command to create the user account, but do not give it a password so that it
remains locked. If the password is already enabled, lock it with the command:
• usermod -L username

2. Force immediate password expiration — Type the following command:

• chage -d 0 username
This command sets the value for the date the password was last changed to
the epoch (January 1, 1970). This value forces immediate password
expiration no matter what password aging policy, if any, is in place.

3. Unlock the account — There are two common approaches to this step. The
administrator can assign an initial password or assign a null password.
Warning

Do not use the passwd command to set the password as it disables the immediate
password expiration just configured.

To assign an initial password, use the following steps:

• Start the command line Python interpreter with the python command.

Pakistan Computer Bureau 137


It displays the following:

4.1.1-9)] on linux2 Type "help", "copyright", "credits" or "license" for


more information. >>>
• At the prompt, type the following commands. Replace <password>with
the password to encrypt and <salt> with a random combination of at
least 2 of the following: any alphanumeric character, the slash (/)
character or a dot (.):

import crypt;
print crypt.crypt("<password>","<salt>")

The output is the encrypted password, similar to '12CsGd8FRcMSM'.

• Press Ctrl-D to exit the Python interpreter.


• At the shell, enter the following command (replacing <encrypted-
password>with the encrypted output of the Python interpreter):

usermod -p "<encrypted-password>" <username>

Alternatively, you can assign a null password instead of an initial


password. To do this, use the following command:

• usermod -p "" username

Caution

Using a null password, while convenient, is a highly unsecure practice, as any


third party can log in first an access the system using the unsecure username.
Always make sure that the user is ready to log in before unlocking an account with
a null password.

In either case, upon initial log in, the user is prompted for a new password.

14.2.5. Explaining the Process


The following steps illustrate what happens if the command useradd juanis
issued on a system that has shadow passwords enabled:

1. A new line for juan is created in /etc/passwd. The line has the following
characteristics:

Pakistan Computer Bureau 138


• It begins with the username juan.
• There is an x for the password field indicating that the system is using
shadow passwords.
• A UID greater than 499 is created. (Under Red Hat Enterprise Linux, UIDs
and GIDs below 500 are reserved for system use.)
• A GID greater than 499 is created.
• The optional GECOS information is left blank.
• The home directory for juanis set to /home/juan/.
• The default shell is set to /bin/bash.

2.A new line for juan is created in /etc/shadow. The line has the following
characteristics:
• It begins with the username juan.
• Two exclamation points (!!) appear in the password field of the /etc/shadow
file, which locks the account.

Note

If an encrypted password is passed using the -p flag, it is placed in the /etc/shadow file
on the new line for the user.

• The password is set to never expire.

3.A new line for a group named juan is created in /etc/group. A group with the
same name as a user is called a user private group. For more information on
user private groups, refer to Section 1.1, “Adding a New User”.

The line created in /etc/grouphas the following characteristics:

• It begins with the group name juan.


• An x appears in the password field indicating that the system is using
shadow group passwords.
• The GID matches the one listed for user juanin /etc/passwd.

4. A new line for a group named juanis created in /etc/gshadow. The line has
the following characteristics:

• It begins with the group name juan.


• An exclamation point (!) appears in thepassword field of the
/etc/gshadowfile, which locks the group.
• All other fields are blank.

5. A directory for user juan is created in the /home/ directory. This directory is
owned by user juan and group juan. However, it has read, write, and execute

Pakistan Computer Bureau 139


privileges only for the user juan. All other permissions are denied.

6. The files within the /etc/skel/ directory (which contain default user settings)
are copied into the new /home/juan/ directory.

At this point, a locked account called juan exists on the system. To activate it,
the administrator must next assign a password to the account using the passwd
command and, optionally, set password aging guidelines.

14.3. Standard Users


Everything installation, the groupid (GID) in this table is the primary group
for the user.

User UID GID Home Directory Shell


Root 0 0 /root /bin/bash
Bin 1 1 /bin /sbin/nologin
daemon 2 2 /sbin /sbin/nologin
Adm 3 4 /var/adm /sbin/nologin
Lp 4 7 /var/spool/lpd /sbin/nologin
Sync 5 0 /sbin /bin/sync
shutdown 6 0 /sbin /sbin/shutdown
Halt 7 0 /sbin /sbin/halt
Mail 8 12 /var/spool/mail /sbin/nologin
News 9 13 /etc/news
Uucp 10 14 /var/spool/uucp /sbin/nologin
operator 11 0 /root /sbin/nologin
Games 12 100 /usr/games /sbin/nologin
gopher 13 30 /var/gopher /sbin/nologin
ftp 14 50 /var/ftp /sbin/nologin
nobody 99 99 / /sbin/nologin
Rpm 37 37 /var/lib/rpm /sbin/nologin
Vcsa 69 69 /dev /sbin/nologin
Dbus 81 81 / /sbin/nologin
Ntp 38 38 /etc/ntp /sbin/nologin
Canna 39 39 /var/lib/canna /sbin/nologin
Nscd 28 28 / /sbin/nologin
Rpc 32 32 / /sbin/nologin
postfix 89 89 /var/spool/postfix /sbin/nologin

Pakistan Computer Bureau 140


mailman 41 41 /var/mailman /sbin/nologin
Named 25 25 /var/named /bin/false
amanda 33 6 var/lib/amanda/ /bin/bash
postgres 26 26 /var/lib/pgsql /bin/bash
Exim 93 93 /var/spool/exim /sbin/nologin
Sshd 74 74 /var/empty/sshd /sbin/nologin
rpcuser 29 29 /var/lib/nfs /sbin/nologin
nsfnobody 65534 65534 /var/lib/nfs /sbin/nologin
Pvm 24 24 /usr/share/pvm3 /bin/bash
apache 48 48 /var/www /sbin/nologin
Xfs 43 43 /etc/X11/fs /sbin/nologin
Gdm 42 42 /var/gdm /sbin/nologin
Htt 100 101 /usr/lib/im /sbin/nologin
Mysql 27 27 /var/lib/mysql /bin/bash
webalizer 67 67 /var/www/usage /sbin/nologin
mailnull 47 47 /var/spool/mqueue /sbin/nologin
smmsp 51 51 /var/spool/mqueue /sbin/nologin
Squid 23 23 /var/spool/squid /sbin/nologin
Ldap 55 55 /var/lib/ldap /bin/false
netdump 34 34 /var/crash /bin/bash
Pcap 77 77 /var/arpwatch /sbin/nologin
radiusd 95 95 / /bin/false
Radvd 75 75 / /sbin/nologin
quagga 92 92 /var/run/quagga /sbin/login
Wnn 49 49 /var/lib/wnn /sbin/nologin
dovecot 97 97 /usr/libexec/dovecot /sbin/nologin
Table 14.4 Standard Users

14.4. Standard Groups


Standard groups configured by everything installation. Groups are stored in
the /etc/groupfile.

Group GID Members


Root 0 root
Bin 1 root, bin, daemon
daemon 2 root, bin, daemon
Sys 3 root, bin, adm
Adm 4 root, adm, daemon

Pakistan Computer Bureau 141


Tty 5
Disk 6 root
Lp 7 daemon, lp
Mem 8

Kmem 9
Wheel 10 root
Mail 12 mail, postfix, exim
News 13 news
Uucp 14 uucp
Man 15
Games 20
Gopher 30
Dip 40
ftp 50
Lock 54
Nobody 99
Users 100
Rpm 37
Utmp 22
Floppy 19
Vcsa 69
dbus 81
ntp 38
canna 39
rpc 32
postdrop 90
postfix 89
mailman 41
exim 93
named 25
postgres 26
sshd 74
rpcuser 29
apache 48
xfs 43
gdm 42

Pakistan Computer Bureau 142


htt 101
mysql 27
webalizer 67
mailnull 47
smmsp 51
squid 23
ldap 55
netdump 34
pcap 77
quaggavt 102
quagga 92
radvd 75
slocate 21
wnn 49
dovecot 97
radiusd 95
Table 14.5 Standard Groups

14.5. User Private Groups


Red Hat Enterprise Linux uses a user private group (UPG) scheme, which
makes UNIX groups easier to manage. A UPG is created whenever a new user
is added to the system. A UPG has the same name as the user for which it was
created and that user is the only member of the UPG. UPGs make it safe to set
default permissions for a newly created file or directory, allowing both the
user and the group of that user to make modifications to the file or directory.

The setting which determines what permissions are applied to a newly created
file or directory is called a umask and is configured in the /etc/bashrc file.
Traditionally on UNIX systems, the umask is set to 022, which allows only the
user who created the file or directory to make modifications. Under this
scheme, all other users, including members of the creator's group, are not
allowed to make any modifications. However, under the UPG scheme, this
"group protection" is not necessary since every user has their own private
group.

14.5.1. Group Directories


Many IT organizations like to create a group for each major project and then
assign people to the group if they need to access that project's files. Using this

Pakistan Computer Bureau 143


traditional scheme, managing files has been difficult; when someone creates a
file, it is associated with the primary group to which they belong. When a
single person works on multiple projects, it is difficult to associate the right
files with the right group. Using the UPG scheme, however, groups are
automatically assigned to files created within a directory with the setgid bit set.

The setgid bit makes managing group projects that share a common directory
very simple because any files a user creates within the directory are owned by
the group which owns the directory.

Let us say, for example, that a group of people need to work on files in the
/usr/share/emacs/site-lisp/ directory. Some people are trusted to modify the
directory, but certainly not everyone is trusted. First create an emacs group, as
in the following command:
• /usr/sbin/groupadd emacs

To associate the contents of the directory with the emacsgroup, type:


• chown -R root.emacs /usr/share/emacs/site-lisp

Now, it is possible to add the proper users to the group with the gpasswd
command:
• /usr/bin/gpasswd -a <username> emacs

To allow users to create files within the directory, use the following command:

• chmod 775 /usr/share/emacs/site-lisp

When a user creates a new file, it is assigned the group of the user's default
private group. Next, set the setgid bit, which assigns everything created in the
directory the same group permission as the directory itself (emacs). Use the
following command:
• chmod 2775 /usr/share/emacs/site-lisp

At this point, because the default umask of each user is 002, all members of
the emacs group can create and edit files in the /usr/share/emacs/site-lisp/
directory without the administrator having to change file permissions every
time users write new files. In multiuser environments it is very important to
use shadow passwords (provided by the shadow-utils package). Doing so

Pakistan Computer Bureau 144


enhances the security of system authentication files. For this reason, the
installation program enables shadow passwords by default. The following
lists the advantages of shadow passwords have over the traditional way of
storing passwords on UNIX-based systems:
• Improves system security by moving encrypted password hashes
from the world-readable /etc/passwd file to /etc/shadow, which is
readable only by the root user.
• Stores information about password aging.
• Allows the use the /etc/login.defsfile to enforce security policies.

Most utilities provided by the shadow-utils package work properly whether or


not shadow passwords are enabled. However, since password aging
information is stored exclusively in the /etc/ shadow file, any commands which
create or modify password aging information do not work. The following is a
list of commands which do not work without first enabling shadow passwords:
• chage
• gpasswd
• /usr/sbin/usermod-e or -foptions
• /usr/sbin/useradd-e or -foptions

Pakistan Computer Bureau 145


OpenOffice.org (OOo) is a suite of programs for word processing, spreadsheets,
presentations, databases and drawings. OpenOffice.org was originally derived
from Star Office, an office suite developed by Star Division and acquired by Sun
Microsystems in August 1999. The source code of the suite was released in July
2000 with the aim of reducing the dominant market share of Microsoft Office by
providing a free, open and high-quality alternative; later versions of Star Office
are based upon OpenOffice.org with additional proprietary components.

15.1 System Requirements

Linux
• PC with Pentium or compatible processor, or PowerPC processor
• 64 MB RAM.
• 170 MB hard disk space.
• Linux Kernel 2.0.7 or higher
• X Server with a minimum of 256 colors or gray-scale.
• glibc2 2.1.3 or higher (2.2.1 for PPC).
• VGA or higher resolution graphic device with at least 256 colours,
800 x 600.

Solaris
• 128 MB of RAM.
• 240 MB hard disk space.
• Solaris 7 or higher (SPARC).
• For accessibility support GNOME 2.0 or higher is required.
• VGA or higher resolution graphic device with at least 256 colors 800
x 600.
• Gnome 2.0 required for accessibility.

146
Mac OS X
• Mac OS X v10.2 or higher
• 256 MB RAM, 512 MB recommended.
• 300 MB hard disk space (including X11).
• G4/400 or higher recommended.

Windows
• Pentium-compatible PC.
• Microsoft Windows 95 or higher.
• Win98 or higher required for Asian/CJK versions (2000 or higher
recommended).
• 64 MB of RAM.
• 170 MB hard disk space.

15.2 How to Run


On Windows Operating Systems
• Click left button of mouse on the butter fly icon, at right hand corner of the
task bar and press Start Button.
• Browse program and click on Open Office from the menu
• Or
• Press Mouse right button on the desktop and select Open Office Document
from New Option of the Menu.

On Linux Operating Systems


• Click the mouse left button on the Butterfly icon (placed at lower right
corner of the task bar)
• At home directory, type the command / Open Office to open the Office

147
OpenOffice Writer is a word processing application similar to Microsoft Word.
OpenOffice is an open source software suite, and in addition to the Writer
application, it includes Base, Calc, Draw, Impress and Math, all comparable to
Microsoft Office applications.

15.1 Starting Writer


Starting Writer is the easiest portion of this entire document. To start writer we
have following ways to do it:

15.1.1 From the system menu


a. On Windows, the OpenOffice.org menu is located in Programs >
OpenOffice.org X.X.X, where “X.X.X” corresponds to the version
number of OpenOffice.org. Select Text Document to start Writer
with a blank document.
b. On the GNOME desktop, you will find this version under Red Hat's
Main Menu > Office. If you have installed a newer version of
OpenOffice.org, you will find it under Main Menu > Office > More
Office Applications.
c. On KDE, OpenOffice.org is installed in its own menu, called
“OpenOffice.org 1.1.1”. If you are using a different version, then
“1.1.1” will be replaced with the correct version number.
OpenOffice.org 1.1.1 on OS X 10.3 or later installs the OpenOffice.org1.1.1 folder
in Applications. From within this folder, either double-click the Begin_OOorg
icon, or drag the icon to the Dock and single-click it. Apple's X11 will launch,
followed by OpenOffice.org.

15.2Creating a Document
15.2 .1 Creating A Blank Document
You can create a new, blank document in Writer in a number of ways.

• By using the Control+N keystroke. When you press Control+N you get a
new empty document to work with. If you already have a document open,
a new document window will be created.
• By using File > New > Text Document. The result is similar to using the
Control+N keystroke.
• Finally, by clicking a button on the main toolbar.

Pakistan Computer Bureau 148


15.2.2 Creating a Document from a Template
Writer can use templates to create new documents. Templates serve as the
foundation of a series of documents, to make sure they all have a similar layout.
For example, all the documents of this User Guide are based on the same template.
By doing this, all the documents will look alike. They will have the same headers
and footers, use the same fonts, and so on.

15.2.3 Creating a Document with an Autopilot


• Select File > Autopilot > Fax. You will get a window:
• Enter a title for your fax and a fax format.
• Click on Next
• At any time, you can press the Create button to create the new document.
• After pressing the Create button, you will get a new document, filled with
the information you entered in the Autopilot.

15.3 Loading an Existing Document


• Select File > Open.
• In the file chooser, select the type of file you are looking for. You can
reduce the list by choosing the proper File Type. If you choose Text
documents as the file type, you will only see documents Writer
understands.
• Select the file you want, and then click Open.

15.4 Saving Document


15.4.1 Saving a Document
There are two ways to save in Writer:

• Press Control-S.
• Select File > Save. You also can tell Writer to save your document
automatically at regular intervals. To enable this, you must configure
OpenOffice.org to save all documents automatically.

1. Select Tools > Options. The option window appears.


2. Select Load/Save > General. See Figure 11.
3. Click on AutoSave every. This will activate the spin box to set the interval.
The default value is 15 minutes. Enter the value you want by typing it or by
pressing the up/down arrow keys.

Pakistan Computer Bureau 149


4. The default setting makes OpenOffice.org ask you for a confirmation every
time it is about to save a file automatically. If you don't want
OpenOffice.org to ask, remove the checkmark beside Prompt to save, by
clicking on it.

15.4.2 Saving As MS Word Document


To save a document as a Microsoft Word file:

1. Save your document (see “Saving a document”). If you don't, any changes
you made since the last time you saved will only appear in the Microsoft
Word version of the document.
2. Select File > Save As. A file browser appears. See Figure 12.
3. In the File type drop-down menu, select the type of Word format you need.
4. Click Save.

15.5 Closing A Document


• Press Control-W, or
• Select File > Close, or
• Click on the “X” in the upper right-hand of the OpenOffice.org window.
Make sure you don't click the “X” of the window border: if you do so and
this is your last open document, Writer will close completely and you will
need to start it again to work on a new document.

15.6 Exiting Writer


• Press Control+Q, or
• Select File > Exit.

15.7 Formatting Documents


Page elements, including background color, margins, header/footer, and footnotes
can be edited by clicking on PAGE in the FORMAT menu. A window will pop
up allowing you to choose tabs to edit certain elements within the page.

Pakistan Computer Bureau 150


Figure 3

The font size, type and color can be changed by using the drop down menus
located within the tool bar, or they can be changed by clicking on FONT in the
FORMAT menu. To edit paragraph features, including spacing, alignment, text
flow, tabs and borders, choose PARAGRAPH from the FORMAT menu.

Figure 4

Pakistan Computer Bureau 151


The format paintbrush (left) allows you to copy the format of existing text
and apply it to another section. Highlight the formatted text you want to copy with
the cursor, click on the paintbrush icon in the tool bar, and click on the text you
want to format. This feature can be used for headings, paragraphs, words and
objects.

Troubleshooting tip:

The default font setting for Writer documents is Times New Roman. If you experience
problems while using the format paintbrush, where it reverts some text to Times New
Roman instead of the font you have chosen, make sure to change the font setting by going
to FORMAT and then FONT in the menu bar instead of changing it in the drop down box
in the tool bar. Using the drop down box only applies the font setting to sections of the
document, while changing it from the menu applies it to the entire document.

15.8 Cut, Copy and Paste

Like Microsoft Word, Writer enables you to cut copy and paste
text and objects. This can be done within one document or between
multiple documents. There are a number of ways to do this.

• It can be done through the EDIT menu by highlighting text you want to
copy or cut, select COPY or CUT. Place the mouse where the text will be
inserted, and select PASTE from the EDIT menu.
• You can also use the cut, copy and paste icons in the tool bar (pictured
above).
• These key commands speed up the process if you will be using the cut,
copy and paste features often:
o Ctrl + C = Copy
o Ctrl + V = Paste
o Ctrl + X = Cut

15.9 Inserting Pictures and Graphics


Writer allows you to insert pictures and graphics within your text. You can do this
by going to INSERT in the menu bar, and the bottom set of features lists pictures
and graphics you can insert, including frames, tables, horizontal ruler, pictures,
movies, objects and floating frames.

Pakistan Computer Bureau 152


Figure 5
If you choose to insert a frame, you have the option to include a picture or object
within the frame. The horizontal ruler allows you to insert a graphical line
dividing sections of your work. You can choose to insert a picture from an
existing file or a scanned item. If you choose to insert a picture from a file, you
will be prompted to locate the file and picture on your computer. Movie and
sound allows you to insert an audio or video file into the document. If you choose
to insert an object, you have several options:

• OLE Objects: Object Linking and Embedding objects. These can link to
another type of Open Office document, or the other documents can be
embedded within the text.
• Plug-in: If your document is to be displayed as a web page, it allows you to
insert a plug-in, or software component that expands the capabilities of a
web browser.
• Sound: Inserts an audio file located on your computer.
• Video: Inserts a video file.

Pakistan Computer Bureau 153


• Applet: These contain programs written in Java, and they are often used for
animation. When they are inserted into your document, anyone who has a
web browser supporting applets is able to view them.
• Formula: This allows you to insert a formula directly into the document.
• Chart: Allows you to create a chart to illustrate your text.

A floating frame allows you to insert another document within the text. It is most
applicable when you are saving a Writer document as a web page. An example of
a floating frame is a software agreement that must be read before installation.
Once you choose to insert a floating frame, you will be prompted to locate the file
you want it to display. The frame allows the user to scroll through the document.
An example of a floating frame:

Figure 6
15.10 Draw Functions
To activate the drawing tool bar, go to VIEW, then TOOLBARS, and select the
drawing toolbar. A set of drawing tools should appear along either the top or
bottom of the page.

Pakistan Computer Bureau 154


Drawing tools allow basic drawing functionality similar to that of most
paint/drawing programs. Straight lines, basic geometric shapes, free form lines and
text boxes can be added. The following icons may be unfamiliar, but their features
are quite useful.

These two buttons allow you to add callouts to your document.


Callouts are text boxes that point to an item on the page. Just put your mouse
where you would like the callout to start, and click and drag. You have the option
to adjust size, location, font and color after it is created. The button on the right
allows more options as to how the callout will look.

These three buttons allow you to add basic shapes, symbols,


and merit stars/symbols. Some examples include:

These buttons add arrows and flowchart features to the document.

This button allows access to the fontworks gallery. Click on the button, and
select which type of text you would like. Once the text has been inserted, adjust
the size and location by dragging with the mouse. Double click on the text, and

Pakistan Computer Bureau 155


edit it to say what you would like. Here are some examples of the fontworks
features:

This button allows you to insert pictures or graphics from a file just as you
would from the INSERT menu.

15.11 Tables and Lists


Tables and lists can be included in a Writer document through either the menu bar or the
tool bar. To insert a table from the menu bar, click INSERT, and scroll down to
TABLE. A menu will appear allowing you to name the table and edit the number of
rows and columns. You can also adjust other table settings, including heading,
AutoFormat, border, etc., in the options section (figure 8).

Figure 8

Tables can also be added by clicking on the left icon in the tool bar. You
can click on the button, and you will get the same pop-up menu as in figure 7, or
you can click on the drop down arrow next to the button, and you will have the
option to drag your mouse to choose the number of rows and columns:

Pakistan Computer Bureau 156


To insert a list, you can either use a format of bullets, numbers or a customized
outline version. Go to FORMAT, BULLETS & NUMBERING, and a pop-up
menu will allow you to customize or choose the format for your bullets or
numbers (figure 9).

Figure 9

You also have the option of using the default bullet and numbering
settings by clicking on the buttons in the tool bar, which are pictured above.

Pakistan Computer Bureau 157


15.12 Page and Section Breaks
You can insert line, column and page breaks into your document by going to
INSERT, MANUAL BREAKS. Page breaks end the text where they are on the
current page and start on the next page. Page breaks are useful after creating a title
page, while line breaks and column breaks are useful when you are working with
tables or spreadsheets.

Figure 10
15.13 Spell Check, Auto Correct and Word Count
OpenOffice Writer has the ability to check for spelling mistakes. You can
check the spelling by going to TOOLS and then SPELL CHECK, or you can
click on the button in the tool bar pictured above. By highlighting a particular
word or section, Writer will only check the spelling in that section. If nothing is
highlighted, it will check the entire document. Writer automatically underlines
misspelled words with a red, wavy line. This feature can be turned off by clicking
on the following button in the tool bar:

AutoCorrect is a feature that automatically corrects commonly misspelled


words. It replaces mistakes like t-e-h with t-h-e. By going to TOOLS then
AUTOCORRECT (figure 11), you can see the list of existing words Writer is
programmed to correct.

Pakistan Computer Bureau 158


Figure 11

Within this window, you have the option of setting exceptions for words to be
corrected, and you can add other words that you may commonly misspell to be
corrected automatically.

Figure 12

You can count the total number of words in a document or highlighted section by
going to TOOLS, then WORD COUNT.

Pakistan Computer Bureau 159


15.14 Hyperlinks
Text can be converted to hyperlinks for electronic versions of Writer documents.
This can be done by going to INSERT then HYPERLINK, or you can click on
the button pictured above. The screen pictured in figure 13 will pop up. A
hyperlink will allow you to link to a web page, an email address, existing
documents, or a new document. These options are located on the left side of the
page. The target link should be typed into the target box at the top of the window,
and the text you want to show on the document will be typed into the text box at
the bottom of the window. Once these values are correctly filled in, click APPLY,
and then CLOSE. The hyperlink will appear on the page where the cursor is.

Figure 13
15.15 Find/Replace
Writer has a feature that allows you to find and replace a word that appears
throughout the document. This can be done by going to EDIT, FIND/REPLACE
in the menu bar, or you can click on the button with binoculars (pictured above) in
the tool bar. A screen will pop in which you will type the words to find and
replace. Type the text you would like to find in the top box and the text you want
to replace it with in the bottom box. Make sure to check the “Match Case” box if
you want it to be case specific.

Pakistan Computer Bureau 160


Figure 14
15.16 Print Preview/Printing
When you are ready to print your document, you can preview the print
layout before you print the pages. Go to FILE then PRINT PREVIEW in the
menu, or click on the button with the magnifying glass pictured above. You will
be able to view the layout of multiple pages, which you can choose by clicking on
the page layout icon, circled in figure 15. When you are finished, you can click on
the printer icon to print, or you can return to the normal screen by clicking on
CLOSE PREVIEW. You can continue printing by going to FILE then PRINT,
or you can click on the printer icon in the Writer tool bar.

Pakistan Computer Bureau 161


Figure 15
15.17 Navigator
Clicking on the compass icon (left) in the tool bar activates the Navigator
feature. This feature allows the user to move around within different sections of
the document. This includes headings, tables, graphics, etc. If any of these are
included in the document, the navigator will have a drop down list for you to
choose from, and it will take you to that section of the document. This feature is
especially useful for very long documents. The Navigator activates a pop up
window that will stay active unless you choose to close it (figure 16).

Pakistan Computer Bureau 162


Figure 16
15.18 Save as HTML
Writer allows you to save your document as an HTML document, which can be
viewed as a web page. Do this by going to FILE, SAVE AS, and save the
document as a .HTML. You may get the pop-up window in figure 17 that says
some of the formatting may be changed once you save it this way. It is
recommended that you save it as a .ODT (OpenDocument text) first so you will
not lose important features of the document. When saving as an HTML document,
make sure to create a folder associated with the document because Writer
automatically extracts all associated pictures and objects embedded in the
document and creates separate files for them. Once it is saved as an HTML
document, you can view it as a web page and edit the HTML code to make
changes to the formatting.

Figure 17
15.19 Tracking Changes
When multiple people are working on a document or project, Writer has a feature
that allows changes in the document to be tracked by user. Go to EDIT,
CHANGES, and select RECORD. Make sure that SHOW is also selected. This
will highlight or underline changes added by other users, and the final editor of the
document can review these changes and accept or reject them. By rolling the

Pakistan Computer Bureau 163


mouse over the changes, you can view who made the changes and when they were
made. To accept or reject them, select ACCEPT or REJECT from the
CHANGES menu. The editor will be able to see a pop-up window with a list of
all changes that have been made by user, and they will have the option of
accepting or rejecting each of them (figure 18).

Figure 18
Writer also allows the option of protecting the document by setting a password to
allow any changes to be made. This can be done by selecting PROTECT
RECORDS from the CHANGES menu.

15.20 Versioning
The versioning feature of Writer tracks multiple versions of the document that
have been saved by date and user. Go to FILE then VERSIONS, and you will get
a pop-up window that lists all of the versions that have been saved (figure 19).
Pakistan Computer Bureau 164
Each version can be saved individually, and notes can be added to explain the
changes to the version. You can check “Always save a version on closing,” to
make sure all versions are saved and nothing important is deleted. The
COMPARE feature will highlight changes from the selected version and compare
them to the current document.

Figure 19

Pakistan Computer Bureau 165


16.1 What is Calc?
Calc is the spreadsheet component of OpenOffice.org (OOo). You can enter data,
usually numerical data, in a spreadsheet and then manipulate this data to produce
certain results. A major advantage of electronic spreadsheets is that the data is
easier to alter. If the correct functions and formulas have been used, the program
will apply these changes automatically.

16.2 Spreadsheets, sheets and cells


Calc works with elements called spreadsheets. Spreadsheets consist of a number of
individual sheets, each containing a block of cells arranged in rows and columns.
These cells hold the individual elements text, numbers, formulas which make up
the data to be displayed and manipulated. Each spreadsheet can have many sheets
and each sheet can have many individual cells.

16.3 Title bar and Menu bar


The Title bar, at the top, shows the name of the current spreadsheet. If the
spreadsheet is new, then its name is Untitled X, with X being a number. When you
save a new spreadsheet for the first time, you will be prompted to enter a name.
Under the Title bar is the Menu bar. When you choose one of the menus, a
submenu appears with other options. The Menu bar can be modified.

16.4 Toolbars
Under the Menu bar by default are three toolbars: the Standard toolbar, the
Formatting toolbar, and the Formula toolbar. The icons on these toolbars provide a
wide range of common commands and functions. The toolbars can be modified, as
discussed in the chapter titled Menus and Toolbars in the Getting Started guide.

Placing the mouse pointer over any of the icons displays a small box, called a tool
tip it gives a brief explanation of the icon function. Fora more detailed
explanation, select Help > what’s this? And hover the mouse pointer over the icon
you need more help with. In the Formatting toolbar, there are two rectangular
areas on the left. They are the Font Name and Font Size menus. If there is
something already in the box, it tells what the current setting for the selected area
is.

16.5 Formula bar


On the left of the Formula bar there is a small text box, called the Name box, with
a letter and number combination in it, such as D7. This is the column letter and
row number, called the cell reference, of the current cell. To the right of the Name

Pakistan Computer Bureau 166


Box are the the Function Wizard, Sum, and Function buttons. Clicking the
Function Wizard button opens a dialog box from which you can search through a
list of available functions. This can be very useful, because it also shows how the
functions are formatted. The Sum button inserts a formula into the current cell that
totals the numbers in the cells above or to the left if there are no numbers above,
the current cell. The Function button inserts an equal’s sign into the selected cell
and the Input Line, thereby setting the cell ready to accept a formula. When you
enter new data into a cell that already contains something, the Sum and Equals
buttons change to Cancel and accept buttons . The contents of the current cell
(data, formula, or function) are displayed in the Input Line, the remainder of the
Formula bar. You can edit the cell contents of the current cell here, or you can do
that in the current cell. To edit inside the Input Line area, left-click the appropriate
part of the Input Line area, then type your changes. To edit within the current cell,
just double-click the cell.

16.6 Individual cells


The main section of the screen displays the individual cells in the form of a grid,
with each cell being at the intersection of a particular column and row. At the top
of the columns and at the left-hand end of the rows are a series of gray boxes
containing letters and numbers. These are the column and row headers. The
columns start at A and go on to the right and the rows start at 1 and go on
downwards. These column and row headers form the cell references that appear in
the Sheet Area box on the Formula Bar. These headers can also be turned off by
selecting View > Column & Row Headers.

16.7 Starting new spreadsheets


A new spreadsheet can be opened regardless of which other component of OOo
you are using at the time. For example, a new spreadsheet can be opened from
Writer or Draw.

16.7.1 from the File menu


Click on the File menu and then select New > Spreadsheet.

16.7.2 from the toolbar


Use the New Document button on the Standard toolbar. (This button is always
a page of text from the current component with a black arrow to the right.)A long-
click (click and hold) on the New Document button opens a submenu from which
you can choose Spreadsheet (or any other type of OOo document). This submenu
can also be opened by single-clicking on the black arrow next to the New
Document button.

Pakistan Computer Bureau 167


16.7.3 from the keyboard
If you already have a spreadsheet open, you can press Control + N to open a new
spreadsheet.

16.8 Opening existing spreadsheets


16.8.1 from the File menu
Click on the File menu and then select Open.

16.8.2 from the toolbar


Click the Openbutton on the Standard toolbar.

16.8.3 from the keyboard


Use the key combination Control+O.

16.8.4 from a template


Calc documents can also be created from templates, if you have any spreadsheet
templates available. Follow the above procedures, but instead of selecting
Spreadsheet from the menu, select Templates and Documents. On the Templates
and Documents window, navigate to the appropriate folder and double-click on the
required template. A new spreadsheet, based on the selected template, opens.

16.9 Saving spreadsheets


Spreadsheets can be saved in three ways.

16.9.1 from the File menu


Click on the File menu and then select Save.

16.9.2 from the toolbar


Click on the Savebutton on theFunctionbar. This button will be greyed-out and
unselectable if the file has been saved and no subsequent changes have been made.

16.9.3 from the keyboard


Use the key combination Control+S.

Note

If the spreadsheet has been previously saved, then saving will overwrite the existing copy
without opening the Save As dialog box. If you want to save the spreadsheet in a different
location or with a different name, then select File > Save As.

Pakistan Computer Bureau 168


16.10 Navigating within spreadsheets
16.10.1 Going to a particular cell

16.10.1.1 Using the mouse


Place the mouse pointer over the cell and left-click.

16.10.1.2 Using a cell reference


Click on the little inverted black triangle just to the right of the Name box. The
existing cell reference will be highlighted. Type the cell reference of the cell you
want to go to and press Enter. Or just click into the Name box, backspace over the
existing cell reference and type in the cell reference you want.

16.10.2.3Using the Navigator


Click on the Navigator button in the Standard toolbar (or press F5) to display
the Navigator. Type the cell reference into the top two fields, labeled Column and
Row, and press Enter. In Figure 7 the Navigator would select cell F5.

16.10.3 Moving from cell to cell


In the spreadsheet, one cell, or a group of cells, normally has a darker black
border. This black border indicates where the focus is.

16.10.3.1 Using the Tab and Enter keys


• Pressing Enter or Shift+Enter moves the focus down or up, respectively.
• Pressing Tab or Shift+Tab moves the focus right or left, respectively.

16.10.3.2 Using the cursor keys


Pressing the cursor keys on the keyboard moves the focus in the direction of the
arrows. Using Home, End, Page Up and Page Down Home moves the focus to the
start of a row. End moves the focus to the column furthest to the right that contains
data. Page Down moves the display down one complete screen and Page Up
moves the display up one complete screen. Combinations of Control and Alt with
Home, End, Page Down, Page Up, and the cursor keys move the focus of the
current cell in other ways. Table 1 describes all the keyboard shortcuts for moving
about a spreadsheet.

TIP

Holding down Alt+Cursor key resizes a cell.

Pakistan Computer Bureau 169


Key Combination Movement
→ Right one cell
↠Left one cell
↑ Up one cell
↓ Down one cell
Control+→ To last column containing data in that row or to Column IV
Control+↠To first column containing data in that row or to Column A
Control+↑ To first row containing data in that column or to Row 1
Control+↓ To last row containing data in that column or to Row 32000
Control+Home To Cell A1
Control+End To lower right hand corner of the square area containing data
Alt+PgDn One screen to the right (if possible)
Alt+PgUp One screen to the left (if possible)
Control+PgDn One sheet to the right (in Sheet Tabs)
Control+PgUp One sheet to the left (in Sheet Tabs)
Tab To the cell on the right
Shift+Tab To the cell on the left
Enter Down one cells
Shift+Enter Up one cell

6.10.4 Moving from sheet to sheet


Each sheet in a spreadsheet is independent of the others though they can be linked
with references from one sheet to another. There are three ways to navigate
between different sheets in a spreadsheet.

16.10.4.1Using the keyboard


By Pressing Control+PgDnmoves, one sheet to the right and, pressing
Control+PgUpmoves one sheet to the left.

16.10.4.2 Using the mouse


Clicking one of the Sheet Tabs at the bottom of the spreadsheet selects that sheet.
If you have a lot of sheets, then some of the sheet tabs may be hidden behind the
horizontal scroll bar at the bottom of the screen. If this is the case, then the four

Pakistan Computer Bureau 170


buttons at the left of the sheet tabs can move the tabs into view. Notice that the
sheets here are not numbered in order. Sheet numbering is arbitrary as you can
name a sheet as you wish.

Note

The sheet tab arrows that appear in Figure 9 only appear if you have some sheet tabs
that can not be seen. Otherwise they will appear faded.

16.11 Selecting items in a sheet or spreadsheet


16.11.1 Selecting cells
Cells can be selected in a variety of combinations and quantities.

16.11.2 Single cell


Left-click in the cell, you can verify your selection by looking in the Name box.

16.11.3 Range of contiguous cells


A range of cells can be selected using the keyboard or the mouse.

16.11.4 To select a range of cells by dragging the mouse:


Click in a cell. Press and hold down the left mouse button. Move the mouse
around the screen. Once the desired block of cells is highlighted, release the left
mouse button.

16.11.5 To select a range of cells without dragging the mouse:


Click in the cell which is to be one corner of the range of cells. Move the mouse to
the opposite corner of the range of cells. Hold down the Shift key and click.
16.11.6 To select a range of cells without using the mouse:
Select the cell that will be one of the corners in the range of cells. While holding
down the Shift key, use the cursor arrows to select the rest of the range.

TIP

You can also directly select a range of cells using the Name box. Click into the Name box
as described in “Using a cell reference†on page 10. To select a range of cells, enter
the cell reference for the upper left hand cell, followed by a colon (:), and then the lower
right hand cell reference. For example, to select the range that would go from A3 to C6,
you would enter A3:C6.

Pakistan Computer Bureau 171


16.11.7 Range of non-contiguous cells
Select the cell or range of cells using one of the methods above. Move the mouse
pointer to the start of the next range or single cell. Hold down the Control key and
click or click-and-drag to select a range. Repeat as necessary.

16.11.8 Selecting columns and rows


Entire columns and rows can be selected very quickly in OOo.

16.11.8.1 Single column


To select a single column, click on the column identifier letter.

16.11.8.2 Single row


To select a single row, click on the row identifier number.

16.11.8.3 Multiple columns or rows


To select multiple columns or rows that is contiguous: Click on the first column or
row in the group. Hold down the Shift key. Click the last column or row in the
group. To select multiple columns or rows that is not contiguous: Click on the first
column or row in the group. Hold down the Control key. Click on all of the
subsequent columns or rows while holding down the Control key.

16.11.8.4 Entire sheet


To select the entire sheet
• Click on the small box between the A column header and the 1 row header.
You can also use the keyboard to select the entire sheet by pressing
Control+A.

16.12 Selecting sheets


You can select either one or multiple sheets. It can be advantageous to select
multiple sheets at times when you want to make changes to many sheets at once.

16.12.1 Single sheet


Click on the sheet tab for the sheet you want to select. The active sheet will
become white.

16.12.2 Multiple contiguous sheets


To select multiple contiguous sheets: Click on the sheet tab for the first sheet.
Move the mouse pointer over the last sheet tab. Hold down the Shift key and click
on the sheet tab. All the tabs between these two sheets will turn white. Any actions
that you perform will now affect all highlighted sheets.

Pakistan Computer Bureau 172


16.12.3 Multiple non contiguous sheets
To select multiple non contiguous sheets: Click on the sheet tab for the first sheet.
Move the mouse pointer over the second sheet tab. Hold down the Control key and
click on the sheet tab. Repeat as necessary. The selected tabs will turn white. Any
actions that you perform will now affect all highlighted sheets.

16.12.4 All sheets


Right-click over any one of the sheet tabs and select Select All Sheets from the
popup menu.

16.13 Working with columns and rows


16.13.1 Inserting columns and rows
Columns and rows can be inserted in several different way and quantities.

16.13.2 Single column or row


A single column or row can be added using the Insert menu:
• Select the column or rows where you want the new column or row inserted.
• Select either Insert > Columns or Insert > Rows.
Note

When you insert a single new column, it is inserted to the left of the highlighted column.
When you insert a single new row, it is inserted above the highlighted row.

A single column or row can also be added using the mouse: Select the column or
rows where you want the new column or row inserted. Right-click the header.Select
Insert Rows or Insert Columns.

16.13.3 Multiple columns or rows


Multiple columns or rows can be inserted at once rather than inserting them one at
a time. Highlight the required number of columns or rows by holding down the
left mouse button on the first one and then dragging across the required number of
identifiers. Proceed as for inserting a single column or row above.

16.14 Deleting columns and rows


Columns and rows can be deleted individually or in groups.

16.14.1 Single column or row


A single column or row can only be deleted by using the mouse: Select the column
or row to be deleted, Right-click on the column or row header. Select Delete
Columns or

Pakistan Computer Bureau 173


16.14.2 Multiple columns or rows
Multiple columns or rows can be deleted at once rather than deleting them one at a
time. Highlight the required number of columns or rows by holding down the left
mouse button on the first one and then dragging across the required number of
identifiers. Proceed as for deleting a single column or row above.

16.15 Working with sheets


Like any other Calc element, sheets can be inserted, deleted and renamed.

16.15.1 Inserting new sheets


There are many ways to insert a new sheet. The first step for all of the methods is
to select the sheets that the new sheet will be inserted next to. Then any of the
following options can be used.

• Click on the Insert menu and select Sheet, or


• Right-click on its tab and select Insert Sheet, or
• Click into an empty space at the end of the line of sheet tabs.

Each method will open the Insert Sheet dialog. Here you can select whether the
new sheet is to go before or after the selected sheet and how many sheets you want
to insert.

16.15.2 Deleting sheets


Sheets can be deleted individually or in groups.

16.15.2.1 Single sheet


Right-click on the tab of the sheet you want to delete and select Delete Sheetfrom
the popup menu.

16.15.2.2 Multiple sheets


To delete multiple sheets, select them as described earlier, right-click over one of
the tabs and select Delete Sheet from the popup menu.

16.15.2.3 Renaming sheets


To give a sheet a more meaningful name, you can:

• Enter the name in the name box when you create the sheet, or
• Right-click on a sheet tab and select Rename Sheet from the popup menu
and replace the existing name with a better one.

Pakistan Computer Bureau 174


Note

Sheet names must start with either a letter or a number; other characters including
spaces are not allowed, although spaces can be used between words. Attempting to
rename a sheet with an invalid name will produce an error message.

16.16 Viewing Calc


16.16.1 Using the zoom function
The zoom function allows you to change the view in order to see more or less cells
in the window. The zoom function can be activated by either:

• Going to the View menu and selecting Zoom, or


• Double-clicking on the percentage figure in the status bar at the bottom of
the window.

Both methods will open the Zoom dialog. This dialog has the following options
listed on the left side. Entire Page this option changes the view so that an entire
page fits within the height and width of the window. The page is defined by the
page format that has been applied to the sheet. This can be modified through
Format > Page > Page tab or through Format > Styles and Formatting > Page
Styles. In general, OOo will show at least one page within the window.

Page Width this option changes the view so that the width of the page fits within
the width of the screen. The page is defined as above. Where Entire Page can
make cells appear quite small, Page Width will show the width of the page while
possibly sacrificing the view of the entire height of the page. Optimal this option
zooms up the selected range to fit the screen and is normally greyed out to show
that it is not available. To use this option, you must first highlight a range of cells.

Percentages these options zoom the screen to a particular size, 100% being full
size. Variable this option allows you to set a zoom percentage of your choice.
Either use the up or down arrows to the right of the entry field or click three times
in the field to select the current amount and type in your desired zoom level.

16.17 Freezing/Unfreezing rows and columns


Freezing locks a number of rows at the top of a spreadsheet or a number of
columns on the left of a spreadsheet or both.Then when scrolling around within
the sheet, any frozen columns and rows remain in view. You can set the freeze
point at one row, one column, or both a row and a column.

Pakistan Computer Bureau 175


16.17.1 Freezing single rows or columns
Click on the header for the row below where you want the freeze or for the column
to the right of where you want the freeze.

• Select Window > Freeze.

A dark line will appear to indicate where the freeze is put.

16.17.2 Freezing a row and a column


Click into the cell that is immediately below the row you want frozen and
immediately to the right of the column you want frozen.

• Select Window > Freeze.

You will see two lines appear on the screen, a horizontal line above this cell and a
vertical line to the left of this cell. Now as you scroll around the screen everything
above and to the left of these lines will remain in view.

16.17.3 Unfreezing
To unfreeze rows or columns
• Select Window > Freeze.

The checkmark byFreeze should vanish.

16.18 Splitting the window


Another way to change the view is by splitting the window otherwise known as
splitting the screen. The screen can be split either horizontally or vertically or
both. This allows you to have up to four portions of the spreadsheet in view at any
one time. Why would you want to do this? Imagine you have a large spreadsheet
and one of the cells has a number in it which is used by three formulas in other
cells. Using the split screen technique, you can position the cell containing the
number in one section and each of the cells with formulas in the other sections.
Then you can change the number in the cell and watch how it affects each of the
formulas.

16.18.1 To split the screen horizontally:


Move the mouse pointer into the vertical scroll bar, on the right-hand side of the
screen, and place it over the small button at the top with the black triangle.
Immediately above this button you will see a thick black line. Move the mouse
pointer over this line and it will turn into a line with two arrows. Hold down the
left mouse button and a grey line will appear, running across the page. Drag the
Pakistan Computer Bureau 176
mouse downwards and this line will follow. Release the mouse button and the
screen will split into two views, each with its own vertical scroll bar. You may
scroll the upper and lower parts independently. Thus you can make changes to the
Beta and A0 values and watch their affects on the calculations in the lower half of
the window. You can also split the window vertically as described below with the
same results, being able to scroll both parts of the window independently. With
both horizontal and vertical splits, you have four independent windows to scroll.

16.18.2 To split the screen vertically:


Move the mouse pointer into the horizontal scroll bar at the bottom of the screen
and place it over the small button on the right with the black triangle. Immediately
to the right of this button you will see a thick black line. Move the mouse pointer
over this line and it will turn into a line with two arrows. Hold down the left
mouse button and a grey line will appear, running up the page. Drag the mouse to
the left and this line will follow. Release the mouse button and the screen will be
split into two views, each with its own horizontal scroll bar.

Note

Splitting the screen horizontally and vertically at the same time will give four views, each
with its own vertical and horizontal scroll bars.

16.18.3 Removing split views


• Double-click on each split line, or
• Click on and drag the split lines back to their places at the ends of the scroll
bars, or
• Select Window > Split. This will remove all split lines at the same time.

16.19 Entering data into a sheet


16.19.1 Entering numbers
Select the cell and type in the number using either the top row of the keyboard or
the numeric keypad. To enter a negative number, either type a minus sign in front
of it or enclose it in brackets ( ). By default numbers are right-aligned and negative
numbers have a leading minus symbol.

16.19.2 Entering text


Select the cell and type the text. Text is left-aligned by default.

16.19.2.1 Entering numbers as text


If a number is entered in the format 01481, Calc will drop the leading 0.To
preserve the leading zero, in the case of telephone area codes for example, precede

Pakistan Computer Bureau 177


the number with an apostrophe, like this: '01481.However, the data is now
regarded as text by Calc. Arithmetic operations will not work on it. It will either
be ignored or will produce an error of some kind.

TIP

Numbers can have leading zeros and be regarded as numerical entries if the the cell is
formatted appropriately. Right-click on the cell and chose the Format Cells > Numbers.
Adjusting the leading zeros setting can add leading zeros to numbers.

16.19.3 Entering dates and times


Select the cell and type the date or time. You can separate the date elements with a
slant (/) or a hyphen or use text such as 10 Oct 03. Calc recognizes a variety of
date formats. You can separate time elements with colons such as 10:43:45.

16.19.4 Entering data into Calc


Entering data into OpenOffice.org (OOo) Calc is a simple process, accomplished
using the keyboard. Whichever cell is selected in your spreadsheet is where the
data will be input. Navigating through the spreadsheet can be done by using either
the keyboard or the mouse.

16.19.5 Inputting data


Most data entry in Calc can be accomplished using the keyboard. You can enter
both text and numbers using either the main keyboard area or the number pad.
Each cell can contain an independent piece of data.
16.20 Moving between cells
There are three ways to navigate between cells in Calc.

16.20.1 Using the mouse


To move the focus using the mouse, simply move the mouse pointer to the cell
where the focus should be and click the left mouse button. This changes the focus
to the new cell. This method is most useful when the two cells are a large distance
apart.
16.20.2 Using the arrow keys
The arrow keys on the keyboard can move the focus one cell at a time left, right,
down, or up.

16.20.3 Using the Enter key


You can customize the direction the Enter key moves the focus, by selecting Tools
> Options > OpenOffice.org Calc > General. The four choices for the direction of
the Enter key are shown on the right side of Figure 20. It can move data down,
right, up, or left. Depending on the file being used or on the type of data being
Pakistan Computer Bureau 178
entered, different directions can be useful. In addition to this, the Enter key doesn’t
have to make the focus move at all. It can also be used to switch into and out of
editing mode. Use the checkboxes under Input settings in Figure 20 to change the
Enter key settings.

16.21 Multiple lines of text


Multiple lines of text can be entered into a single cell, in two ways. Each method
is useful for different situations.

16.22 Wrapping text


Text in cells can be set to wrap at the end of the cell. This option can be set by
right-clicking on a cell and selecting Format Cells. Click on the Alignment tab
near the bottom of the dialog, under Properties, is a checkbox labeled Wrap text
automatically. Selecting this checkbox will cause a line break to appear when the
text gets to the end of the cell.

16.23 Line breaks


Multiple lines of text can also be entered by using manual line breaks. When a
manual line break is entered, the cell width does not change. To insert a manual
line break, press Ctrl + Enter while typing.

16.24 Shrinking to fit cell


The font size of the data in a cell can automatically adjust to fit in a cell. To do
this, check the Shrink to fit cell checkbox in the Format Cells dialog.

16.25 Editing data in Calc


Editing data is done is almost the same way it is entered. The first step to editing
data is selecting the cell containing the data to be edited. To select the appropriate
cell, use one of the above methods. Once the cell is selected, the text in it can be
edited.

16.26 Removing Data


16.26.1 Removing data from a cell
Data can be removed (deleted) from a cell in several ways.
• Removing data only
• The data alone can be removed from a cell without removing any of the
formatting of the cell, by pressing the Backspace key.

16.26.2 Removing data and formatting


The data and the formatting can be removed from a cell at the same time. Pressing
the Delete key brings up a Delete Contents dialog. From this dialog, the different

Pakistan Computer Bureau 179


aspects of the cell can be deleted. To delete everything in a cell (contents and
format) check Delete all.

• Replacing all the data in a cell


• To remove data and insert new data, simply type over the old data. The new
data will retain the original formatting.

16.27 Changing part of the data in a cell


Sometimes it is necessary to change the contents of cell without removing all of
the contents, for example if the phrase See Dick run is in a cell and it needs to be
changed to See Dick run fast. It is often useful to do this without deleting the old
cell contents first. The process is the similar to the one described above, but you
need to place the cursor inside the cell. You can do this in two ways.

16.27.1 Keyboard shortcut


After selecting the appropriate cell, press the F2key and the cursor is placed at the
end of the cell. Then use the keyboard arrows to move the cursor through the text
in the cell.

16.27.2 Mouse
Using the mouse, select the appropriate cell to edit. Once the cell is selected, move
the mouse pointer up to the input line and click into it to place the cursor for
editing. You can either edit the data from the input line or, once the cursor is in the
input line, click the mouse in the original cell for editing.

16.28 Formatting data in Calc


The data in Calc can be formatting in several different ways. It can either be edited
as part of a cell style so that it is automatically applied, or it can be applied

manually to the cell. To access the options to format a cell, select the appropriate
cell or cells, right-click on it, and select Format Cells. All of the format options are
discussed below.

Note

All the settings that will be discussed below can also be set as a part of the style using the
Styles and Formatting window

16.28.1 Numbers
On the Number stab, the behavior of the data in the cell can be controlled: Any of
the data types in the Category list can be applied to the data. The number of

Pakistan Computer Bureau 180


decimal places and leading zeros can be controlled. A custom format code can also
be entered. Using the language setting in this menu controls the local settings for
the different formats such as the date order and the currency marker.

16.28.2 Font
The font for the cell can be chosen on the Font tab. The display on the bottom
shows a preview of the cell. Here you can also set the language of the cell. The
language setting is useful, because it allows different languages to exist in the
same document and be spell checked correctly.

16.28.3 Font effects


The Font Effects tab offers more font options.

16.29 Charts and Graphs


Charts and graphs can be powerful ways to convey information to the reader.
OpenOffice.org Calc offers a variety of different chart and graph formats for your
data. Calc allows you to customize charts and graphs to a considerable extent.
Many of these options enable you to present your information in the best and
clearest manner.

16.29.1 Creating a chart


We will use the small table of data in Figure 38 to demonstrate what we can do
with Calc's charting and graphing capabilities. To create a chart, first highlight
(select) the data to be included in the chart. Next, open the AutoFormat Chart
dialog using one of two methods. Click on a cell in the area of the spreadsheet
where you want the chart to appear, and then select Insert > Chart from the menu
bar. Or, click on the Chart icon on the main toolbar and then click in a cell in the
area of the spreadsheet where you wish the chart to be. Either method will bring
up the Auto format Chart dialog.

16.30 Data range and labels


The data range includes the numbers that we wish to chart. The checked boxes
indicate that Calc has recognized that the entries in the first column and the first
row are not numbers and it is suggesting that we may want to use them to supply
labels (names). We will accept the suggestion. The labels in the First column will
be used to label the x-axis and the labels in the first row will be used in the
Legend. If we did not want to use these labels we could uncheck the boxes and
Calc would just ignore the column and the row in creating the chart. To select the
type of chart or graph required, click Next.

Pakistan Computer Bureau 181


Note

If the AutoFormat Chart dialog was opened from the Insert menu, the Chart results in
worksheet option is available. From this list box you can select the sheet on which the
new chart will reside. Opening the dialog from the toolbars requires you to select a
location for the new chart before it is opened, so this list box is not available. Since the
data range is specified in Absolute references no matter where the new chart is placed in
the current spreadsheet, it will update as the data change in the source ranges.

Calc offers a choice of 13 different main chart types, a mixture of 2-dimensional


and faux 3-dimensional types. Only 8 of the 13 types are shown; scroll down to
see the other selections. On the Choose a chart type page, select one by clicking on
its icon. To view a preview of the chart that displays the title, labels and legend,
select the Show text elements in preview checkbox at the left of the dialog. This
preview will update every time you select a different type of chart, and provides
you with a good idea of what your finished chart will look like.

The current selection, shown with a border around it, is the Columns chart. The
selected chart’s name is shown just below the icons. For the moment, we will stick
with the Columns chart and click on Next again. This takes us to the Choose a
Variant page (not shown here) where we have a choice of five different types of
column chart. Again we need to scroll down to see all the choices. We will stay
with the suggested format, Normal, and click on Next again.

16.31 Chart, Axis Titles and Legend


We can set titles for the chart and the axes on this page. Since the option box for
Chart Title is already checked, type in a new title Equipment Rentals. Accept the
Legend option. The default for the axes is No Label, shown by the unchecked
boxes and the grayed out text. Check the option boxes and add the x-axis label
Months and the y-axis label Volume. Strangely enough, this page also allows us to
change the way we are plotting the data by letting us use the rows as data series
rather than the columns. Next click on Create to get a column chart complete with
title and and axes labels and the default legend.

16.32 A simple scatter plot


• To begin we will construct a a simple scatter plot:
• Select (highlight) the data to be graphed.
• Insert > Chart > Next.
• Select the XY chart > Next.
• Accept the symbols only selection > Next.
• Add a title: Weather Conditions.

Pakistan Computer Bureau 182


• Check the box beside the x-axis label to accept the label Wind speed
(km/hr).
• Check the box beside the y axes label and type in a title. Percent Cloud
Cover.
• Uncheck the legend box (we do not need a legend for only one y-variable).
• Click Create.

16.33 Moving and resizing a chart


To move a chart, click and hold down the left mouse button and drag the chart
across the window. (If the chart is in Edit mode, you need to click the very edge of
the chart in order to move it.) To resize the chart, click and hold down the left
mouse button on one of the green handles and drag the mouse. Dragging on a
handle on one of the corners of the chart will increase or decrease the height
and/or width. Hold down the Shiftkey while dragging to increase or decrease the
height and width in proportion. Dragging on a handle on the side of the chart
increases its width and on the top or bottom of the chart increases its height.

16.34 Grid lines and background


The horizontal grid lines are a distraction and the gray background is unnecessary.
To remove them:

• Right-click on the chart and select Edit.


• On the menu bar, select Edit > Grid > Y-Axis Main Grid > Invisible to
remove the grid.
• Select Format > Chart Wall > Area > None to remove the gray background.
This looks better.

16.35 Data labels


While it appears that canoe and boat rentals do not move smoothly together, we do
not have the monthly data to make better use of the information in the graph. We
can add labels to the individual points, that is, we will add the names of the
months to the individual data points To do this:
• Double-click on the graph or Right Click > Edit.
• Select Insert > Data Labels.
• Check the Label Text box.

16.36 Printing a spreadsheet


To print a spreadsheet either to a printer or a file, choose File > Print.
Use the Print dialog to change printer settings and quickly set what to print: the
whole document, specific sheets or a group of selected cells. You can also set the

Pakistan Computer Bureau 183


number of copies, and whether to collate the copies, in this dialog. Click OK to
start printing.

16.37 Print options


You can set printer options for the current document only or for all spreadsheets.
To select options forthe current document, on the Print dialog, click the
Optionsbutton in the bottom left. To set print options permanently, go to Tools >
Options > OpenOffice.org Calc > Print.The dialog boxes for both are very similar.

16.38 Page breaks


While defining a print range can be a powerful tool, it may sometimes be
necessary to manually tweak Calc’s printout. To do this, you can use a manual
break. A manual break helps to ensure that your data prints properly. You can
insert a horizontal page break above, or a vertical page break to the left of, the
active cell.

16.39 Inserting a page break


16.39.1 To insert a page break:
Navigate to the cell where the page break will begin.

• Select Insert > Manual Break.


• Select Row Break or Column Break depending on your need.
The break is now set.

16.39.2 Row break


Selecting Row Breakwill create a page break above the selected cell. For instance,
if the active cell is H15, then the break will be created between rows 14 and 15.

16.39.3 Column break


Selecting Column Breakwill create a page break to the left of the selected cell. For
instance, if the active cell is H15, then the break will be created between columns
G and H.

16.40 Deleting a page break


16.40.1 To remove a page break:
Navigate to a cell that is next to the break you want to remove.

• Select Edit > Delete Manual Break.


• Select Row Break or Column Break depending on your need.

The break is now removed.


Pakistan Computer Bureau 184
Note

Multiple manual row and column breaks can exist on the same page. When you want to
remove them, you have to remove each one individually. This may be confusing at times,
because although there may be a column break set on the page, when you go to Edit >
Manual Break column break may be grayed out. In order to remove the break, you have
to be in the cell next to the break. So, for example if you set the column break while you
are in H15, you can not remove it if you are in cell D15. However, you can remove it
from any cell in column H.

16.41 Headers and footers


Headers and footers are pre-defined pieces of text that are printed at the top or
bottom of a sheet outside of the sheet area. Headers and footers are assigned to a
sheet or to a sheet style. Headers print on the top of a sheet and footers print on the
bottom of a sheet. There are set the same way.

16.41.1 Setting a header or a footer


To set a header or footer:
Navigate to the sheet that you want to set the header or footer for.

• Select Format > Page.


• Select the header (or footer) tab.
• Select the Header on checkbox.

From here you can also set the margins, the spacing, and height for the header or
footer. You can check the AutoFit height box to have the height of the header or
footer automatically adjusts.
16.41.2 Margin
Changing the size of the left or right margin adjusts how far the header or footer is
from the side of the page.

16.42.3 Spacing
Spacing affects how far above or below the sheet the header or footer will print.
So, if spacing is set to 1.00, then there will be 1 inch between the header or footer
and the sheet.

16.42.4 Height
Height affects how big the header or footer will be.

16.42.5 Custom header


Here there are several buttons to add custom elements to the headers.

Pakistan Computer Bureau 185


Opens the Text Attributes dialog
Inserts the file name field
Inserts the sheet name field
Inserts the current page number
Inserts the total number of pages
Inserts the date field
Inserts the time field

16.43 Inserting pictures


Pictures, including corporate logos and photographs of products and people, are
probably the most common type of graphic added to a Calc document. Graphics
can be inserted in three ways:

• From a file
• From the gallery
• From another application by copying and pasting

16.44 Mathematical functions


Syntax Description
ABS(number) Returns the absolute value of the given number.
ACOS(number) Returns the inverse cosine of the given number in radians.
ACOSH(number) Returns the inverse hyperbolic cosine of the given number in
radians.
ACOT(number) Returns the inverse cotangent of the given number in radians.
ACOTH(number) Returns the inverse hyperbolic cotangent of the given number
in radians.
ASIN(number) Returns the inverse sine of the given number in radians.
ASINH(number) Returns the inverse hyperbolic sine of the given number in
radians.
ATAN(number) Returns the inverse tangent of the given number in radians.
ATAN2(number_x; Returns the inverse tangent of the specified x and y
number_y) coordinates. Number_x is the value for the x coordinate.
Number_y is the value for the y coordinate.

Pakistan Computer Bureau 186


Syntax Description
ATANH(number) Returns the inverse hyperbolic tangent of the given number.
(Angle is returned in radians.)
CEILING(number; Rounds the given number to the nearest integer or multiple of
significance; mode) significance. Significance is the value to whose multiple of ten
the value is to be rounded up (.01, .1, 1, 10, etc.). Mode is an
optional value. If it is indicated and non-zero and if the
number and significance are negative, rounding up is carried
out based on that value.
COMBIN(count_1; Returns the number of combinations for a given number of
count_2) objects. Count_1 is the total number of elements. Count_2 is
the selected count from the elements. This is the same as the
nCr function on a calculator.
COMBINA(count_1; Returns the number of combinations for a given number of
count_2) objects (repetition included). Count_1 is the total number of
elements. Count_2 is the selected count from the elements.
CONVERT(value; "text"; Converts a currency value of a European currency into Euros.
"text") Value is the amount in the currency to be converted. Text is
the official abbreviation for the currency in question (for
example, "EUR"). The first Text parameter gives the source
value to be converted; the second Text parameter gives the
destination value. Both text arguments must be within quotes.
COS(number) Returns the cosine of the given number (angle in radians).
COSH(number) Returns the hyperbolic cosine of the given number (angle in
radians).
COT(number) Returns the cotangent of the given number (angle in radians).
COTH(number) Returns the hyperbolic cotangent of the given number (angle
in radians).
COUNTBLANK(range) Returns the number of empty cells. Range is the cell range in
which the empty cells are counted.
COUNTIF(range; criteria) Returns the number of elements that meet certain criteria
within a cell range. Range is the range to which the criteria are
to be applied. Criteria indicates the criteria in the form of a
number, a regular expression, or a character string by which
the cells are counted.
DEGREES(number) Converts the given number in radians to degrees.
EVEN(number) Rounds the given number up to the nearest even integer.

Pakistan Computer Bureau 187


Syntax Description
EXP(number) Returns e raised to the power of the given number.
FACT(number) Returns the factorial of the given number.
FLOOR(number; Rounds the given number down to the nearest multiple of
significance; mode) significance. Significance is the value to whose multiple of ten
the number is to be rounded down (.01, .1, 1, 10, etc.). Mode
is an optional value. If it is indicated and non-zero and if the
number and significance are negative, rounding up is carried
out based on that value.
GCD(numbers) Returns the greatest common divisor of one or more integers.
Numbers is a list of up to 30 numbers whose greatest common
divisor is to be calculated, separated by semi-colons.
*GCD_ADD(numbers) Returns the greatest common divisor of a list of numbers.
Numbers is a list of up to 30 numbers separated by semi-
colons.
INT(number) Rounds the given number down to the nearest integer.
ISEVEN(value) Returns TRUE if the given value is an even integer, or FALSE
if the value is odd. If the value is not an integer, the function
evaluates only the integer part of the value.
ISODD(value) Returns TRUE if the given value is an odd integer, or FALSE
if the value is even. If the value is not an integer, the function
evaluates only the integer part of the value.
LCM(integer_1; Returns the least common multiple of one or more integers.
integer_2; ... integer_30) Integer_1; integer_2;... integer_30 are integers whose lowest
common multiple is to be calculated.
*LCM_ADD(numbers) Numbers is a list of up to 30 numbers separated by semi-
colons. The result is the lowest common multiple of a list of
numbers.
LN(number) Returns the natural logarithm based on the constant e of the
given number.
LOG(number; base) Returns the logarithm of the given number to the specified
base. Base is the base for the logarithm calculation.
LOG10(number) Returns the base-10 logarithm of the given number.
MOD(dividend; divisor) Returns the remainder after a number is divided by a divisor.
Dividend is the number which will be divided by the divisor.
Divisor is the number by which to divide the dividend.

Pakistan Computer Bureau 188


Syntax Description
*MROUND(number; The result is the nearest integer multiple of the number.
multiple)
*MULTINOMIAL Returns the factorial of the sum of the arguments divided by
(number(s)) the product of the factorials of the arguments. Number(s) is a
list of up to 30 numbers separated by semi-colons.
ODD(number) Rounds the given number up to the nearest odd integer.
PI() Returns the value of PI to fourteen decimal places.
POWER(base; power) Returns the result of a number raised to a power. Base is the
number that is to be raised to the given power. Power is the
exponent by which the base is to be raised.
PRODUCT(number 1 to Multiplies all the numbers given as arguments and returns the
30) product. Number 1 to number 30 are up to 30 arguments
whose product is to be calculated, separated by semi-colons.
*QUOTIENT(numerator; Returns the integer result of a division operation. Numerator is
denominator) the number that will be divided. Denominator is the number
the numerator will be divided by.
RADIANS(number) Converts the given number in degrees to radians.
RAND() Returns a random number between 0 and 1. This number will
recalculate every time data is entered or F9 is pressed.
*RANDBETWEEN Returns an integer random number between bottom and top
(bottom; top) (inclusive). This number will recalculate when the
Control+Shift+F9 key combination is pressed.
ROUND(number; count) Rounds the given number to a certain number of decimal
places according to valid mathematical criteria. Count
(optional) is the number of the places to which the value is to
be rounded. If the count parameter is negative, only the whole
number portion is rounded. It is rounded to the place indicated
by the count.
ROUNDDOWN(number; Rounds the given number. Count (optional) is the number of
count) digits to be rounded down to. If the count parameter is
negative, only the whole number portion is rounded. It is
rounded to the place indicated by the count.
ROUNDUP(number; Rounds the given number up. Count (optional) is the number
count) of digits to which rounding up is to be done. If the count
parameter is negative, only the whole number portion is
rounded. It is rounded to the place indicated by the count.

Pakistan Computer Bureau 189


Syntax Description
*SERIESSUM(x; n; m; Returns a sum of powers of the number x in accordance with
coefficients) the following formula:
SERIESSUM(x;n;m;coefficients) = coefficient_1*x^n +
coefficient_2*x^(n+m) + coefficient_3*x^(n+2m) +...+
coefficient_i*x^(n+(i-1)m).
x is the number as an independent variable. n is the starting
power. m is the increment. Coefficients is a series of
coefficients. For each coefficient the series sum is extended by
one section. You can only enter coefficients using cell
references.
SIGN(number) Returns the sign of the given number. The function returns the
result 1 for a positive sign, –1 for a negative sign, and 0 for
zero.
SIN(number) Returns the sine of the given number (angle in radians).
SINH(number) Returns the hyperbolic sine of the given number (angle in
radians).
SQRT(number) Returns the positive square root of the given number. The
value of the number must be positive.
*SQRTPI(number) Returns the square root of the product of the given number and
PI.
SUBTOTAL(function; Calculates subtotals. If a range already contains subtotals,
range) these are not used for further calculations. Function is a value
that stands for another function such as Average, Count, Min,
Sum, Var. Range is the range whose cells are included.
SUM(number_1; Adds all the numbers in a range of cells. Number_1;
number_2; ... number_30) number_2;... number_30 are up to 30 arguments whose sum is
to be calculated. You can also enter a range using cell
references.
SUMIF(range; criteria; Adds the cells specified by a given criteria. The search
sum_range) supports regular expressions. Range is the range to which the
criteria are to be applied. Criteria is the cell in which the
search criterion is shown, or the search criterion itself.
Sum_range is the range from which values are summed; if it
has not been indicated, the values found in the Range are
summed.
SUMSQ(number_1; Calculates the sum of the squares of numbers (totaling up of
number_2; ... number_30) the squares of the arguments) Number_1; number_2;...
number_30 are up to 30 arguments, the sum of whose squares

Pakistan Computer Bureau 190


Syntax Description
is to be calculated.
TAN(number) Returns the tangent of the given number (angle in radians).
TANH(number) Returns the hyperbolic tangent of the given number (angle in
radians).
TRUNC(number; count) Truncates a number to an integer by removing the fractional
part of the number according to the precision specified in
Tools > Options > OpenOffice.org Calc > Calculate. Number
is the number whose decimal places are to be cut off. Count is
the number of decimal places which are not cut off.

16.45 Statistical analysis functions


Calc includes over 70 statistical functions which enable the evaluation of data
from simple arithmetic calculations, such as averaging, to advanced distribution
and probability computations. Several other statistics-based functions are available
through the Add-ins which is noted at the end of this appendix.
Syntax Description
AVEDEV(number1; Returns the average of the absolute deviations of data points
number2; ... number_30) from their mean. Displays the diffusion in a data set.
Number_1; number_2; ... number_30 are values or ranges
that represent a sample. Each number can also be replaced
by a reference.
AVERAGE(number_1; Returns the average of the arguments. Number_1;
number_2; ... number_30) number_2; ... number_30 are numerical values or ranges.
Text is ignored.
AVERAGEA(value_1; Returns the average of the arguments. The value of a text is
value_2; ... value_30) 0. Value_1; value_2; ... value_30 are values or ranges.
B(trials; SP; T_1; T_2) Returns the probability of a sample with binomial
distribution. Trials is the number of independent trials. SP is
the probability of success on each trial. T_1 defines the
lower limit for the number of trials. T_2 (optional) defines
the upper limit for the number of trials.
BETADIST(number; alpha; Returns the cumulative beta probability density function.
beta; start; end) Number is the value between Start and End at which to
evaluate the function. Alpha is a parameter to the
distribution. Beta is a parameter to the distribution. Start
(optional) is the lower bound for number. End (optional) is
the upper bound for number.

Pakistan Computer Bureau 191


Syntax Description
BETAINV(number; alpha; Returns the inverse of the cumulative beta probability
beta; start; end) density function. Number is the value between Start and End
at which to evaluate the function. Alpha is a parameter to the
distribution. Beta is a parameter to the distribution. Start
(optional) is the lower bound for number. End (optional) is
the upper bound for number
BINOMDIST(X; trials; SP; Returns the individual term binomial distribution
C) probability. X is the number of successes in a set of trials.
Trials is the number of independent trials. SP is the
probability of success on each trial. C = 0 calculates the
probability of a single event and C = 1 calculates the
cumulative probability.
CHIDIST(number; Returns the probability value that a hypothesis will be
degrees_freedom) confirmed from the indicated chi square. The probability
determined by CHIDIST can also be determined by
CHITEST. Number is the chi-square value of the random
sample used to determine the error probability.
Degrees_freedom is the degrees of freedom of the
experiment.
CHIINV(number; Returns the inverse of the one-tailed probability of the chi-
degrees_freedom) squared distribution. Number is the value of the error
probability. Degrees_freedom is the degrees of freedom of
the experiment.
CHITEST(data_B; data_E) Returns the chi-square distribution from a random
distribution of two test series based on the chi-square test for
independence. The probability determined by CHITEST can
also be determined with CHIDIST, in which case the chi
square of the random sample must then be passed as a
parameter instead of the data row. Data_B is the array of the
observations. Data_E is the range of the expected values.
CONFIDENCE(alpha; Returns the (1-alpha) confidence interval for a normal
STDEV; size) distribution. Alpha is the level of the confidence interval.
STDEV is the standard deviation for the total population.
Size is the size of the total population.
CORREL(data_1; data_2) Returns the correlation coefficient between two data sets.
Data_1 is the first data set. Data_2 is the second data set.
COUNT(value_1; value_2; Counts how many numbers are in the list of arguments. Text
... value_30) entries are ignored. Value_1; value_2; ... value_30 are
values or ranges which are to be counted.

Pakistan Computer Bureau 192


Syntax Description
COUNTA(value_1; value_2; Counts how many values are in the list of arguments. Text
... value_30) entries are also counted, even when they contain an empty
string of length 0. If an argument is an array or reference,
empty cells within the array or reference are ignored.
value_1; value_2; ... value_30 are up to 30 arguments
representing the values to be counted.
COVAR(data_1; data_2) Returns the covariance of the product of paired deviations.
Data_1 is the first data set. Data_2 is the second data set.
CRITBINOM(trials; SP; Returns the smallest value for which the cumulative
alpha) binomial distribution is less than or equal to a criterion
value. Trials is the total number of trials. SP is the
probability of success for one trial. Alpha is the threshold
probability to be reached or exceeded.
DEVSQ(number_1; Returns the sum of squares of deviations based on a sample
number_2; ... number_30) mean. Number_1; number_2; ... number_30 are numerical
values or ranges representing a sample.
EXPONDIST(number; Returns the exponential distribution. Number is the value of
lambda; C) the function. Lambda is the parameter value. C is a logical
value that determines the form of the function. C = 0
calculates the density function, and C = 1 calculates the
distribution.
FDIST(number; Calculates the values of an F probability distribution.
degrees_freedom_1; Number is the value for which the F distribution is to be
degrees_freedom_2) calculated. Degrees_freedom_1 is the degrees of freedom in
the numerator in the F distribution. Degrees_freedom_2 is
the degrees of freedom in the denominator in the F
distribution.
FINV(number; Returns the inverse of the F probability distribution. Number
degrees_freedom_1; is probability value for which the inverse F distribution is to
degrees_freedom_2) be calculated. Degrees_freedom_1 is the number of degrees
of freedom in the numerator of the F distribution.
Degrees_freedom_2 is the number of degrees of freedom in
the denominator of the F distribution.
FISHER(number) Returns the Fisher transformation for the given number and
creates a function close to a normal distribution.
FISHERINV(number) Returns the inverse of the Fisher transformation for the
given number and creates a function close to a normal
distribution.

Pakistan Computer Bureau 193


Syntax Description
FORECAST(value; data_Y; Extrapolates future values based on existing x and y values.
data_X) Value is the x value, for which the y value of the linear
regression is to be returned. Data_Y is the array or range of
known y’s. Data_X is the array or range of known
x’s. Does not work for exponential functions.
FTEST(data_1; data_2) Returns the result of an F test. Data_1 is the first record
array. Data_2 is the second record array.
GAMMADIST(number; Returns the values of a Gamma cumulative distribution.
alpha; beta; C) Number is the value for which the Gamma distribution is to
be calculated. Alpha is the parameter Alpha of the Gamma
distribution. Beta is the parameter Beta of the Gamma
distribution. C = 0 calculates the density function, and C = 1
calculates the distribution.
GAMMAINV(number; Returns the inverse of the Gamma cumulative distribution.
alpha; beta) This function allows you to search for variables with
different distribution. Number is the probability value for
which the inverse Gamma distribution is to be calculated.
Alpha is the parameter Alpha of the Gamma distribution.
Beta is the parameter Beta of the Gamma distribution.
GAMMALN(number) Returns the natural logarithm of the Gamma function, G(x),
for the given number.
GAUSS(number) Returns the standard normal cumulative distribution for the
given number.
GEOMEAN(number_1; Returns the geometric mean of a sample. Number_1;
number_2; ... number_30) number_2; ... number_30 are numerical arguments or ranges
that represent a random sample.
HARMEAN(number_1; Returns the harmonic mean of a data set. Number_1;
number_2; ... number_30) number_2; ... number_30 are values or ranges that can be
used to calculate the harmonic mean.
HYPGEOMDIST(X; Returns the hypergeometric distribution. X is the number of
n_sample; successes; results achieved in the random sample. N_sample is the size
n_population) of the random sample. Successes is the number of possible
results in the total population. N_population is the size of
the total population.
INTERCEPT(data_Y; Calculates the y-value at which a line will intersect the y-
data_X) axis by using known x-values and y-values. Data_Y is the
dependent set of observations or data. Data_X is the
independent set of observations or data. Names, arrays or

Pakistan Computer Bureau 194


Syntax Description
references containing numbers must be used here. Numbers
can also be entered directly.
KURT(number_1; Returns the kurtosis of a data set (at least 4 values required).
number_2; ... number_30) Number_1; number_2; ... number_30 are numerical
arguments or ranges representing a random sample of
distribution.
LARGE(data; rank_c) Returns the Rank_c-th largest value in a data set. Data is the
cell range of data. Rank_c is the ranking of the value (2nd
largest, 3rd largest, etc.) written as an integer.
LOGINV(number; mean; Returns the inverse of the lognormal distribution for the
STDEV) given Number, a probability value. Mean is the arithmetic
mean of the standard logarithmic distribution. STDEV is the
standard deviation of the standard logarithmic distribution.
LOGNORMDIST(number; Returns the cumulative lognormal distribution for the given
mean; STDEV) Number, a probability value. Mean is the mean value of the
standard logarithmic distribution. STDEV is the standard
deviation of the standard logarithmic distribution.
MAX(number_1; number_2; Returns the maximum value in a list of arguments.
... number_30) Number_1; number_2; ... number_30 are numerical values
or ranges.
MAXA(value_1; value_2; ... Returns the maximum value in a list of arguments. Unlike
value_30) MAX, text can be entered. The value of the text is 0.
Value_1; value_2; ... value_30 are values or ranges.
MEDIAN(number_1; Returns the median of a set of numbers. Number_1;
number_2; ... number_30) number_2; ... number_30 are values or ranges, which
represent a sample. Each number can also be replaced by a
reference.
MIN(number_1; number_2; Returns the minimum value in a list of arguments.
... number_30) Number_1; number_2; ... number_30 are numerical values
or ranges.
MINA(value_1; value_2; ... Returns the minimum value in a list of arguments. Here text
value_30) can also be entered. The value of the text is 0. Value_1;
value_2; ... value_30 are values or ranges.
MODE(number_1; Returns the most common value in a data set. Number_1;
number_2; ... number_30) number_2; ... number_30 are numerical values or ranges. If
several values have the same frequency, it returns the
smallest value. An error occurs when a value does not

Pakistan Computer Bureau 195


Syntax Description
appear twice.
NEGBINOMDIST(X; R; Returns the negative binomial distribution. X is the value
SP) returned for unsuccessful tests. R is the value returned for
successful tests. SP is the probability of the success of an
attempt.
NORMDIST(number; mean; Returns the normal distribution for the given Number in the
STDEV; C) distribution. Mean is the mean value of the distribution.
STDEV is the standard deviation of the distribution. C = 0
calculates the density function, and C = 1 calculates the
distribution.
NORMINV(number; mean; Returns the inverse of the normal distribution for the given
STDEV) Number in the distribution. Mean is the mean value in the
normal distribution. STDEV is the standard deviation of the
normal distribution.
NORMSDIST(number) Returns the standard normal cumulative distribution for the
given Number.
NORMSINV(number) Returns the inverse of the standard normal distribution for
the given Number, a probability value.
PEARSON(data_1; data_2) Returns the Pearson product moment correlation coefficient
r. Data_1 is the array of the first data set. Data_2 is the array
of the second data set.
PERCENTILE(data; alpha) Returns the alpha-percentile of data values in an array. Data
is the array of data. Alpha is the percentage of the scale
between 0 and 1.
PERCENTRANK(data; Returns the percentage rank (percentile) of the given value
value) in a sample. Data is the array of data in the sample.
PERMUT(count_1; count_2) Returns the number of permutations for a given number of
objects. Count_1 is the total number of objects. Count_2 is
the number of objects in each permutation.
PERMUTATIONA(count_1; Returns the number of permutations for a given number of
count_2) objects (repetition allowed). Count_1 is the total number of
objects. Count_2 is the number of objects in each
permutation.
PHI(number) Returns the values of the distribution function for a standard
normal distribution for the given Number.
POISSON(number; mean; Returns the Poisson distribution for the given Number.

Pakistan Computer Bureau 196


Syntax Description
C) Mean is the middle value of the Poisson distribution. C = 0
calculates the density function, and C = 1 calculates the
distribution.
PROB(data; probability: Returns the probability that values in a range are between
start; end) two limits. Data is the array or range of data in the sample.
Probability is the array or range of the corresponding
probabilities. Start is the start value of the interval whose
probabilities are to be summed. End (optional) is the end
value of the interval whose probabilities are to be summed.
If this parameter is missing, the probability for the Start
value is calculated.
QUARTILE(data; type) Returns the quartile of a data set. Data is the array of data in
the sample. Type is the type of quartile. (0 = Min, 1 = 25%,
2 = 50% (Median), 3 = 75% and 4 = Max.)
RANK(value; data; type) Returns the rank of the given Value in a sample. Data is the
array or range of data in the sample. Type (optional) is the
sequence order, either ascending (0) or descending (1).
RSQ(data_Y; data_X) Returns the square of the Pearson correlation coefficient
based on the given values. Data_Y is an array or range of
data points. Data_X is an array or range of data points.
SKEW(number_1; Returns the skewness of a distribution. Number_1;
number_2; ... number_30) number_2; ... number_30 are numerical values or ranges.
SLOPE(data_Y; data_X) Returns the slope of the linear regression line. Data_Y is the
array or matrix of Y data. Data_X is the array or matrix of X
data.
SMALL(data; rank_c) Returns the Rank_c-th smallest value in a data set. Data is
the cell range of data. Rank_c is the rank of the value (2nd
smallest, 3rd smallest, etc.) written as an integer.
STANDARDIZE(number; Converts a random variable to a normalized value. Number
mean; STDEV) is the value to be standardized. Mean is the arithmetic mean
of the distribution. STDEV is the standard deviation of the
distribution.
STDEV(number_1; Estimates the standard deviation based on a sample.
number_2; ... number_30) Number_1; number_2; ... number_30 are numerical values
or ranges representing a sample based on an entire
population.
STDEVA(value_1; value_2; Calculates the standard deviation of an estimation based on

Pakistan Computer Bureau 197


Syntax Description
... value_30) a sample. Value_1; value_2; ... value_30 are values or
ranges representing a sample derived from an entire
population. Text has the value 0.
STDEVP(number_1; Calculates the standard deviation based on the entire
number_2; ... number_30) population. Number_1; number_2; ... number_30 are
numerical values or ranges representing a sample based on
an entire population.
STDEVPA(value_1; Calculates the standard deviation based on the entire
value_2; ... value_30) population. Value_1; value_2; ... value_30 are values or
ranges representing a sample derived from an entire
population. Text has the value 0.
STEYX(data_Y; data_X) Returns the standard error of the predicted y value for each x
in the regression. Data_Y is the array or matrix of Y data.
Data_X is the array or matrix of X data.
TDIST(number; Returns the t-distribution for the given Number.
degrees_freedom; mode) Degrees_freedom is the number of degrees of freedom for
the t-distribution. Mode = 1 returns the one-tailed test, Mode
= 2 returns the two-tailed test.
TINV(number; Returns the inverse of the t-distribution, for the given
degrees_freedom) Number associated with the two-tailed t-distribution.
Degrees_freedom is the number of degrees of freedom for
the t-distribution.
TRIMMEAN(data; alpha) Returns the mean of a data set without the Alpha proportion
of data at the margins. Data is the array of data in the
sample. Alpha is the proportion of the marginal data that
will not be taken into consideration.
TTEST(data_1; data_2; Returns the probability associated with a Student’s t-
mode; type) Test. Data_1 is the dependent array or range of data for the
first record. Data_2 is the dependent array or range of data
for the second record. Mode = 1 calculates the one-tailed
test, Mode = 2 the two- tailed test. Type of t-test to perform:
paired (1), equal variance (homoscedastic) (2), or unequal
variance (heteroscedastic) (3).
VAR(number_1; number_2; Estimates the variance based on a sample. Number_1;
... number_30) number_2; ... number_30 are numerical values or ranges
representing a sample based on an entire population.
VARA(value_1; value_2; ... Estimates a variance based on a sample. The value of text is
value_30) 0. Value_1; value_2; ... value_30 are values or ranges

Pakistan Computer Bureau 198


Syntax Description
representing a sample derived from an entire population.
Text has the value 0.
VARP(Number_1; Calculates a variance based on the entire population.
number_2; ... number_30) Number_1; number_2; ... number_30 are numerical values
or ranges representing an entire population.
VARPA(value_1; value_2; .. Calculates the variance based on the entire population. The
.value_30) value of text is 0. Value_1; value_2; ... value_30 are values
or ranges representing an entire population.
WEIBULL(number; alpha; Returns the values of the Weibull distribution for the given
beta; C) Number. Alpha is the Alpha parameter of the Weibull
distribution. Beta is the Beta parameter of the Weibull
distribution. C indicates the type of function: C= 0 the form
of the function is calculated, C=1 the distribution is
calculated.
ZTEST(data; number; Returns the two-tailed P value of a z test with standard
sigma) distribution. Data is the array of the data. Number is the
value to be tested. Sigma (optional) is the standard deviation
of the total population. If this argument is missing, the
standard deviation of the sample is processed.

16.46 Date and time functions


Use these functions for inserting, editing and manipulating dates and times.
OpenOffice.org handles and computes a date/time value as a number. When you
assign the number format Number to a date or time value, it is displayed as a
number. For example, 01/01/2000 12:00 PM, converts to 36526.5. This is just a
matter of formatting; the actual value is always stored and manipulated as a
number. To see the date or time displayed in a standard format, change the number
format (date or time) accordingly. To set the default date format used by Calc. go
to Tools > Options > OpenOffice.org Calc > Calculate.

Caution

When entering dates, slashes or dashes used as date separators may be interpreted as
arithmetic operators. To keep dates from being interpreted as parts of formulas, and thus
returning erroneous results, always place them in quotation marks, for example,
"12/08/52".

Pakistan Computer Bureau 199


Syntax Description
DATE(year; month; day) Converts a date written as year, month, day to an internal
serial number and displays it in the cell’s formatting. Year is
an integer between 1583 and 9956 or 0 and 99. Month is an
integer between 1 and 12. Day is an integer between 1 and
31.
DATEVALUE("Text") Returns the internal date number for text in quotes. Text is a
valid date expression and must be entered with quotation
marks.
DAY(number) Returns the day, as an integer, of the given date value. A
negative date/time value can be entered. Number is a time
value.
DAYS(date_2; date_1) Calculates the difference, in days, between two date values.
Date_1 is the start date. Date_2 is the end date. If Date_2 is
an earlier date than Date_1, the result is a negative number.
DAYS360(date_1; date_2; Returns the difference between two dates based on the 360
type) day year used in interest calculations. If Date_2 is earlier
than Date_1, the function will return a negative number.
Type (optional) determines the type of difference calculation:
the US method (0) or the European method (≠0).
*DAYSINMONTH(date) Calculates the number of days in the month of the given date.
*DAYSINYEAR(date) Calculates the number of days in the year of the given date.
EASTERSUNDAY(integer) Returns the date of Easter Sunday for the entered year. Year
is an integer between 1583 and 9956 or 0 and 99.
*EDATE(start_date; The result is a date a number of Months away from the given
months) Start_date. Only months are considered; days are not used for
calculation. Months is the number of months.
*EOMONTH(start_date; Returns the date of the last day of a month which falls
months) Months away from the given Start_date. Months is the
number of months before (negative) or after (positive) the
start date.
HOUR(number) Returns the hour, as an integer, for the given time value.
Number is a time value.
*ISLEAPYEAR(date) Determines whether a given date falls within a leap year.
Returns either 1 (TRUE) or 0 (FALSE).
MINUTE(number) Returns the minute, as an integer, for the given time value.
Number is a time value.

Pakistan Computer Bureau 200


Syntax Description
MONTH(number) Returns the month, as an integer, for the given date value.
Number is a time value.
*MONTHS(start_date; Calculates the difference, in months, between two date
end_date; type) values. Date_1 is the start (earlier) date. Date_2 is the end
date. Type is one of two possible values, 0 (interval) or 1 (in
calendar months). If Date_2 is an earlier date than Date_1,
the result is a negative number.
*NETWORKDAYS(start Returns the number of workdays between start_date and
_date; end_date; holidays) end_date. Holidays can be deducted. Start_date is the date
from which the calculation is carried out. End_date is the
date up to which the calculation is carried out. If the start or
end date is a workday, the day is included in the calculation.
Holidays (optional) is a list of holidays. Enter a cell range in
which the holidays are listed individually.
NOW() Returns the computer system date and time. The value is
updated when your document recalculates. NOW is a
function without arguments.
SECOND(number) Returns the second, as an integer, for the given time value.
Number is a time value.
TIME(hour; minute; Returns the current time value from values for hours, minutes
second) and seconds. This function can be used to convert a time
based on these three elements to a decimal time value. Hour,
minute and second must all be integers.
TIMEVALUE(text) Returns the internal time number from a text enclosed by
quotes in a time entry format. The internal number indicated
as a decimal is the result of the date system used under OOo
to calculate date entries.
TODAY() Returns the current computer system date. The value is
updated when your document recalculates. TODAY is a
function without arguments.
WEEKDAY(number; type) Returns the day of the week for the given number (date
value). The day is returned as an integer based on the type.
Type determines the type of calculation: type = 1 (default),
the weekdays are counted starting from Sunday (Monday =
0); type = 2, the weekdays are counted starting from Monday
(Monday = 1); type = 3, the weekdays are counted starting
from Monday (Monday = 0).
WEEKNUM(number; Calculates the number of the calendar week of the year for

Pakistan Computer Bureau 201


Syntax Description
mode) the internal date number. Mode sets the start of the week and
the calculation type: 1 = Sunday, 2 = Monday.
*WEEKNUM_ADD(date; Calculates the calendar week of the year for a Date. Date is
return_type) the date within the calendar week. Return_type sets the start
of the week and the calculation type: 1 = Sunday, 2 =
Monday.
*WEEKS(start_date; Calculates the difference in weeks between two dates,
end_date; type) start_date and end_date. Type is one of two possible values,
0 (interval) or 1 (in numbers of weeks).
*WEEKSINYEAR(date) Calculates the number of weeks in a year until a certain date.
A week that spans two years is added to the year in which
most days of that week occur.
*WORKDAY(start_date; Returns a date number that can be formatted as a date. You
days; holidays) then see the date of a day that is a certain number of
Workdays away from the start_date. Holidays (optional) is a
list of holidays. Enter a cell range in which the holidays are
listed individually.
YEAR(number) Returns the year as a number according to the internal
calculation rules. Number shows the internal date value for
which the year is to be returned.
*YEARFRAC(start_date; Returns a number between 0 and 1, representing the fraction
end_date; basis) of a year between start_date and end_date. Start_date and
end_date are two date values. Basis is chosen from a list of
options and indicates how the year is to be calculated.
*YEARS(tart_date; Calculates the difference in years between two dates: the
end_date; type) start_date and the end_date. Type calculates the type of
difference.

16.47 Logical functions


Use the logical functions to test values and produce results based on the result of
the test. These functions are conditional and provide the ability to write longer
formulas based on input or output.

Syntax Description
AND(logical_value_1; Returns TRUE if all arguments are TRUE. If any element is
logical_value_2; FALSE, this function returns the FALSE value.
...logical_value_30) Logical_value_1; logical_value_2; ...logical_value_30 are

Pakistan Computer Bureau 202


Syntax Description
conditions to be checked. All conditions can be either TRUE
or FALSE. If a range is entered as a parameter, the function
uses the value from the range that is in the current column or
row. The result is TRUE if the logical value in all cells within
the cell range is TRUE
FALSE() Set the logical value to FALSE. The FALSE() function does
not require any arguments.
IF(test; then_value; Specifies a logical test to be performed. Test is any value or
otherwise_value) expression that can be TRUE or FALSE. Then_value
(optional) is the value that is returned if the logical test is
TRUE. Otherwise_value (optional) is the value that is
returned if the logical test is FALSE.
NOT(logical_value) Reverses the logical value. Logical_value is any value to be
reversed.
OR(logical_value_1; Returns TRUE if at least one argument is TRUE. Returns the
logical_value_2; value FALSE if all the arguments have the logical value
...logical_value_30) FALSE.. Logical_value_1; logical_value_2;
...logical_value_30 are conditions to be checked. All
conditions can be either TRUE or FALSE. If a range is
entered as a parameter, the function uses the value from the
range that is in the current column or row.
TRUE() Sets the logical value to TRUE. The TRUE() function does
not require any arguments.

16.48 Informational functions


These functions provide information (or feedback) regarding the results of a test
for a specific condition, or a test for the type of data or content a cell contains.
Syntax Description
CELL(info_type; Returns information on a cell such as its address, formatting
reference) or contents of a cell based on the value of the info_type
argument. Info_type specifies the type of information to be
returned and comes from a predefined list of arguments.
Info_type is not case sensitive, but it must be enclosed within
quotes. Reference is the address of the cell to be examined. If
reference is a range, the cell reference moves to the top left of
the range. If reference is missing, Calc uses the position of
the cell in which this formula is located.
CURRENT() Calculates the current value of a formula at the actual

Pakistan Computer Bureau 203


Syntax Description
position.
FORMULA(reference) Displays the formula of a formula cell at any position. The
formula will be returned as a string in the Reference position.
If no formula cell can be found, or if the presented argument
is not a reference, returns the error value #N/A.
ISBLANK(value) Returns TRUE if the reference to a cell is blank. This
function is used to determine if the content of a cell is empty.
A cell with a formula inside is not empty. If an error occurs,
the function returns a logical or numerical value. Value is the
content to be tested.
ISERR(value) Returns TRUE if the value refers to any error value except
#N/A. You can use this function to control error values in
certain cells. If an error occurs, the function returns a logical
or numerical value. Value is any value or expression in which
a test is performed to determine whether an error value not
equal to #N/A is present.
ISERROR(value) The ISERROR tests if the cells contain general error values.
ISERROR recognizes the #N/A error value. If an error
occurs, the function returns a logical or numerical value.
Value is any value where a test is performed to determine
whether it is an error value.
*ISEVEN_ADD(number) Tests for even numbers. Returns TRUE (1) if the number
returns a whole number when divided by 2.
ISFORMULA(reference) Returns TRUE if a cell is a formula cell. If an error occurs,
the function returns a logical or numerical value. Reference
indicates the reference to a cell in which a test will be
performed to determine if it contains a reference.
ISLOGICAL(value) Returns TRUE if the cell contains a logical number format.
The function is used in order to check for both TRUE and
FALSE values in certain cells. If an error occurs, the function
returns a logical or numerical value. Value is the value to be
tested for logical number format.
ISNA(value) Returns TRUE if a cell contains the #N/A (value not
available) error value. If an error occurs, the function returns
a logical or numerical value. Value is the value or expression
to be tested.
ISNONTEXT(value) Tests if the cell contents are text or numbers, and returns
FALSE if the contents are text. If an error occurs, the

Pakistan Computer Bureau 204


Syntax Description
function returns a logical or numerical value. Value is any
value or expression where a test is performed to determine
whether it is a text or numbers or a Boolean value.
ISNUMBER(value) Returns TRUE if the value refers to a number. If an error
occurs, the function returns a logical or numerical value.
Value is any expression to be tested to determine whether it is
a number or text.
*ISODD_ADD(number) Returns TRUE (1) if the number does not return a whole
number when divided by 2. Number is the number to be
tested.
ISREF(value) Tests if the content of one or several cells is a reference.
Verifies the type of references in a cell or a range of cells. If
an error occurs, the function returns a logical or numerical
value. Value is the value to be tested, to determine whether it
is a reference.
ISTEXT(value) Returns TRUE if the cell contents refer to text. If an error
occurs, the function returns a logical or numerical value.
Value is a value, number, Boolean value, or error value to be
tested.
N(value) Returns the number 1, if the parameter is TRUE. Returns the
parameter, if the parameter is a number. Returns the number
0 for other parameters. If an error occurs, the function returns
a logical or numerical value. Value is the parameter to be
converted into a number.
NA() Returns the error value #N/A.
TYPE(value) Returns the type of value. If an error occurs, the function
returns a logical or numerical value. Value is a specific value
for which the data type is determined. Value 1 = number,
value 2 = text, value 4 = Boolean value, value 8 = formula,
value 16 = error value.

16.49 Database functions


This section deals with functions used with data organized as one row of data for
one record.The Database category should not be confused with the Base database
component in OpenOffice.org. A Calc database is simple a range of cells that
comprises a block of related data where each row contains a separate record. There
is no connection between a database in OpenOffice.org and the Database category
in OOo Calc. The database functions use the following common arguments:

Pakistan Computer Bureau 205


Database is a range of cells which define the database. Database_field specifies
the column where the function operates on after the search criteria of the first
parameter is applied and the data rows are selected. It is not related to the search
criteria itself. The number 0 specifies the whole data range. To reference a column
by using the column header name, place quotation marks around the header name.
Search_criteria is a cell range containing the search criteria.. Empty cells in the
search criteria range will be ignored.

Note

All of the search-criteria arguments for the database functions support regular
expressions. For example, all.* can be entered to find the first location of all followed by
any characters. To search for text that is also a regular expression, precede every
character with a \ character. You can switch the automatic evaluation of regular
expressions on and off in Tools > Options > OpenOffice.org Calc > Calculate.

Syntax Description
DAVERAGE(database; Returns the average of the values of all cells (fields) in all
database_field; rows (database records) that match the specified
search_criteria) search_criteria. The search supports regular expressions.
DCOUNT(database; Counts the number of rows (records) in a database that match
database_field; the specified search_criteria and contain numerical values.
search_criteria) The search supports regular expressions. For the
database_field parameter, enter a cell address to specify the
column, or enter the number 0 for the entire database. The
parameter cannot be empty.
DCOUNTA(database; Counts the number of rows (records) in a database that match
database_field; the specified search_criteria and contain numeric or
search_criteria) alphanumeric values. The search supports regular
expressions.
DGET(database; Returns the contents of the referenced cell in a database
database_field; which matches the specified search_criteria. In case of an
search_criteria) error, the function returns either #VALUE! for no row found,
or Err502 for more than one cell found.
DMAX(database; Returns the maximum content of a cell (field) in a database
database_field; (all records) that matches the specified search_criteria. The
search_criteria) search supports regular expressions.
DMIN(database; Returns the minimum content of a cell (field) in a database
database_field; that matches the specified search_criteria. The search
search_criteria) supports regular expressions.

Pakistan Computer Bureau 206


Syntax Description
DPRODUCT(database; Multiplies all cells of a data range where the cell contents
database_field; match the search_criteria. The search supports regular
search_criteria) expressions.
DSTDEV(database; Calculates the standard deviation of a population based on a
database_field; sample, using the numbers in a database column that match
search_criteria) the search_criteria. The records are treated as a sample of
data. Note that a representative result of a large population
can not be obtained from a sample of fewer than one
thousand.
DSTDEVP(database; Calculates the standard deviation of a population based on all
database_field; cells of a data range which match the search_criteria. The
search_criteria) records from the example are treated as the whole population.
DSUM(database; Returns the total of all cells in a database field in all rows
database_field; (records) that match the specified search_criteria. The search
search_criteria) supports regular expressions.
DVAR(database; Returns the variance of all cells of a database field in all
database_field; records that match the specified search_criteria. The records
search_criteria) from the example are treated as a sample of data. A
representative result of a large population cannot be obtained
from a sample population of fewer than one thousand.
DVARP(database; Calculates the variance of all cell values in a database field in
database_field; all records that match the specified search_criteria. The
search_criteria) records are from the example are treated as an entire
population.

Pakistan Computer Bureau 207


17.1 Introduction to Draw
Draw is a vector graphics drawing tool. It offers a series of powerful tools that
enable you to quickly create all sorts of graphics. It is perfectly integrated into the
OpenOffice.org suite, and this makes exchanging graphics with all modules of the
suite very easy. For example, it is relatively simple to draw an image and reuse it
in the Writer and Impress modules. You can also work directly from within Writer
and Impress, using a subset of the functions and tools from the Draw module.

The Draw module functionality is very extensive and complete. Even though it
was not designed to rival high end graphics applications, it still possesses more
functions than the majority of drawing tools that are integrated into office
productivity suites. A few examples of drawing functions might whet your
appetite: layer management, magnetic grid point system, dimensions and
measurement display, connectors for making organization charts, 3D functions
enabling small three-dimensional drawings to be created (with texture and lighting
effects), drawing and page style integration, and Bezier curves, just to name a few.

17.2 The Workplace


The main components of the Draw interface have the appearance shown in the
figure below.

Pakistan Computer Bureau 208


The major area located in the center of the screen is the one in which your
drawings will be made. It is surrounded by toolbars and information areas, the
number and position of which can vary according to the particular organization
you have chosen for your workplace. The small icons in each toolbar are called
buttons. The picture above illustrates one of many possibilities.

17.3 The Toolbars


The various Draw toolbars can be displayed or hidden according to your needs. To
display or hide the toolbars, simply click on any toolbar with the right mouse
button1. A menu will appear that lets you choose which of the four principal
toolbars to display: the Function Bar, the Main Toolbar, the Object Bar and the
Option Bar. This menu also lets you select the buttons that you wish to appear on
the corresponding toolbar. All you have to do is select the option Visible Buttons,
and then select the desired buttons for that toolbar. Each toolbar has a different list
of buttons. Two additional toolbars, plus a toolbar customizing function, are
available from the Menu Bar by clicking View > Toolbars.

Many toolbar buttons are marked with a small arrow in the upper right corner of
the button. The arrow indicates that this button has additional functions. If you
long-click (left-click and hold), a submenu appears showing its additional
functions.

You may wish to keep this submenu displayed on your screen, but in a different
position than the default location. You can make this submenu into a floating
toolbar by detaching and repositioning it. Click the submenu title bar and drag it to
your desired screen location, then release the mouse button. Most buttons marked
with the small arrow can become floating toolbars. The floating toolbar capability
is common to all modules of the OpenOffice.org suite. The tools available in the
various toolbars are explained in the following paragraphs.

17.3.1 The Function Bar


The Function Bar is displayed as follows:

Pakistan Computer Bureau 209


17.3.2 The Object Bar
The Object Bar gives you a preview, and lets you modify the major characteristics
of the drawing objects that you are handling. The icons displayed will vary as a
function of the object that is selected. Sometimes more than one object bar is
applicable for the selected object; in this case a triangle is displayed at the right
end – click on this triangle to toggle through each of the available object bars.

The available functions enable you to change the color of the line drawn, the fill
color, etc., of the object currently selected. If the selected object is text, the toolbar
will have the following appearance:

17.3.3 The Main Toolbar


This toolbar is the most important in the Draw module. It contains all the
necessary functions to enable drawing of various geometric and freehand shapes
and for their organization on the page.

The toolbar is shown here horizontally, but by default it is placed vertically on the
left-hand side of the workspace. As for other toolbars in OpenOffice.org, the
buttons having a small rightward pointing arrow enable you to gain access to
further functionality. For example, if you click on the icon representing a
rectangle, the following window appears:

It is therefore possible to choose the type of rectangle you want to draw (for
example, straight or rounded, filled or empty, and so on). What's more, if you
choose another option from the icon with the arrow, this new option will be
displayed as the default for all following operations carried out using this button.

17.3.4 The Color Bar


To display the Color Bar, you need to use View > Toolbars > Color Bar. The
toolbar then appears at the bottom of the workspace.

Pakistan Computer Bureau 210


This toolbar lets you rapidly choose the color of the objects in your drawing. The
first box in the panel corresponds to transparency (no color). The color palette that
is shown by default can be changed via the menu Format > Area as shown below.
Choose the tab marked Colors.

If you click on the Load Color List button that is circled, the file selector asks you
to choose a palette file (bearing the file extension .soc). Several palettes are
supplied as standard with OpenOffice.org. For example, web.soc is a color palette
that is particularly adapted to creating drawings that are going to appear in web
pages, because the colors will be correctly displayed on workstations with screens
displaying at least 256 colors. The color selection box also lets you individually
change any color by modifying the numerical values that you can enter in the
Fields provided to the right of the color palette. You can also click on Edit to
display a dialog box making the choice of colors easier. You can use the color
schemes known as CMYK (Cyan, Magenta, Yellow, and Black), RGB (Red,
Green, and Blue) or HSB (Hue, Saturation, and Brightness).
Pakistan Computer Bureau 211
17.3.5 The Option Bar
This toolbar lets you activate or deactivate various mechanisms that make drawing
easier. As opposed to the other toolbars, the Option Bar isn't displayed by default.
In order to display it from the menu bar, click View > Toolbars > Option Bar.
When it is displayed, it can generally be found at the bottom of the screen and
looks like this:

17.3.6 The Rulers


On the upper and left-hand side of the workspace, you should see the rulers. These
indicate the sizes of the objects that have been drawn. The movement of the mouse
in the workspace shows up on the rulers to help you position objects precisely.
The page margins in the drawing area are also represented on the rulers. It is
possible to change the margins directly on the rulers by dragging them with the
mouse. You can also directly modify the units of measurement of the rulers by
clicking on one of the two rulers with the right mouse button:

Pakistan Computer Bureau 212


As you can see from the illustration, the two rulers can have different units. The
rulers are also used to manage handle points and capture lines that make
positioning objects easier.

17.3.7 The Status Bar


The Status Bar is located at the bottom of the screen. We shall look more closely
at the middle part of this area, since it is particularly relevant to the Draw module.
The three areas of interest to us are as follows:

The sizes are given in the current unit (not to be confused with the ruler units).
This unit can be defined via Tools > Options > Draw > General. This dialog box
also lets you change the scale of the page.

17.4 Drawing Basic Shapes


17.4.1 Drawing a segment of a straight line
Click on the Lines and Arrows button on the Main Toolbar. The default line on the
Main Toolbar Lines and Arrows button is an arrow. To change to a line, long-click
the Arrow Style button to see a list of all the different arrow heads and tails
available on line segments.

Pakistan Computer Bureau 213


To draw a straight line segment, click the straight line button and place the mouse
cursor at the point where you wish to start drawing.

Drag the mouse while keeping the button pressed down. Let go of the mouse
button when you want to stop drawing the line. Two blue or green handle points
located at each end of the line will appear, showing that this is the currently
selected object. The handle colors depend on the default select mode (they will be
green for simple selection and blue when in point edit mode).

While drawing the segment, if you hold down the Shift key as well, you will force
the line to be drawn at angle which is a multiple of 45° with respect to the
horizontal. The star in dots shows the angles that are permitted for the straight line
when the Shift key is pressed.

Pakistan Computer Bureau 214


If you replace the Shift key with the Control key [Ctrl], the constraining angle will
be 15°. You can set this angle in the Tools > Options > Drawing > Grid dialog
box.

If you hold down the [Alt] key, the line will be drawn symmetrically with respect
to the start point. This technique lets you draw straight lines by starting from the
middle of the line.

Note:

You must press the left mouse button BEFORE you press the [Alt] key todraw your line.
Pressing the [Alt] key first will cause you to move the program panel instead of drawing
a line.

Pakistan Computer Bureau 215


The line you draw will have the default attributes (color, line type, and arrow
style). You can change the line attributes by activating (clicking) the line. Right-
click and select the line, and then make your attribute changes with the menu
provided. You can reach this same dialog box by clicking the line button on the
object bar.

17.4.2 Drawing a rectangle


Drawing rectangles is similar to drawing straight line segments, except that you
use the Rectangle button from the Main Toolbar.

The line drawn with the mouse shows the diagonal of the rectangle.

If you hold the [Shift] key, you will get a square and the [Alt] key enables you to
draw a rectangle starting from its center.

17.4.3 Drawing a circle


To draw an ellipse or a circle, use the Ellipse button from the Main Toolbar.

Pakistan Computer Bureau 216


The ellipse or circle is defined by a rectangle that is linked to the diagonal drawn
with the mouse. The diameter of the ellipse or circle corresponds to the longest
side of the rectangle.

Extended functions shown by long-clicking the Ellipse button include circles,


ellipses, ellipse and circle pies, segments, arcs, filled and non-filled closed shapes.

There are three other ways to draw an ellipse or circle:


• Shift-circle - forces the ellipse to be a circle.
• Alt-circle - draws a symmetrical ellipse or circle from the center instead of
dragging corner to corner.

Note:

You must press the left mouse button BEFORE you press the [Alt] key to draw your
circle. Pressing the [Alt] key first will cause you to move the program panel instead of
drawing a circle. >>Ctrl-circle - snaps to grid lines.

17.4.4 The Texts


The text mode palette looks like this:

The Text tool lets you write text in the default font, color and size.

Pakistan Computer Bureau 217


If you click on an empty space in the workspace, the text will be written at that
spot. If you click on an object, the text will be written in the center of the object
and will remain within the object, and the border of the object will become the
text's frame. When you've finished typing your text, click inside the frame. If you
wish, you can drop to the following line by pressing the [Enter] key. The text can
be edited at all times by clicking on it.

When you type your text, you will notice that the upper ruler includes the usual
paragraph attributes: indents, first line, tab stops. You can, as in Writer, change the
style of all or part of the characters you enter. The Stylist also works here, so you
can create styles that you can use again in other text frames exactly as you would
with Writer. The text frames can also be manipulated just like any other draw
objects. You can assign them fill colors, shadows etc. You can also rotate the
frame and write the text at any angle. The Fit Text To Frame tool lets you type in
text, but you can also change the size of the resulting text by manipulating the
object's selection handles.

In the example above, the same text has been duplicated, but the selection
rectangle has been changed. In order to make the effect clearer, we have displayed
the border of the rectangle. The Callout tool in the palette is used for creating
captions (callouts or figure labels). In fact it's a tool that puts a frame around text
and provides a connector (an articulated arrow). This tool has been used many
times for the captions in this manual.

17.4.5 Rectangles and Squares


This toolbar palette has 8 tools:

Pakistan Computer Bureau 218


17.4.6 Circles, Ellipses and Arcs

17.4.7 3D Objects
Draw lets you draw three dimensional objects. The 3D object palette offers a
choice of 8 basic primitives that can be used to create more complex objects
through merging or combination.

Pakistan Computer Bureau 219


The creation of a 3D object always works in the same way: click on the associated
button and then draw a rectangle on the work area corresponding to the foreground
area of the object to be drawn. A cube silhouette (boundary box) that will contain
the future object is displayed.

17.4.8 Curves
The curve palette offers 8 tools for drawing non-linear profiles.

These icons represent the basic tools for drawing curves. The resulting
curve can be manipulated by Bezier curves as we have seen previously. The
principle behind the tools is as follows:

Click on the drawing area to position the first point. Keeping the mouse button pressed
down, move the mouse to draw the tangent to the curve that passes through the start
point. Let go of the mouse button and move the mouse to draw the curve.

To finish the shape, double-click on the left mouse button. This operation can be
repeated immediately starting from the newly created end point. The shape you
create will be filled or empty depending on the button you pressed. Where the
shape is filled, a segment will be drawn from the start point to the end point. The
object that results can be manipulated like any other, but you can also play with
the tangents of the object in edit points mode.

Pakistan Computer Bureau 220


This tool lets you create polygons. A polygon is a series of straight segments.

The way it works is fairly simple: just click on the workspace to set the first point,
move the mouse to the next position where you want to set a second point and
click, and a segment will be drawn between the two. The polygon is drawn by
repeating this procedure until all of the points have been drawn. When you have
finished, double-click on the mouse to release the polygon from edit mode. If you
chose to create a closed shape, a segment will link the start point to the end of the
last segment that you have drawn.

This tool is similar to the previous one, but various segments will all have
angles that are a multiple of 45° in relation to a horizontal axis. The shape drawn
will be open or filled depending on the button chosen.

When you click on these buttons, you can draw a freehand line. The
principle behind this is as follows: move the mouse and at the same time hold
down the left mouse button. The movement of the mouse as shown on screen will
become the curve that is drawn. OpenOffice.org actually draws a curve composed
of several control points. You can check this by switching into edit points mode.
Here again, depending on the icon chosen, you can draw a closed or open freehand
curve.

17.4.9 Lines and Arrows

17.5 Connectors
Connectors are a particular type of curve, the ends of which are attached to glue
points on other objects, and which stick to these glue points when the associated

Pakistan Computer Bureau 221


Object is moved. They are particularly useful for making organizational charts.
You can reorganize the blocks of your chart while keeping the links between them.
OpenOffice.org Draw has whole panoply of functions that are really quite
remarkable as far as connectors are concerned. Finding the various functions is not
at first sight very easy, but we shall look at the ways of making them visible.

17.5.1 Connector toolbar

17.5.2 Editing Gluepoints


Gluepoint management is handled by a special toolbar. This toolbar isn't visible by
default.
To display it, press the button in the option toolbar.

The gluepoint toolbar looks like this:

17.6 Selecting Objects


17.6.1 Direct selection
To select an object, the easiest way is to click directly on it. For objects that are
not filled, you have to click directly on the object's outline to select it.

17.6.2 Selection by framing


You can select several objects by dragging a large rectangle around the objects
with the select button: For an object to be selected, it must be entirely within the
rectangle.

Pakistan Computer Bureau 222


17.6.3 Moving and Dynamically Adjusting the Size of an Object
There are several ways of moving or changing the size of an object. The method
described here will be called dynamic in the sense that it is carried out using the
mouse. When you dynamically change an object, remember to check the left hand
area of the status bar at the bottom of your screen. This shows detailed information
about the ongoing manipulation. For example, during a resizing manipulation, you
will see the following information displayed:

The information displayed changes when the mouse is moved.

17.6.4 Dynamic movement of objects


To move an object, select it and then click within the selection frame and hold
down the left mouse button while moving the mouse. In order to drop the object at
its new location, let go of the mouse button. During movement, the shape of the
object appears as dotted lines to help with repositioning.

Pakistan Computer Bureau 223


17.6.5 Dynamic size modification of objects
In order to change the size of an object (or group of selected objects) with the
mouse, you need to move one of the handles located around the selection. As
shown in the following illustration, the outline of the resulting new object appears
as a dotted line.

The results will differ depending on which handle you use. If you choose a corner
handle you will resize the object along two axes at the same time. If, on the other
hand, you use a side handle the objects will only be resized along one axis.

Note:

If you press the Shift key at the same time as you carry out the resizing operation, the size
change will be carried out symmetrically with respect to the two axes, which enables you
to keep the height/length ratio of the object. With the Alt key, the object is resized
symmetrically starting from its center.

17.6.6 Rotating an Object


Rotation of an object lets you slant an object along an axis. In order to do this
dynamically, you use the red handles, as with changing the size of the object.
Rotation works in a slightly different way for 3-D objects (since the rotation
occurs in 3D space and not in one plane). To rotate an object (or a group of
objects), drag the red corner handle points of the selection with the mouse. The
mouse cursor takes the shape of an arc of a circle with two arrows at each end. As
with the preceding operations, a dotted outline of the object being rotated appears
and the current angle of rotation is dynamically shown in the status bar.

Rotations are made about an axis which is displayed as a small symbol. You can
move the axis of rotation with the mouse, as shown below:

Pakistan Computer Bureau 224


If you hold down the Shift key during the rotation, the operation will be carried
out in increments of 15°.

17.6.7 Inclination
To incline or slant an object, use the red handles located on one of the edges of the
selected object. The inclination axis is shown as the nearest handle to the opposite
edge:

17.6.8 Changing Object Attributes


Each object comes with a set of associated attributes that characterize the
appearance of the object. These attributes, such as color, the contour type, line
thickness, etc., can be modified whenever you want. A toolbar and a dialog box
are dedicated to the modification of these attributes. The main attributes can be
directly modified from the object toolbar (located by default above the
workspace). Depending on the currently selected object, the Object Bar changes
appearance. The default Object toolbar is applicable to all objects:

When editing texts, a new toolbar appears:

This toolbar is split into two parts. To go from one to the other, use the arrow
button located at the right end of the Object toolbar. The second part of the toolbar
will then appear; it is the default Object toolbar shown above.

17.7 Using the Stylist


The application of the same style to several different objects can soon turn out to
be a tedious job with the drawing tools. Fortunately, OpenOffice.org comes to the
rescue with the Stylist. This window, as in the Writer module, lets you define
particular styles and apply them in a single operation to several objects
simultaneously.

Pakistan Computer Bureau 225


17.7.1 Applying a Style
To apply an existing style to one or more objects, all you have to do is select them
and double-click on the required style. You can also use the Fill All mode. When
this button is pressed, the mouse cursor changes into paint can; then just select all
of the objects to which you want to apply the current style.

17.8 Special Transformations


In the toolbar, the rotation button gives you access to a sub-menu of functions
grouped under the heading Effects. Each button is associated with a set of special
transformation functions. The submenu window looks like this:

Pakistan Computer Bureau 226


17.9 3D Rotation Objects
This function lets us enter the world of three-dimensional objects. With this tool
you can get a 3D object by rotating a profile that you've drawn about an axis of
rotation. It's useful for drawing common objects found in daily life, such as vases,
glasses or bottles. Here are some examples of 3D drawings obtained from simple
profiles:

17.9.1 3D effects
3D objects have their own configuration dialog. This dialog is called the 3D
Controller or the 3D Effects dialog5. Click on the button to display it (Main
toolbar). The dialog contains several pages that can be selected through the
buttons at the top.

17.10 The Bitmap Image Toolbar


When a bitmap image is selected in the workspace, a dedicated toolbar is
displayed (Figure 39).

17.11 Grouping and Combining Objects


Draw contains a number of mechanisms that let you combine several objects
together so that changes can be carried out to the group, or new objects can be
created from the group Grouping lets you temporarily combine objects to carry out
global changes to them. A group can always be undone and the objects that make
up the group can always be manipulated separately. A combination is a permanent
fusion of objects leading to a new object. The initial objects are no longer
available as individual entities and the operation is therefore irreversible (unless
you use the Edit/Undo function which is dependent on the number of undo steps

Pakistan Computer Bureau 227


set under Options). Whatever you decide to do, several objects need to be selected
for these functions to work. Just a quick reminder on how to select multiple
objects: click on each object while holding down the Shift key or draw a rectangle
around the objects that you wish to include in the selection.

17.12 Grouping & Combining Functions


17.12.1 Group by common selection
When several objects are selected, any operations you carry out are applied to all
of the objects. For example, you can rotate a group of objects in its entirety.
Groups obtained through common selection of several objects are undone as soon
as you click outside the group. However, there is also a way to group objects and
keep those selected objects grouped together.

17.12.2 Maintaining groups and group dissociation


To group selected objects, you can right-click and choose Group from the context
menu. You can also use the keyboard shortcut Control + Shift + G. It is also
possible to go via the main menu Modify > Group. When objects are grouped, all
of the editing operations carried out on that group are applied to all members of
the group. If you click on one of the members of the group, the whole of the group
will be selected. This method is thus safer than direct selection, which is best left
to simple drawings.

As indicated at the beginning of the chapter, the objects of a group maintain their
Individuality and it is possible to undo a group via the context menu (Ungroup) or
using the keyboard shortcut Alt + Control + Shift + G or even the main menu
Modify > Ungroup.

17.12.3 Combination Functions

In contrast to grouping functions, combinations create a new object. To use this


function: choose all of the objects that you want to combine, then right-click and
choose the option Combine from the context menu. The keyboard shortcut is
Control + Shift + K.

Pakistan Computer Bureau 228


The result of the combination is given in the following illustration:

At first glance, this can seem rather surprising. Fortunately, once you have
understood the rules governing combination in OpenOffice.org, it will become
clear:
• The attribute of the resulting object is the attribute of the object that is the
furthest back from the viewer. In our example, it is the circle. The resulting
drawing has the same color, line thickness, etc., as the circle.
• The result of the combination is a Bezier curve.
• Where the objects overlap, the overlapping zones will be represented as a
filled or empty zone depending on the number of overlaps. When there is
an even number of overlaps, you get an empty space (represented by a
'hole') in the drawing. When the overlaps are odd in number, you get a
filled area. In our example, we can count the number of super positions:

17.13 Aligning Objects


The alignment toolbar has six buttons as shown below:

Pakistan Computer Bureau 229


This toolbar can be detached from the main lefthand toolbar and remain visible in
the workspace. The buttons become active when objects are selected. The toolbar
lets you align any selected objects in a certain way. To show what can be done,
let's start from the following two objects:

17.14 Distribution of Objects


When several objects are selected, Draw provides ways to let you distribute these
objects harmoniously, both vertically and horizontally. To display the object
distribution dialog box (Figure 41), right-click and choose Distribution from the
context menu of the selected objects (you need at least three objects for this option
to show up in the menu).

Pakistan Computer Bureau 230


17.15 Managing Object Arrangement
The toolbar for object arrangement is as shown below. The toolbar lets you
manage the relative superposition of objects. This toolbar can be detached.

17.16 Drawing Aid Tools


17.16.1 Zoom using the status bar
The current zoom value is displayed in the status bar:

If you double-click on the zoom value, a window is displayed in which you can
change the zoom percentage value:

17.16.2 Zoom Toolbar

Pakistan Computer Bureau 231


17.17 Managing Layers
Draw has a workspace that can optionally comprise a series of layers on which
you can draw the different parts of your drawing. The biggest advantage to layers
is that they can be displayed or hidden at will. This technique is often used in
architecture, for example. The basic layer contains the base plan of the building,
then various layers are used to represent piping, electrical circuits, furniture,
dimensions, etc. Layer management is handled by a particular mode available in
Draw. To activate it, use View > Layer from the menu bar, or click on the
appropriate icon at the bottom left hand corner of the workspace:

17.18 Specific Functions


Draw contains several advanced functions that are useful in certain specific
instances (web images and data exchange).

17.19 Duplication
This function duplicates a given shape while at the same time enabling you to
change the options applied to the duplicated shapes. To start duplication, click on
an object (or on a group of selected objects), then choose Edit > Duplicate. The
following dialog box appears:

You can choose:


• The number of copies

Pakistan Computer Bureau 232


• The displacement along the X and Y axes between two copies
• The angle of rotation between two copies
• The change in size between each copy
• The colors of the starting and ending copies.

Pakistan Computer Bureau 233


18.1 Starting Open Office Impress
To start Impress, navigate to the Start Menu and select Programs »»
OpenOffice.org 1.9.109 »» Impress. The presentation wizard, Auto Pilot will
open. There are three options for creating a presentation:

• Empty Presentation
• From template, and
• Open existing presentation

The Open existing presentation option will allow you to navigate to a presentation
that is already created, while from template option allows you to choose from
existing templates. There are two types of templates, Introducing a New Product
or Recommendation of a Strategy. These templates choices contain seven different
types of slide designs that help you organize information. Once you select a style
type, you will be presented with two color schemes. The Auto Pilot will also ask
general questions, such as company name in order to auto fill some fields.

Pakistan Computer Bureau 234


18.2 Custom or Empty Presentation
This tutorial will concentrates on the Empty Presentation option. At window 1 of
the Auto Pilot, select Empty Presentation and click Next. At window 2, leave the
default settings at <original> and screen as output medium. There are two template
designs that you can choose from, however for this tutorial will create a custom
background. Click Next. Window 3 will give you options for setting transition
effects, speed and timing. You can set these options now, however they can be
changed at a later time. Click on the Effect drop down menu and choose an
appropriate transition. The preview window will show how the transition will
appear. The speed of the transition can be adjusted under the Speed drop down
menu.

Design Tip

Choose your transitions and effects judiciously. While they can add to a presentation's
appeal, they can also detract from the message that you are presenting. Do not mix too
many transitions or effects on one slide. Consider the presentation's audience, tone, and
message when choosing transitions. Transitions such as Venetian Blinds or Check board
are more playful, while a simple fade-out transition is more serious. Select how the
presentation will be timed through the Select presentation type options. If you choose
Default, the speed of the slide show will be controlled by the presenter during the
presentation.

Pakistan Computer Bureau 235


To set automatic timings for movement from one slide to the next, choose
Automatic. Enter the desired timing for each slide after Duration of page. The
slideshow will loop continuously if Automatic is chosen. The automatic settings
can always be overridden during the presentation by clicking on the space bar. The
pause between the end of the slideshow and the start of the next showing is
adjusted through Duration of pause. Click Create to open your new slideshow
layout.

18.3 Normal View


After clicking Create in the Auto Pilot, Impress will open a blank presentation in
“Normal “view. In normal view, you will see the following: A blank slide in the
center of the window. On the left side, there is a "Slides" pane that displays
thumbnail sketches of all the slides in the presentation in sequential order. On the
right side, a "Tasks" window that provides cascading menu options for:

• Master Pages
• Layouts
• Custom Animations
• Slide Transitions

Pakistan Computer Bureau 236


18.4 Alternate Views
In addition to “Normal “there are several other views available for previewing
your presentation. To toggle between the alternate views, click on the tabs located
at the top of the center window view. Views can also be changed by going to the
View menu and putting a check next to the desired view.

Normal View
This view is where you will create and edit your presentation.

Outline View
This view shows the titles of all the slides in an outline form. You can change or
add titles by clicking to the left of the outline bullet.

Notes View
This view allows you to add notes about slides. The notes will not show in the
presentation, but will print on the handouts.

To add notes to your presentation:


• Click on the Notes tab.

You will see a frame at the bottom of the window labeled "Click to add notes."
• Click once in this window and add text.

Pakistan Computer Bureau 237


Handout View
This view allows you to create handouts for your presentation. You can create
handouts with 1 to 6 slides per page.

To choose your handout design:


• Click on the Handouts tab.

On the right-hand side of the window there will be five different handout designs
that you can choose from.

• Choose your desired handout layout.

Slide Sorter View


This view allows you to preview your presentation slides as thumbnails. You can
insert, delete, copy and move your slides around in this view.

To manipulate your slides in "Slide Sorter" view :


• Go to View->Slide Sorter.

To rearrange slides, click on the slide you wish to move, hold down the mouse
button, and move the object to a new location in the presentation (between slides,
at the beginning or at the end). Lift up on the mouse button when you are satisfied
with the new location. A vertical line between the slides indicates the position to
which you are moving the slide. To return to Normal view, go to View-> Normal.
Layouts, Text, and Slides. This section describes how to apply a layout; insert,
format, and delete text; and insert and delete slides. To apply a layout to your new
slide :

Pakistan Computer Bureau 238


Scroll through the available layouts in the
"Layouts" task pane on the right side of the
Impress window. Click on the layout you would
like to apply to your slides.

NOTE:

You may change the layout of all or some of your


slides at any point while working on your
presentation.

To apply a layout to only certain slides-highlight


the slides you would like to change in the left
slide pane by holding down the control key and
clicking on the desired slides. Choose a layout
from the "Layouts" panel.

To select all slides-click in the left slides pane,


and hold down the control key and "A". This
function will select all slides; then choose the
desired layout.

To insert and format text in a slide: If you have selected a layout with a text box
included, click on the text that says "Click to add an outline," and begin typing
your text. The layout will automatically format your text.
You can add additional text boxes by clicking on the text box icon located on
the bottom tool bar. Place the cursor inside the presentation and create a rectancle
text box. Click inside the box and begin typing your text.
You can add artistic text by clicking on the Fontwork icon. This option is
similar to Microsoft's WordArt. The Fontwork Gallery will open. Click on you
preferred text format and click OK. The font art will be inserted into your
presentation with the word "Fontwork" spelled out. Double click on the text and a
small, editable version of the word "Fontwork" will appear in front of the larger
word. Type your text over the small, editable text.

Pakistan Computer Bureau 239


You may use the formatting toolbar at the top of the Impress window to apply
various formats to selected text. You may notice this toolbar is similar to the ones
used in Microsoft products. When you are finished entering text, click outside the
placeholder on some "empty space."

To delete text:
Option #1: Highlight the text you want to delete by dragging the cursor over the
letters, and press the delete key.

Option #2: Click on the selection rectangle around the text so that its border
changes from hatch marks to dots, and then press the delete key

To insert a new slide:


Option #1: Go to Insert-> Slide. A blank slide will appear in the workspace,
positioned after the selected slide or slide you were viewing.

Option #2: Click on the "Slide" button on the formatting toolbar at the top of the
Impress window.

Option #3: On the Slides pane (on the left), position your cursor to the point in the
presentation where you would like the new slide to appear (i.e. between slides, at
the beginning of the presentation, or at the end of the presentation). Right click,
and choose "New slide."

To delete a slide:
Option #1: Go to Edit->Delete Slide. The current slide will disappear from the
workspace.

Option #2: On the Slides pane (off to the left), click on the slide you would like to
delete, and then hit the <Delete> key.

18.5 Design Templates and Images


This section describes how to use Design Templates to change the appearance of
your slides. It also describes how to insert and manipulate images on your slide.

Pakistan Computer Bureau 240


18.5.1 Design Templates
Click on the small arrow to the left of "Master
Pages" in the "Task" pane. This action will
expand that menu and you will be able to see
another menu named "Available for Use." This
menu contains the design templates supplied by
Impress. Click on the desired template, and it will
be applied to all the slides in your presentation.

Note

If the "Task" pane is not open, it can be viewed by


going to View and clicking on Task Pane.

Design Tip

Create Your Own Background - You can create your


own background. First-click on the blank
presentation in the "Available for Use" menu. This
will apply a blank, white background to all slides. Go
to Format->Page. Choose the Background tab from
the Page window. Under Fill, click on the drop down
menu to reveal your choices. The background choices
include Color, Gradient, Hatching and Bitmap.
Review the different options to find one that you like.
The Bitmap option provides graphic images. Once
one background is selected, click on OK and the
image will be applied to all slides.

To insert a picture into your presentation: If you have already saved the
picture, and you would like to insert, go to Insert->Picture->From File and
navigate to your picture file. Select your file, and click "Insert". Your picture will
appear on the current slide. Images can also be pasted into your Impress
presentation. If you have an image within another source, copy the image in the
original source. Go to Edit->Paste and paste the art work into your presentation.

To change the shape of a picture: Move your cursor over the picture and click
once to select it. You will see a number of small green squares appear along the
edge of the picture. These squares are called "sizing handles."

Click on one of the sizing handles that appear on a side of the picture; hold the
mouse button down; drag the handle to change the shape of the picture. Your
pointer will be a double-sided arrow when you are directly over a sizing handle.
Pakistan Computer Bureau 241
Be aware that you are distorting the picture by stretching or squishing it. Release
the mouse button when you have achieved the desired shape.

To change the size of a picture: Move your cursor over the picture and click
once. You will see the sizing handles described above. Click your cursor on one of
the sizing handles that appears on the corner of the picture; hold the mouse button
down; drag the picture to make it smaller or larger. Using these corner handles
maintains the original proportions of the image (it does not stretch or squish).
Release the mouse button when you have achieved the desired size.

To move a picture:
Option #1: Using the mouse:
Move your cursor over the picture until the cursor looks like a cross. Click the
mouse button, hold the button down, and drag the picture to change its location.
Release the mouse button when you are satisfied with the location of the image.

Option #2: Using the direction arrow keys:


Move your cursor over the picture. Click the mouse button once. Use the direction
keys to move the picture vertically, horizontally, right, and left. This option works
well when you need to adjust the position very precisely, or just a tiny bit.

18.6 Drawing Tools


This section is an introduction to tools on the Drawing toolbars. The drawing tools allow
you to create your own visual effects within Impress. The toolbars are located on both the
top and the bottom of the Impress screen. To view the Drawing toolbar, go to View-
>Toolbars->Drawing. Click on Drawing so that a check mark appears beside it on the
menu. The following is an explanation of basic tools on the BOTTOM Impress toolbar,
from left to right.

Select
This button looks like the cursor arrow. Click this button to then select and move
objects on your slide.

Line and Arrow


These tools allow you to insert lines or arrows by clicking the tool, then clicking
and dragging in your slide.
Pakistan Computer Bureau 242
Rectangle and Oval
These tools allow you to insert rectangles or ovals by clicking the tool, then
clicking and dragging in your slide.

Text Box
Clicking this tool and then clicking in your slide inserts a box in which you can
type an unlimited amount of text. This box is mentioned in the "Layouts" section
of this tutorial. The box expands to accommodate what you type. Hitting the
<enter> key on the keyboard takes you to the next line of text. You can move a
text box by clicking on the border (your cursor should be a 4points arrow) and
dragging it to the desired position. You can also resize a text box using the sizing
handles, the same way you resize an image.

Curve
This tool allows you to create free-drawn lines or curved vector-based objects.
Note the drop down arrow on the right of the graphic that gives additional options.

Connectors
This tool allows you to connect graphics to create flow charts or diagrams.

Basic Shapes
This tool gives you the option to insert pre-designed shapes such as diamonds,
pentagons and cylinders. Note the drop down arrow on the right of the graphic that
gives additional options.

Symbol Shapes
This tool gives the option to insert pre-designed fun shapes such as hearts or happy
faces. Note the drop down arrow on the right of the graphic that gives additional
options.

Block Arrows
This tool allows you to insert block shapped arrows. Note the drop down arrow on
the right of the graphic that gives additional options.

Flowcharts
This tool allows you to insert flowchart shapes. Note the drop down arrow on the
right of the graphic that gives additional options.

Callouts
This tool allows you to insert callouts. Note the drop down arrow on the right of
the graphic that gives additional options.

Pakistan Computer Bureau 243


Stars
This tool allows you to insert different star shapes. Note the drop down arrow on
the right of the graphic that gives additional options.

Points
This tool allows you to change the size of points on a vector-created image. Click
on the image and then click on a handle box. Drag the handle box to a different
location to edit the vector-based image.

Glue Points
This tool displays the points on a custom-drawn object. Click once on the object to
select and then click on the glue point icon to display points on the object. The
glue points can then selected and moved to alter the image.

Font work Gallery


This tool gives you some dramatic, pre-designed styles for formatting your text.

Insert Picture
This tool allows you insert pictures from file.

Gallery
This tool opens a gallery of images, sounds, bullets, web page icons, and rule
dividers that can be inserted into a presentation for sound and graphic appeal.

Rotate
This tool allows you to rotate on an object by clicking on the object. When a circle
handle appears, click on the circle and rotate the object by moving the mouse.

Alignment
This tool allows you to change the alignment of objects. Note the drop down
arrow on the right of the graphic that gives additional options.

Arrange
This tool allows you to change the layering of objects. Objects can be moved
backwards or brought forward. Note the drop down arrow on the right of the
graphic that gives additional options.

Interaction
This tool allows you to add interactive effects at the click of a mouse.

Pakistan Computer Bureau 244


Drop Menu
The final tool allows you to choose from additional tools that can be displayed on
the bottom toolbar.
The following is an explanation of basic tools on the TOP Impress toolbar, from
left to right.

Line
This tool allows you to change the width and style of lines. It can also be accessed
by right-mouse clicking on an object.

Arrow Style
This tool allows you to change the direction and arrow head by clicking on a line
or arrow that has been added to the presentation. It can also be accessed by right-
mouse clicking on an object.

Line Style
This tool allows you to adjust the line format.

Line Width
This tool adjusts the line width of objects.

Line Color
This tool allows you to change the line color of objects.

Area
This tool opens a window that gives you many options for changing the fill, color,
gradient, and texture of a shape object.

Area Style/Filling
This tool is a two part tool. Select an option from the first window, such as
gradient. Review the many choices for gradient in the second window and click on
one to choose it.

Shadow tool
This tool applies a shadow.

Pakistan Computer Bureau 245


18.7 Printing and Saving
This section describes how to print different versions of your Impress presentation.
Preview your presentation before printing to insure that the design, layout, and
notes are as you like them.

18.7.1 To print the actual-size Impress presentation:

• Go to File->Print.
• To print notes, handouts, or outlines:
• Go to File->Print. Click on the Options button in the bottom left side of the
window.

The Printer Options window will open, under the Content section, click on the
desired format that you would like to print. Click Ok and then Ok again.

18.7.2 Creating a PDF file


To print your presentation to a PDF file: Go to File->Print. Click on the drop-
down menu besides Name and change the printer to Adobe PDF. Click OK. You
will be prompted to enter a location to save your PDF file. Choose the location and
click Save.

NOTE

You can also export your presentation as a PDF file. See the Export section below.

Pakistan Computer Bureau 246


18.7.3 Saving as PowerPoint
Impress allows you to save your document as a PowerPoint (.ppt) file.

• Go to File->Save As.
• In the Save As window, navigate to Save as type:
• Click on the drop-down menu and choose the option: Microsoft PowerPoint
97/2000/XP.ppt
• Name your file and choose the save destination.
• Click on Save

Your file can now be opened by Microsoft's PowerPoint software.

Pakistan Computer Bureau 247


18.7.4 Exporting as Alternate Formats
Impress will allow you to export your presentation into many different file
formats.

Go to File->Export. In the
Export window, navigate to File
format: Click on the drop-down
menu and choose from the
many options. Name your file
and choose the save destination.
Click on Save

18.8 Displaying Your Presentation on the Web


This section describes how to make your presentation viewable on the World
Wide Web.

NOTE:

before you begin, you must create a folder entitled "public_html" in your directory on the
iSchool server. If you have not already done this, consult the iSchool tutorial "How-to
Publish Web Pages" or contact a "purpleshirt" for help.

To convert your presentation to a web page: Go to File->Export. In the Export


window, navigate to File format and choose HTML Document. Name your file
and choose the save destination. When you click on save, the HTML Export
wizard will open. In the first window, choose from a new or existing design. Click
Next. The next window will ask you to choose publication type. Choose Standard
HTML format. You can choose to show notes that accompany your presentation
slides, or you can turn this function of. Click Next. On the next window, choose
how graphics will be exported. Either JPEG or GIF is acceptable. Adjust graphic
quality. The higher the graphic quality, the larger the file size 75% is a good, basic
quality.

Pakistan Computer Bureau 248


Choose monitor resolution. If you are not sure on the size of the monitor that will
display your presentation, choose the lowest possible resolution. If your
presentation has sound effects, turn on Export sounds when slide advances. Click
Next On the next window; enter information for your web page's title page
information. Enter your name, email address, homepage URL, and any other
notes. If you would like to have a link within your web page to the original
presentation, put a check next to this option. Click Next.

The next window will prompt you to select the button style for navigating through
your presentation when it is on the web. If you choose text only, your web page
will display the navigation choices as text only.

For Example:

Select button style and Click Next. The final window will ask you to choose the
color scheme for your presentation on the web. Select Apply color scheme from
document and click on Create. To upload your presentation to the iSchool server :

Step 1: Start a FTP (File Transfer Protocol) program. FTP programs are generally
available from the Start menu. If you need help doing this, consult the iSchool
tutorials on SSH or Fugu.

Step 2: Log on to your FTP program.

Pakistan Computer Bureau 249


Step 3: Locate your web page presentation and any files associated with it.

Step 4: Select ALL the files and folders associated with your presentation. Drag
them to the public_html folder displayed in the FTP session.

To verify that your presentation is displaying correctly:

Step 1: Open a Web browser (Fire fox or Mozilla)


Step 2: In the address bar, enter the following:
• http://www.ischool.utexas.edu/~(your userid)/(your presentation name)
• Be sure that you have included the correct extension in your filename.
• Presentation saved as Web Page: .html or .html extension
• Presentation saved as Single File Web Page: .mht or .mhtml extension
• Presentation saved as Presentation: .ppt extension
Step 3: Your web page should appear. If not, verify that you have entered the
correct address in the address bar.

NOTE:

Your published presentation may look slightly different viewed in different browsers. Also
note that security settings in the browser of a particular computer may require extra
steps to view your presentation.

Pakistan Computer Bureau 250


Training Schedule

Training Schedule (Duration: 5 Weeks, Workings Days: 30)


1.Steps to Get You Started DAY 1
Is Your Hardware Compatible?
Do You Have Enough Disk Space?
Can You Install Using the CD-ROM or DVD
Alternative Boot Methods
Making an Installation Boot CD-ROM
Preparing for a Hard Drive Installation
2. Installing on Intel® and AMD Systems DAY 2
The Graphical Installation Program User Interface
A Note about Virtual Consoles
The Text Mode Installation Program User Interface
Using the Keyboard to Navigate
Starting the Installation Program
Booting the Installation Program on x86, AMD64, and
Intel® 64 Systems
Booting the Installation Program on Itanium Systems
Additional Boot Options
Selecting an Installation Method
Installing from DVD/CD-ROM
What If the IDE CD-ROM Was Not Found?
Installing from a Hard Drive
Welcome to Red Hat Enterprise Linux
Language Selection
Keyboard Configuration
Enter the Installation Number
Disk Partitioning Setup
Advanced Storage Options
Create Default Layout
Partitioning Your System
Graphical Display of Hard Drive(s)
Disk Druid's Buttons
Partition Fields
Recommended Partitioning Scheme
Adding Partitions
Editing Partitions
Deleting a Partition
x86, AMD64, and Intel® 64 Boot Loader Configuration
Advanced Boot Loader Configuration
Rescue Mode
Alternative Boot Loaders
SMP Motherboards and GRUB
Time Zone Configuration
Set Root Password
Package Group Selection
Preparing to Install
Prepare to Install

251
Installing Packages
Installation Complete
Itanium Systems — Booting Your Machine and Post-Installation
Setup
Post-Installation Boot Loader Options
Booting Red Hat Enterprise Linux Automatically
3. Removing Red Hat Enterprise Linux DAY 3
DAY
4. Troubleshooting Installation on an Intel® or AMD System
4, 5
You are Unable to Boot Red Hat Enterprise Linux
Are You Unable to Boot With Your RAID Card?
Is Your System Displaying Signal 11 Errors?
Trouble Beginning the Installation
Problems with Booting into the Graphical Installation
Trouble During the Installation
No devices found to install Red Hat Enterprise Linux Error
Message
Saving Trace back Messages Without a Diskette Drive
Trouble with Partition Tables
Using Remaining Space
Other Partitioning Problems
Other Partitioning Problems for Itanium System Users
Are You Seeing Python Errors?
Problems After Installation
Trouble With the Graphical GRUB Screen on an x86-based
System?
Booting into a Graphical Environment
Problems with the X Window System (GUI)
Problems with the X Server Crashing and Non-Root Users
Problems When You Try to Log In
Is Your RAM Not Being Recognized?
Your Printer Does Not Work
Problems with Sound Configuration
Apache-based httpd service/Sendmail Hangs During Startup
5. The GRUB Boot Loader DAY 6
Boot Loaders and System Architecture
GRUB
GRUB and the x86 Boot Process
Features of GRUB
Installing GRUB
GRUB Terminology
Device Names
File Names and Block lists
The Root File System and GRUB
GRUB Interfaces
Interfaces Load Order
GRUB Commands
GRUB Menu Configuration File
Configuration File Structure
Configuration File Directives
Changing Run levels at Boot Time
Additional Resources
252
Installed Documentation
Useful Websites
6. Swap Space DAY 7
What is Swap Space?
Adding Swap Space
Extending Swap on an LVM2 Logical Volume
Creating an LVM2 Logical Volume for Swap
Creating a Swap File.
Removing Swap Space
Reducing Swap on an LVM2 Logical Volume
Removing an LVM2 Logical Volume for Swap
Removing a Swap File
Moving Swap Space
7. Managing Disk Storage DAY 8
Standard Partitions using parted
Viewing the Partition Table
Creating a Partition
Removing a Partition
Resizing a Partition
LVM Partition Management
8. Access Control Lists DAY 9
Mounting File Systems
NFS
Setting Access ACLs
Setting Default ACLs
Retrieving ACLs
Archiving File Systems With ACLs
Compatibility with Older Systems
Useful Websites
DAY
9. Package Management with RPM
10
RPM Design Goals
Using RPM
Finding RPM Packages
Installing
Uninstalling
Upgrading
Freshening
Querying
Verifying
Checking a Package's Signature
Importing Keys
Verifying Signature of Packages
Practical and Common Examples of RPM Usage
Additional Resources
Installed Documentation
Useful Websites
Related Books

253
DAY
10. Samba
11
Introduction to Samba
Samba Features
Samba Daemons and Related Services
Samba Daemons
DAY
11. Date and Time Configuration
11
Time and Date Properties
Network Time Protocol (NTP) Properties
Time Zone Configuration
DAY
12. The X Window System
12
The X11R7.1 Release
Desktop Environments and Window Managers
Desktop Environments
Window Managers
X Server Configuration Files
xorg.conf
Fonts
Fontconfig
Core X Font System
Runlevels and X
Runlevel 3
Runlevel 5
DAY
13. X Window System Configuration
13
Display Settings
Display Hardware Settings
Dual Head Display Settings
DAY
14. Users and Groups
14
User and Group Configuration
Adding a New User
Modifying User Properties
Adding a New Group
Modifying Group Properties
User and Group Management Tools
Command Line Configuration
Adding a User
Adding a Group
Password Aging
Explaining the Process
Standard Users
Standard Groups
User Private Groups
Group Directories
DAY
15. Open Office
15, 30
Introduction to Open Office
254
System Requirements
How to Run
Starting Writer

From the system menu

Creating a Document

Creating A Blank Document

Creating a Document from a Template

Creating a Document with an Autopilot

Loading an Existing Document

Saving Document

Saving a Document

Saving As MS Word Document

Closing A Document

Exiting Writer

Formatting Documents

Cut, Copy and Paste

Inserting Pictures and Graphics

Draw Functions

Tables and Lists

Page and Section Breaks

Spell Check, Auto Correct and Word Count

Hyperlinks

Find/Replace

Print Preview/Printing

Navigator

Save as HTML

Tracking Changes

Versioning

What is Calc?

Spreadsheets, sheets and cells

Title bar and Menu bar

255
Toolbars

Formula bar

Individual cells

Starting new spreadsheets

from the File menu

from the toolbar

from the keyboard

Opening existing spreadsheets

from the File menu

from the toolbar

from the keyboard

from a template

Saving spreadsheets

from the File menu

from the toolbar

from the keyboard

Navigating within spreadsheets

Going to a particular cell

Using the mouse

Using a cell reference

Using the Navigator

Moving from cell to cell

Using the Tab and Enter keys

Using the cursor keys

Moving from sheet to sheet

Using the keyboard

Using the mouse

Selecting items in a sheet or spreadsheet

Selecting cells

Single cell

256
Range of contiguous cells

To select a range of cells by dragging the mouse

To select a range of cells without dragging the mouse

To select a range of cells without using the mouse

Range of non-contiguous cells

Selecting columns and rows

Single column

Single row

Multiple columns or rows

Entire sheet

Selecting sheets

Single sheet

Multiple contiguous sheets

Multiple non contiguous sheets

All sheets

Working with columns and rows

Inserting columns and rows

Single column or row

Multiple columns or rows

Deleting columns and rows

Single column or row

Multiple columns or rows

Working with sheets

Inserting new sheets

Deleting sheets

Single sheet

Multiple sheets

Renaming sheets

Viewing Calc

Using the zoom function

257
Freezing/Unfreezing rows and columns

Freezing single rows or columns

Freezing a row and a column

Unfreezing

Splitting the window

To split the screen horizontally

To split the screen vertically

Removing split views

Entering data into a sheet

Entering numbers

Entering text

Entering numbers as text

Entering dates and times

Entering data into Calc

Inputting data

Moving between cells

Using the mouse

Using the arrow keys

Using the Enter key

Multiple lines of text

Wrapping text

Line breaks

Shrinking to fit cell

Editing data in Calc

Removing Data

Removing data from a cell

Removing data and formatting

Changing part of the data in a cell

Keyboard shortcut

Mouse

258
Formatting data in Calc

Numbers

Font

Font effects

Charts and Graphs

Creating a chart

Data range and labels

Chart, Axis Titles and Legend

A simple scatter plot

Moving and resizing a chart

Grid lines and background

Data labels

Printing a spreadsheet

Print options

Page breaks

Inserting a page break

To insert a page break

Row break

Column break

Deleting a page break

To remove a page break

Headers and footers

Setting a header or a footer

Margin

Spacing

Height

Custom header

Inserting pictures

Mathematical functions

Statistical analysis functions

259
Date and time functions

Logical functions

Informational functions

Database functions

Introduction to Draw

The Workplace

The Toolbars

The Function Bar

The Object Bar

The Main Toolbar

The Color Bar

The Option Bar

The Rulers

The Status Bar

Drawing Basic Shapes

Drawing a segment of a straight line

Drawing a rectangle

Drawing a circle

The Texts

Rectangles and Squares

Circles, Ellipses and Arcs

3D Objects

Curves

Lines and Arrows

Connectors

Connector toolbar

Editing Glue points

Selecting Objects

Direct selection

Selection by framing

260
Moving and Dynamically Adjusting the Size of an Object

Dynamic movement of objects

Dynamic size modification of objects

Rotating an Object

Inclination

Changing Object Attributes

Using the Stylist

Applying a Style

Special Transformations

3 D Rotation Objects

3D effects

The Bitmap Image Toolbar

Grouping and Combining Objects

Grouping & Combining Functions

Group by common selection

Maintaining groups and group dissociation

Combination Functions

Aligning Objects

Distribution of Objects

Managing Object Arrangement

Drawing Aid Tools

Zoom using the status bar

Zoom Toolbar

Managing Layers

Specific Functions

Duplication

Starting Open Office Impress

Custom or Empty Presentation

Normal View

Alternate Views

261
Design Templates and Images

Design Templates

Drawing Tools

Printing and Saving

To print the actual-size Impress presentation

Creating a PDF file

Saving as PowerPoint

Exporting as Alternate Formats

Displaying Your Presentation on the Web

262

Das könnte Ihnen auch gefallen