User talk:Klae0010: Difference between revisions
(Created page with "Session 9: July 13 Topics: DNS Services DHCP Services Readings: Chapter 16 Chapter 27") |
No edit summary |
||
Line 1: | Line 1: | ||
Chapter 8 – System initialization and X-Windows | |||
---- | |||
Subjects covered: | |||
== Boot Process== | |||
== Boot Loaders== | |||
=== GRUB=== | |||
=== LILO=== | |||
=== Dual Booting Linux=== | |||
== Linux Initialization== | |||
=== Runlevels=== | |||
=== /etc/inittab file=== | |||
=== Runtime config scripts=== | |||
=== Configuring Daemon Setup=== | |||
== X Windows System== | |||
=== X Windows=== | |||
=== Windows Manager and Desktop Environs=== | |||
=== Starting and Stopping X Windows=== | |||
== Configuring 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 | |||
o Typically floppy disks, CDs, DVDs, and USB devices are checked as they can contain installation media for an OS. | |||
o If an OS isn’t found, the BIOS will check the MBR/GPT on the first HD. | |||
o 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.* | |||
Boot loader – main purpose is to load the OS kernel into memory. | |||
*NOTE: There can only be one active partition per HD. | |||
o 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. | |||
o After loading the kernel, the boot loader becomes inactive. | |||
o Kernel continues by loading daemons into memory | |||
o Daemons are a system process which performs tasks such as printing scheduling, and OS maintenance. | |||
o 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. | |||
o Using a boot loader to boot one of several OS’s is known as dual booting. | |||
Two common boot loaders are : | |||
GRUB (Grand Unified Bootloader) - most common | |||
LILO – (Linux Loader) – Traditional boot loader | |||
GRUB | |||
Only boot loader supported by Fedora 13. | |||
• 3 Stages | |||
o Stage 1 : Generally resides in MBR/GPT and points to Stage 1.5 | |||
o Stages 1.5 : Resides in the /boot/grub directory and loads the file support and loads Stage 2 | |||
o 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 | |||
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, the computer completes the POST and locates LILO, a LILO boot : prompt appears. | |||
Hitting <TAB> will display a list of OSs to boot. | |||
Following this – enter the name of the OS you want or hit <Enter> for the default Linux OS. | |||
See page for lilo/lilo.conf keywords. | |||
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. | |||
Dual Booting | |||
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. | |||
Alternative Way to Dual-Boot | |||
You can use a Windows Boot Loader the same way you can use a Linux Boot Loader. | |||
Need to modify the Windows boot loader, as it’s not designed to boot the Linux kernel. | |||
This can be a bit involved so easier to just install Linux after any other OSs you may also 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. | |||
The init daemon often has to manage several daemons at once. | |||
Each category is categorized into Runlevels. | |||
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 which can be views on page ??? of your book. | |||
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 Configuration Scripts | |||
Scripts that run during the boot process. The purpose is to start daemons and bring the system to a useable state | |||
Configuring Daemon Startup | |||
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 | |||
Developed by Digital Equipment Corporation (DEC) and Massachusetts Institute of Technology (MIT) in 1984 | |||
Is maintained as Open Source Software by the X.Org Foundation | |||
The freely available version used in may Linux distributions is called XFree86 | |||
Window Managers and Desktop Environments | |||
Window managers are used to look and feel of X Windows. | |||
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 | |||
# 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. |
Revision as of 23:42, 15 March 2012
Chapter 8 – System initialization and X-Windows
Subjects covered:
Boot Process
Boot Loaders
GRUB
LILO
Dual Booting Linux
Linux Initialization
Runlevels
/etc/inittab file
Runtime config scripts
Configuring Daemon Setup
X Windows System
X Windows
Windows Manager and Desktop Environs
Starting and Stopping X Windows
Configuring 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
o Typically floppy disks, CDs, DVDs, and USB devices are checked as they can contain installation media for an OS.
o If an OS isn’t found, the BIOS will check the MBR/GPT on the first HD.
o 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.*
Boot loader – main purpose is to load the OS kernel into memory.
- NOTE: There can only be one active partition per HD.
o 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. o After loading the kernel, the boot loader becomes inactive. o Kernel continues by loading daemons into memory o Daemons are a system process which performs tasks such as printing scheduling, and OS maintenance. o 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. o Using a boot loader to boot one of several OS’s is known as dual booting. Two common boot loaders are : GRUB (Grand Unified Bootloader) - most common LILO – (Linux Loader) – Traditional boot loader
GRUB Only boot loader supported by Fedora 13. • 3 Stages o Stage 1 : Generally resides in MBR/GPT and points to Stage 1.5 o Stages 1.5 : Resides in the /boot/grub directory and loads the file support and loads Stage 2 o 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
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, the computer completes the POST and locates LILO, a LILO boot : prompt appears.
Hitting <TAB> will display a list of OSs to boot.
Following this – enter the name of the OS you want or hit <Enter> for the default Linux OS.
See page for lilo/lilo.conf keywords.
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.
Dual Booting
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.
Alternative Way to Dual-Boot
You can use a Windows Boot Loader the same way you can use a Linux Boot Loader.
Need to modify the Windows boot loader, as it’s not designed to boot the Linux kernel.
This can be a bit involved so easier to just install Linux after any other OSs you may also 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.
The init daemon often has to manage several daemons at once.
Each category is categorized into Runlevels.
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 which can be views on page ??? of your book.
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 Configuration Scripts
Scripts that run during the boot process. The purpose is to start daemons and bring the system to a useable state
Configuring Daemon Startup
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
Developed by Digital Equipment Corporation (DEC) and Massachusetts Institute of Technology (MIT) in 1984 Is maintained as Open Source Software by the X.Org Foundation The freely available version used in may Linux distributions is called XFree86
Window Managers and Desktop Environments
Window managers are used to look and feel of X Windows.
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
- 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.