Chapter 8 Study Guide

From ITCwiki
Jump to navigation Jump to search

Chapter 8 – System initialization and X-Windows



Boot Process

  • Power on
  • System initializes
  • BIOS performs POST (power-on self test)
  • BIOS checks configuration and checks for boot devices and an OS to execute
    • Typically floppy disks, CDs, DVDs, and USB devices are checked as they can contain installation media for an OS.
    • If an OS isn’t found, the BIOS will check the MBR/GPT on the first HD.
    • MBR/GPT may point to the partition where the boot loader found. If this is the case then the partition where the boot loader is found is called the active partition.
See page 347 of the book for the flowchart of the boot process
Boot loader – main purpose is to load the OS kernel into memory.
NOTE: There can only be one active partition per HD.
  • Regardless of whether the boot loader is loaded from the MBR/GPT or the active partition the rest of the boot process continues as normal. Which is.. The kernel is executed and loaded into memory.
  • After loading the kernel, the boot loader becomes inactive.
  • Kernel continues by loading daemons into memory
  • Daemons are a system process which performs tasks such as printing scheduling, and OS maintenance.
    • The first daemon process is called the initialize (init) daemon. It’s responsible for loading all the other daemons on the system required to bring the system to a usable state where users can interact with it.

Boot Loaders

As mentioned, the primary task of boot loaders is to load the OS kernel into memory. They do secondary tasks as well. This includes passing info the kernel during system startup and booting other OS’s which may be on the HD.


Using a boot loader to boot one of several OS’s is known as dual booting.


GRUB

The most common and only boot loader supported by Fedora 13.
3 Stages
Stage 1 : Generally resides in MBR/GPT and points to Stage 1.5
Stages 1.5 : Resides in the /boot/grub directory and loads the file support and loads Stage 2
Stage 2 : Also, reside in the /boot/grub directory. This part actually performs the boot loader operations and displayed the graphic boot loader screen.
This can be configured by editing the config file found at (/boot/grub/grub.conf).
This is read by Stage 2, which is located on the partition called GRUB root partition.
To be able to read the info in boot/grub/grub.conf you must first understand how GRUB refers to partitions on HDs.
The format used is : (hd<drive#>,<partition#>)
Examples.
(hd0,0) = 1st HD , 1st Partition
(hd0,1) = 1st HD , 2nd Partition
(hd1,2) = 2st HD , 3st Partition
Should GRUB ever become corrupted, you can reinstall is using the grub-install command on the system or within System Rescue.
For example, to install GRUB Stage1 on the 1st SATA HD you’d enter the command :
[root@server ~]# grub-install /dev/sda
Should GRUB ever become corrupted, you can reinstall is using the grub-install command on the system or within System Rescue.
For example, to install GRUB Stage1 on the 1st SATA HD you’d enter the command line:
[root@server ~]# grub-install /dev/sda
You can also use :
[root@server ~]# grub-install /dev/sda1
This is used to install GRUB Stage 1 to the front of the 1st primary part of the HD.


LILO

This is the traditional boot loader for Linux.
No longer supported.
Often found on distros which require a smaller boot loader, as well as legacy distros.
Can reside on the first sector of an active Linux partition, as with GRUB can be found in the MBR/GPT of the HD. When this is the case, when the computer completes the POST and locates LILO, a LILO boot : prompt appears.
Hitting <TAB> will display a list of OSs to boot.
A list of common /etc/lilo.conf keywords used to edit that file can be found on on page 353 of your book.
As robust as LILO is from time to time you may encounter a problem during loading. When this happens you’ll get an error code representing the problem.
A list of commmon LILO error messages can be found on page 354 of your book.


Dual Booting Linux

Dual booting is the ability to boot to one of several different Oss which may be available on your computer. Basically the ability to boot a Linux system on the same computer you might also want to use to boot Win 7..or XP.
You can dual boot using either GRUB or LILO.
The recommended procedure to install the other OS(s) prior to installing Linux.
The reason behind this is that Linux will detect the other OS(s) and place the appropriate entry into the boot loader config file.
LILO cannot boot load the Window kernel directly.
It needs the other= 'keyword' in the /etc/lilo.conf file to tell it where to find the boot loader for Windows.
By adding optional this prevents the GRUB boot loader from looking for a Linux kernel. This is also followed by the label keyword which just IDs the OS being loaded should you his the <TAB> key at the LILO prompt.

Alternate way to Dual Boot

You can use a Windows Boot Loader (WBL) the same way you can use a Linux Boot Loader.
As it’s not designed to boot the Linux kernel, you need to go into the WBL and modify some some components
This can be a bit involved so easier to just install Linux after any other OSs you may also want to Dual Boot.
Page 358 details what you would need to do if this is how you want to dual boot.


Linux Initialization

After the boot loader loads the Linux OS kernel into memory, the kernel resumes control and executes the first daemon, called init, on the system.
Remember: A daemon is a Linux system process that provides a certain service.
The init daemon uses configuration file, /etc/initab (short for “init table”) to determine the number of daemons that needs to be loaded on the system.
The init daemon is responsible for uploading daemons that are loaded into memory when the system is halted or rebooted.


Runlevels

The init daemon often has to manage several daemons at once.
Each category is categorized into Runlevels.
What is a runlevel? A runlevel defines the number and type of daemons that are loaded into memory and executed by the kernel on a particular system.
They are seven standard runlevels:
0 ... Transitional, Shuts down the system.
Should completely power down the system.
1, s, or S ... Single user mode.
Used for low-level system maintenance impaired by normal system operation.
2 ... Full muti-user mode with a graphical login.
Used on Debian
3 ... Full multi-user mode with a console login.
Used on Fedora, Mandriva, Red Hat, and most other distributions.
4 ... Undefined by default
Used for customization
5 ... Same as runlevel 3 with the addition of having X run with XDM (graphical) login.
6 ...Used to reboot the system.
Also a transitional runlevel.
To check out the current and/or previous runlevel.
Type the runlevel command.
[root@server1 ~1] # runlevel
N 5
[root@server1 ~1] # _
N=nonexistent
5= current runlevel.
To change the runlevel from 5 to 1 type command
[root@server1 ~1] # runlevel
N 5
[root@server1 ~1] # init 1
If you’re in single mode and you want to change the runlevel from 1 back to 5. Type the following command.:
[root@server1 ~1] # init 5
The results are
[root@server1 ~1] # _
[root@server1 ~1] # runlevel
S 5
[root@server1 ~1] # _


Notice that the runlevel command displays the most current and most recent runlevel.
Unless you specify, the init daemon will run the default runlevel indicated in the /etc/inittab file.


Runtime config scripts

Scripts that run during the boot process. The purpose is to start daemons and bring the system to a useable state.


Configuring Daemon Setup

Points to the appropriate scripts within the /etc/rc.d/init.d directory.
Most Daemon scripts accept the arguments start, stop, and restart.
After system startup you can execute them directly from the /etc/rc.d/init.d directory.
[root@server1 ~] # /etc/rc.d/init.d/crond restart
Stopping crond :
Stopping crond :
[root@server1 ~] # _
Or you can use the service command to start, stop or restart any daemons listed in the /etc/rc.d/init.d directory. To restart the crond daemon type this.
[root@server1 ~] # service cond restart
Stopping crond :
Stopping crond :
[root@server1 ~] # _
To view and modify daemons that are started in each runlevel, you can use the chkconfig command.
The chkconfig command views and manipulates the appropriate runtime configuration files in the /etc/rc.d/rc*.d directories.
For example the following command indicates the ntpd daemon is not started in any runlevel,
[root@server1 ~] # chkconfig – list ntpd
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@server1 ~] # _
To configure the ntpd daemon to start in runlevels 3 and 5, and to verify the results, you could run the following commands.
[root@server1 ~] # chkconfig – level 35 ntpd on
[root@server1 ~] # chkconfig – list ntpd
ntpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@server1 ~] # _


