User:Klae0010: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
'''Chpt 5 Study Guide''' | '''Chpt 5 Study Guide''' | ||
== Boot Process == | |||
== Boot Process *(pg. 240) == | |||
''System power > CPU looks for BIOS > CPU Runs Bios'' | ''System power > CPU looks for BIOS > CPU Runs Bios'' | ||
Line 11: | Line 13: | ||
=== Retrieving Information about the boot process === | === Retrieving Information about the boot process *(pg. 239)=== | ||
: Certain information about the Linux kernel and module log info can be found in the kernel ring buffer. | : Certain information about the Linux kernel and module log info can be found in the kernel ring buffer. | ||
: This info is displayed during the boot process, but is shown too fast to be read. | : This info is displayed during the boot process, but is shown too fast to be read. | ||
Line 18: | Line 20: | ||
:: '''#dmesg > boot.messages''' | :: '''#dmesg > boot.messages''' | ||
=== Locating and Interpreting Boot Messages === | === Locating and Interpreting Boot Messages (pg. 239) === | ||
: Use ''less'' and it’s search functions | : Use ''less'' and it’s search functions | ||
: Look for hardware type names | : Look for hardware type names | ||
Line 24: | Line 26: | ||
: Study output from a working system | : Study output from a working system | ||
== Installing Boot Loaders == | == Installing Boot Loaders (pg. 226) == | ||
:: The master boot record (MBR) contains a partition table and a boot loader (aka ''boot manager''). The boot loader is | :: The master boot record (MBR) contains a partition table and a boot loader (aka ''boot manager''). The boot loader is | ||
:: software which the BIOS reads and executes when the system begins to boot | :: software which the BIOS reads and executes when the system begins to boot | ||
Line 30: | Line 32: | ||
=== Two main boot loaders for Linux === | === Two main boot loaders for Linux === | ||
==== '''LILO''' ''(Linux Loader)'' ==== | ==== '''LILO''' ''(Linux Loader)'' (pg. 228)==== | ||
:: ''Once the default boot loader.'' | :: ''Once the default boot loader.'' | ||
:: ''Slowly being overtaken by GRUB.'' | :: ''Slowly being overtaken by GRUB.'' | ||
Line 52: | Line 54: | ||
==== '''GRUB''' ''(Grand Unified Boot Loader)'' ==== | ==== '''GRUB''' ''(Grand Unified Boot Loader)'' (pg. 233) ==== | ||
:: ''Has taken over as default boot loader for many LINUX distributions'' | :: ''Has taken over as default boot loader for many LINUX distributions'' | ||
:: ''Offers more configurations than LILO'' | :: ''Offers more configurations than LILO'' | ||
::: GRUB has some ‘quirks’ | ::: GRUB has some ‘quirks’ | ||
:::: Unlike Linux, GRUB numbers drives. | :::: Unlike Linux, GRUB numbers drives. | ||
::: Instead of '''/dev/hda''' .. It would be '''/dev/hd0''' | :::: Instead of '''/dev/hda''' .. It would be '''/dev/hd0''' | ||
::: Doesn’t distinguish between PATA, SATA, or SCSI drives. | :::: Doesn’t distinguish between PATA, SATA, or SCSI drives. | ||
::: GRUB also numbers partitions on a drive starting with '''0''', instead of '''1''' | :::: GRUB also numbers partitions on a drive starting with '''0''', instead of '''1''' | ||
:::: So partition 1 on drive 1 would look like this '''(hd0,0)''' | ::::: ''So partition 1 on drive 1 would look like this '''(hd0,0)''''' | ||
:::: Floppy devices are referred to as '''(fd0)''' | ::::: ''Floppy devices are referred to as '''(fd0)''''' | ||
:: '''Global Options''' | :: '''Global Options''' | ||
Line 72: | Line 74: | ||
::: Kernel Specification | ::: Kernel Specification | ||
== Runlevels And Initialization Process == | == Runlevels And Initialization Process (pg. 241) == | ||
: Linux relies on runlevels to determine which features are available. | : Linux relies on runlevels to determine which features are available. | ||
: Run levels are labels 0 thru 6. Each one being assigned to a set of services that should be active. | : Run levels are labels 0 thru 6. Each one being assigned to a set of services that should be active. | ||
Line 82: | Line 84: | ||
: This is done by inspecting the '''/etc/initab''' file with the ''less'' command or opening it in an editor. | : This is done by inspecting the '''/etc/initab''' file with the ''less'' command or opening it in an editor. | ||
=== Managing Runlevels === | === Managing Runlevels (pg. 245) === | ||
: '''Chkconfig''' | : '''Chkconfig''' | ||
:: Lists the services and their runlevels. | :: Lists the services and their runlevels. | ||
Line 89: | Line 91: | ||
:: Used mainly on Red Hat | :: Used mainly on Red Hat | ||
:: Interactive text tool | :: Interactive text tool | ||
:: Use your arrow keys to select a service. | :: Use your arrow keys to select a service. space bar to toggle the service on or off. | ||
:: Use the '''--level''' option to select other or multiple runlevels. | |||
=== Runlevels === | === Runlevels (pg. 242) === | ||
: '''0''' ... ''Transitional, Shuts down the system.'' | : '''0''' ... ''Transitional, Shuts down the system.'' | ||
::''Should completely power down the system.'' | ::''Should completely power down the system.'' | ||
Line 119: | Line 122: | ||
== Runlevel Services == | == Runlevel Services (pg.243) == | ||
=== Two main ways to affect what programs run as you enter a new runlevel.=== | === Two main ways to affect what programs run as you enter a new runlevel.=== | ||
:: '''/etc/inittab''' | :: '''/etc/inittab''' | ||
:: | ::: ''Id:runlevels:action:process'' | ||
::: Identification code | |||
::: Consists of a sequence of 1-4 characters to identify its function | |||
: ''Id:runlevels:action:process'' | ::: Applicable runlevels | ||
:: Identification code | ::: List of runlevels for which this entry applies. | ||
:: Consists of a sequence of 1-4 characters to identify its function | ::: Action to be taken | ||
:: Applicable runlevels | ::: Tells init how to treat the function. | ||
:: List of runlevels for which this entry applies. | ::: Process to run | ||
:: Action to be taken | ::: Process to run for this entry. | ||
:: Tells init how to treat the function. | ::: Includes options and arguments | ||
:: Process to run | |||
:: Process to run for this entry. | |||
:: Includes options and arguments | |||
:: '''SysV''' (pg.244) | |||
::: Controls what startup scrips start or stop services depending on the parameters that are passed. | |||
:'''S''' ...''rc passes the start parameter to all scrips that begin with the letter '''S'''.'' | :::'''S''' ...''rc passes the start parameter to all scrips that begin with the letter '''S'''.'' | ||
:'''K''' ...''rc passes the stop services to all scrips that begin with the letter '''K'''.'' | :::'''K''' ...''rc passes the stop services to all scrips that begin with the letter '''K'''.'' | ||
== Vi == | == Vi (pg. 250) == | ||
: ''First full-screen text editor built for linux.'' | |||
: ''Used for a emergency recovery situations.'' | |||
: ''Small and simple.'' | |||
: ''Can fit on a floppy disk.'' | |||
: ''3 modes of operation.'' | |||
=== Vi Modes === | === Vi Modes === | ||
Line 172: | Line 171: | ||
=== Using Vi === | === Using Vi === | ||
: Use vi [file name] to launch Vi | |||
: Ex. '''vi lilo.conf''' | :: Ex. '''vi lilo.conf''' | ||
==== Command mode ==== | ==== Command mode ==== | ||
Line 207: | Line 205: | ||
:: ''':%s/[oringinal string]/[replacement]''' | :: ''':%s/[oringinal string]/[replacement]''' | ||
::: Replaces all occurrences of one string with another. | ::: Replaces all occurrences of one string with another. | ||
'''NOTE''' : ''all page numbers reference the CompTIA Linux+ Complete Study Guide by Roderick W. Smith ISBN 978-0-470-88845-2'' | |||
==Wiki page credit== | |||
==== All info compiled, edited and coded by : Rob Klaers and Josh Motz ==== |
Revision as of 04:37, 1 March 2011
Chpt 5 Study Guide
Boot Process *(pg. 240)
System power > CPU looks for BIOS > CPU Runs Bios
- BIOS checks for new hardware, configure hardware, and looks for boot sector.This is when the BIOS finds the boot loader in
- the boot sector.Boot loader takes over from BIOS. If a multistage loader is available, a secondary loader is searched for.
- Finally, the boot loader finds the kernel, loads it into memory and then executes it. Once the LINUX kernel takes over, it then
- begins to initial devices, mounting root partition and other such tasks.The initial program is also started at this stage.It
- gets a process ID of 1 because it’s the first program run on the system.
Retrieving Information about the boot process *(pg. 239)
- Certain information about the Linux kernel and module log info can be found in the kernel ring buffer.
- This info is displayed during the boot process, but is shown too fast to be read.
- To access this info type the following command..
- #dmesg | less
- #dmesg > boot.messages
Locating and Interpreting Boot Messages (pg. 239)
- Use less and it’s search functions
- Look for hardware type names
- Look for hardware chipset names
- Study output from a working system
Installing Boot Loaders (pg. 226)
- The master boot record (MBR) contains a partition table and a boot loader (aka boot manager). The boot loader is
- software which the BIOS reads and executes when the system begins to boot
Two main boot loaders for Linux
LILO (Linux Loader) (pg. 228)
- Once the default boot loader.
- Slowly being overtaken by GRUB.
- Small, and useful.
- Can be configured using the /etc/lilo.conf file.
- Which is broken into two main sections :
- Global options
- Boot loader location
- Default stanza
- Boot prompt
- Boot timeout
- Per-Image
- Kept in sections known as stanzas.
- Can also be further separated depending on if they’re for a kernel or OS.
- Linux Boot Image
- Non-Linux Boot Partition
- OS Label
- RAM Disk
- Global options
GRUB (Grand Unified Boot Loader) (pg. 233)
- Has taken over as default boot loader for many LINUX distributions
- Offers more configurations than LILO
- GRUB has some ‘quirks’
- Unlike Linux, GRUB numbers drives.
- Instead of /dev/hda .. It would be /dev/hd0
- Doesn’t distinguish between PATA, SATA, or SCSI drives.
- GRUB also numbers partitions on a drive starting with 0, instead of 1
- So partition 1 on drive 1 would look like this (hd0,0)
- Floppy devices are referred to as (fd0)
- GRUB has some ‘quirks’
- Global Options
- Default OS
- Timeout
- Background Graphic
- Per Image Options
- Title
- GRUB root
- Kernel Specification
- Global Options
Runlevels And Initialization Process (pg. 241)
- Linux relies on runlevels to determine which features are available.
- Run levels are labels 0 thru 6. Each one being assigned to a set of services that should be active.
- Understanding the purpose of runlevels makes for identifying services that are active easier.
Checking runlevel
- Generally done prior to changing or to check status if something isn’t working
- This is done by inspecting the /etc/initab file with the less command or opening it in an editor.
Managing Runlevels (pg. 245)
- Chkconfig
- Lists the services and their runlevels.
- Ex. Chkconfig –list
- Lists the services and their runlevels.
- ntsysv
- Used mainly on Red Hat
- Interactive text tool
- Use your arrow keys to select a service. space bar to toggle the service on or off.
- Use the --level option to select other or multiple runlevels.
Runlevels (pg. 242)
- 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.
Determining Current Runlevel
- Once system is up and running runlevel info can be checked by entering :
- # runlevel
- N 2
- # runlevel
- The first character is the previous runlevel.
- N = system hasn’t changed runlevel since starting
- 2 = is the current runlevel
Changing runlevels on a running system
This can be done with the init (or telinit), shutdown, halt, reboot, or poweroff commands.
Runlevel Services (pg.243)
Two main ways to affect what programs run as you enter a new runlevel.
- /etc/inittab
- Id:runlevels:action:process
- Identification code
- Consists of a sequence of 1-4 characters to identify its function
- Applicable runlevels
- List of runlevels for which this entry applies.
- Action to be taken
- Tells init how to treat the function.
- Process to run
- Process to run for this entry.
- Includes options and arguments
- /etc/inittab
- SysV (pg.244)
- Controls what startup scrips start or stop services depending on the parameters that are passed.
- S ...rc passes the start parameter to all scrips that begin with the letter S.
- K ...rc passes the stop services to all scrips that begin with the letter K.
- SysV (pg.244)
Vi (pg. 250)
- First full-screen text editor built for linux.
- Used for a emergency recovery situations.
- Small and simple.
- Can fit on a floppy disk.
- 3 modes of operation.
Vi Modes
- Command mode
- Accepts single letter commands.
- i and a = enter insert mode
- o =opens a line below the current one.
- Ex mode
- Used to manipulate and save current flies and run outside programs.
- Type :x from command mode to enter Ex mode.
- x = the command you want to use.
- Automatically returns to command mode when finished.
- Also referred to as colon commands
- Insert mode
- Used to enter text.
- Most input results in text appearing on the screen.
- Use Esc key to return to command mode.
Using Vi
- Use vi [file name] to launch Vi
- Ex. vi lilo.conf
Command mode
- The up, down, left, and right keys are used to move the curser.
- yy and dd to yank (copy) text to a buffer.
- dd also deletes the lines that are yanked.
- Extentions of the y and d commands.
- p is used to paste the contents of the buffer.
Ex mode
- :w saves the file.
- :q quits vi
- Only works if the changes have been saved or used with !. (Ex. :q!)
- :e edits a new file
- Ex. :e /etc/inittab loads /etc/inittab for editing.
- Only works if existing file has been saved or used with an !. (Ex. :e! /etc/inittab)
- :![command] executes the external command.
- Ex. :!ls executes the list command.
Insert mode
- In command mode you can use R, i, and a to enter insert mode.
- R - Enters text replacement.
- Replace appears in the status line.
- i - Enters text insertion
- a - Enters text insertion but advances the curser one space.
- Can be useful at the end of a line
- ~ - Used to change the case of a single word.
- u - Undo’s any changes
- o - Opens any text.
- It inserts a new line below the current line while entering insert mode on that line.
- G - Goes to a specific line.
- :%s/[oringinal string]/[replacement]
- Replaces all occurrences of one string with another.
- R - Enters text replacement.
NOTE : all page numbers reference the CompTIA Linux+ Complete Study Guide by Roderick W. Smith ISBN 978-0-470-88845-2