X Windows System

Components of the Linux GUI
Graphical Programs (X Clients)
Desktop environment
Window Manager
X Windows
Video Hardware

X Windows

Developed by Digital Equipment Corporation (DEC) and Massachusetts Institute of Technology (MIT) in 1984
Maintained as Open Source Software by the X.Org Foundation
The freely available version used in may Linux distributions is called XFree86


Windows Manager and Desktop Environs

Window managers are used to modify the look and feel of X Windows.
Common windows managers can be found on page 370 of your book.
K Desktop Environment (KDE)
Released in 1996
Uses K Window Manager (kwin) and Qt toolkit
GNOME
Created in 1997
Uses Metacity Window Manager and GTK+ toolkit


Starting and Stopping X Windows

  • GNOME Display Manager writes the chosen desktop environment in the Session menu to a .dmrc (display manager runtime configuration) file. /home/user1/.dmrc file
[user1@server1 ~]# cat . dmrc
[Desktop]
Session=kde
[user1@server1 ~]#_
  • Root user in not allowed to log into GNOME Display Manager by default.
/etc/pam.d/gdm and /etc/pam.d/gdm-password
  1. auth required pam_succeed_if.so user !=root quiet
  • GNOME Display Manager can be start manually using the gdm command


Configuring X Windows

X.Org configuration file is /etc/X11/xorg.conf
XFree86 configuration file is /etc/X11/XF86Config
Mouse-test
System-config-keyboard command
System-config-display
Xvidtune to fine tune vertical and horizontal refresh rate.

Information complied by Robert Klaers, LaPrice Ali, & Sean Benecker