Week Nine Agenda

50

description

Week Nine Agenda. Announcements Final exam will be longer, and more specific Document your text files (4 th _log.txt, startup.txt) Link of the week Review week eighth lab assignment Week nine expected outcomes Next lab assignment Break-out problems Upcoming deadlines - PowerPoint PPT Presentation

Transcript of Week Nine Agenda

Page 1: Week Nine Agenda
Page 2: Week Nine Agenda

Week Nine Agenda• Announcements

Final exam will be longer, and more specific• Document your text files (4th_log.txt, startup.txt)• Link of the week• Review week eighth lab assignment• Week nine expected outcomes• Next lab assignment• Break-out problems• Upcoming deadlines• Lab assistance, questions, and answers

Page 3: Week Nine Agenda

Link of the weekhttp://en.wikipedia.org/wiki/FirmwareThis Web site contains information on:

- Evolved firmware uses- Firmware and device drivers- Firmware support challenges in PCs- Firmware hacking

http://www.driver-fix.com/driverdetective.php?t=FirmwareDiverDetective

Download driver updates automatically and safely. This software utility will keep your system up-to-date by automatically retrieving the latest drivers from your hardware’s manufacturer.

Page 4: Week Nine Agenda

Link of the weekDefine Firmware: A computer program that is embedded in the

hardware device. Firmware can be stored in flash memory or as a binary image file that can be uploaded onto existing hardware by a user. In summary, firmware is a combination of hardware and software.

Firmware applications include the following:- BIOS found in IBM-compatible PCs.- Open Firmware, used in computers

marketed by Sun Microsystems and Apple Computers.

- Computer peripherals- The iPod’s control menus.- Automobiles employed on-board computer and

various sensors.- Cisco IOS

Page 5: Week Nine Agenda

Application

Kernel

Firmware

CPU

Memory

Concentric Circle Relationship

Devices

Page 6: Week Nine Agenda

Review eighth week lab assignmentAmerican National Standards Institute (ANSI) (1918)• Mission

To enhance both the global competitiveness of U.S. business and the U.S. quality of life by promoting and facilitating voluntary consensus standards and conformity assessment systems, and safeguarding their integrity.

• Membership: Comprised of Government agencies,

Organizations, Companies, Academic and International bodies, and individuals, the American National Standards Institute (ANSI) represents the interests of more than 125,000 companies and 3.5 million professionals.

Page 7: Week Nine Agenda

Review eighth week lab assignment• ANSI is the official U.S. representative to the

International Organization for Standardization (ISO).

• The American National Standards Institute has served since 1918 as administrator and coordinator of the United States private sector voluntary standardization system.

Page 8: Week Nine Agenda

Review eighth week lab assignmentLinux

/etc/sysconfig

The /etc/sysconfig directory contains files that control the system configuration.

/etc/sysconfig/clock

Used to configure the system clock to Universal Time and other clock parameters.

/etc/sysconfig/init

This file controls how the system will appear and function during the boot process..

Page 9: Week Nine Agenda

Review eighth week lab assignment

/etc/sysconfig/keyboard

Used to configure the keyboard.

/etc/sysconfig/mouse

This file is used to specify information about the available mouse.

/etc/sysconfig/network

Used to configure networking options.

/etc/rc.d/rc.local

This file is executed after the other init scripts. Put commands that performs some system customization.

Page 10: Week Nine Agenda

Review eighth week lab assignment/etc/fstab

- The fstab file is read by software applications. It is the duty of the system administrator to create and accurately maintain this file.

- Each file system is described on a separate line.

- Fields on each line are separated by tabs and spaces.

- # comments

- The order in which these records are listed is important.

Page 11: Week Nine Agenda

Review eighth week lab assignmentetc/fstab

/dev/vg00/root / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults 1 2none /dev/pts devpts gid=5,mode=620 0 0/dev/vg00/home /home ext3 defaults 1 2/dev/vg00/opt /opt ext3 defaults 1 2none /proc proc defaults 0 0none /dev/shm tmpfs defaults 0 0/dev/vg00/tmp /tmp ext3 defaults 1 2/dev/vg00/usr /usr ext3 defaults 1 2/dev/vg00/var /var ext3 defaults 1 2/dev/vg00/swap swap swap defaults 0 0/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0/dev/vg02/shome /export/home ext3 defaults 1 2#/dev/vg01/oracle /mnt/pkg1/oracle ext3 noauto 1 2#NOTICE: oracle and shome are shared storage. Make sure they are not mounted # on the other side before mounting.

Page 12: Week Nine Agenda

Review eighth week lab assignmentField description of /etc/fstab

1st field describes the block special device or remote file system to be mounted.

2nd field describes the mount point for the file system.3rd field describes the type of file system.4th field describes the mount options associated with

the file system.5th field describes which file systems will need to be

dumped by the dump() command.6th field is used by fsck to determine the order in which the file systems are checked at boot time.

Page 13: Week Nine Agenda

Review eighth week lab assignmentFile Systems

File systems are usually mounted read-only. This makes it possible to check the file system while it is mounted; it is not a good idea to check a file system that is mounted read-write.

Page 14: Week Nine Agenda

Review eighth week lab assignment

Fsck Command• Fsck utility checks the file system’s consistency,

reports any problems it finds, and optionally repairs them.

• On many legacy systems such as BSD style systems, the fsck command is invoked automatically on boots and reboots.

• Format: fsck [options] device• The kernel supports the following file systems:

Demonstrate: /proc

cat filesystems

Page 15: Week Nine Agenda

Review eighth week lab assignment

Fsck Utility

The exit code returned by fsck is the sum of the following conditions:

0 - No errors

1 - File system errors corrected

2 - System should be rebooted

4 - File system errors left uncorrected

8 - Operational error

16 - Usage or syntax error

32 - fsck canceled by user request

128 - Shared library error

Page 16: Week Nine Agenda

Review eighth week lab assignment

Fsck Phases

Fsck checks the file system in a series of 5 pages and checks a specific functionality of file system in each phase.

Phase 1 – Check Blocks and Sizes

Phase 2 – Check Pathnames

Phase 3 – Check Connectivity

Phase 4 – Check Reference Counts

Phase 5 – Check Cylinder Groups

Page 17: Week Nine Agenda

Review eighth week lab assignment

Fsck Phases

If the superblock is corrupted the file system still can be repaired using alternate superblock which are formed while making new file system .

The first alternate superblock number is 32 and others superblock numbers can be found using the following command :

newfs -N /dev/rdsk/c0t0d0s6

Page 18: Week Nine Agenda

Review week eight lab assignmentRpm Package ManagerRed Hat Package Manager (rpm) is the default

package management system for Linux Red Hat.

Free software tool which installs, updates, uninstalls, verifies and queries other software packages in this format.

Page 19: Week Nine Agenda

Review week eight lab assignment

Package Advantages

1. Used in a uniform way for the user to install programs

2. Uninstalling programs is simple

3. Non-interactive installation makes it easy to automate

4. Original source archive (e.g. .tar.gz,.tar.bz2)

5. Packages can be cryptographically verified with

AES, and MD5.

Page 20: Week Nine Agenda

Review week eight lab assignmentFile Representation

A file format is a particular way to encode information for storage in a computer file.

Disk drives or computer storage are represented in bits. A computer must convert information to 0s and 1s and vice-versa.

A computer file format can be represented as either a binary image or ASCII file.ASCII is used on most PCs and Macintoshes.

EBCDIC (Extended Binary-Coded Decimal Interchange Code is an IBM code for representing characters as numbers. IBM uses EBCDIC widely on large computers.

Page 21: Week Nine Agenda

Review week eight lab assignment

File Representation Binary image files represent 256 different

binary codes.

Page 22: Week Nine Agenda

Review week eight lab assignmentBinary image files use to be able to represent

more character codes than ASCII because eight bit bytes were used, whereas ASCII files used seven bits. Now Extended ASCII uses eight bit bytes and can represent 256 character

Executable software, mostly word processing files and databases, spread sheets and multimedia files are binary. However, text and source program files as well as HTML and XML files are ASCII.

Page 23: Week Nine Agenda

Review week eight lab assignment

The Internets SMTP mail protocol supports only ASCII. When a binary file is attached to an email message, the 8-bit format is converted to a temporary 7-bit format to pass through the mail servers. Encoding formats such as MIME, at the receiving end converts the 7-bit format back into 8-bit binary format. The 8-bit to 7-bit conversion makes files larger as they traverse the Internet.

Page 24: Week Nine Agenda

Review week eight lab assignment

Different file formats for different kinds of information.

JPEG format – designed to store static photographic images.

GIF format – designed to store still images and simple animation.

QuickTime format – designed as a container for many different types of multimedia.

Page 25: Week Nine Agenda

Week nine expected outcomes

Upon successful completion of this module, the student will be able to:

• Analyze processes of startup and shutdown. • Apply startup scripts and controls to tune

system. • Describe basic "autonomous" processes in

UNIX.

Page 26: Week Nine Agenda

Next Lab AssignmentInitializing or Booting a System

1. CPU is pre-set to RESET mode2. CPU pre-programmed to seek 0xfffffff0 address

location3. BIOS reads MBR (Track 0, Sector 1)4. First part of MBR contains the boot partition

table and executable code5. Second part of the MBR is used to locate the

boot loader. It resides on the “active” partition known as the Boot Sector.

6. Device drivers are loaded (initrd-2.4.20-8.img)7. Kernel is invoked8. Init process invoked

Page 27: Week Nine Agenda

Next Lab AssignmentLinux Boot Procedure

1. The system startup stage depends on the hardware device that Linux is being booted on. Floppy disk, CD-ROM, a partition on a hard disk, a

device on the network, or a USB flash memory stick. Linux is usually booted from a hard disk.

2. After the system locates the boot device, the first part of the boot loader is loaded into RAM and executed. Normally, the first part of the boot loader is less than 512 bytes and is responsible for loading the second part of the boot loader.

Page 28: Week Nine Agenda

Next Lab AssignmentLinux Boot Procedure

3. The first 446 bytes are considered the primary boot loader, which contains both executable code

and error message text.

4. The second sixty four bytes are the partition tables, which contains a record for each of the four

partitions.

5. The last two bytes are the magic number which serves as a validation check of the Master Boot Record (MBR).

Page 29: Week Nine Agenda

Next Lab AssignmentLinux Boot Procedure

6. When the second part of the boot loader is loaded into RAM and executed, a

pop up

screen displays Linux and the optional initial

RAM being loaded into memory.

7. The second part of the boot loader is called the

kernel loader. After the boot images are loaded,

the second part of the boot loader passes

control to the kernel image. At this point, the

kernel is decompressed and initialized.

Page 30: Week Nine Agenda

Next Lab Assignment

Linux Boot Procedure

8. The second part of the boot loader checks the system hardware, lists attached hardware

devices, mounts the root device, and loads the

kernel modules.

Page 31: Week Nine Agenda

Next Lab Assignment

Master Boot Record (MBR) The MBR is not located in a partition, it is located at a Main Boot Record area in front of the first partition.

When a data storage device has been partitioned with the MBR Partition Table scheme the master boot record contains the primary partition entries in its partition table.

By convention, there are exactly four primary partition table entries in the MBR Partition Table scheme.

Page 32: Week Nine Agenda

Next Lab Assignment

Boot Loaders

The following directory contains the different Linux boot loader and alternate loaders:

Demonstrate: /boot/grub

The Linux Loader (LILO) is the combination of parts one and two boot loaders. Because of some disadvantages in the LILO loader, the GRand Unified Bootloader (GRUB) has become more widely used.

Page 33: Week Nine Agenda

Next Lab Assignment

Kernels

Display a list of available kernels with soft links from /etc/grub.conf and /boot/grub/menu.1st.

Demonstrate: /etc/grub.conf

This is a symbolic link to /boot/grub/grub.conf

Page 34: Week Nine Agenda

Next Lab Assignment

Init Process

Location: /sbin/init

First process to execute in user space

Executes: background

Process ID: 1 (one)

Parent Process ID: 0 (zero)

Owner: root

Demonstrate: pid_ppid.sh (use two putty windows)

Highlight the relationship of the init process to all other executing processes.

Page 35: Week Nine Agenda

Next Lab Assignment# inittab This file describes how the INIT process

should set up the system for a specific run-level.

# Author: Miquel van Smoorenburg, <[email protected]>

# Modified for RHS Linux by Marc Ewing and Donnie Barnes

Page 36: Week Nine Agenda

Next Lab Assignment# 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)

Page 37: Week Nine Agenda

Next Lab Assignmentid:3:initdefault:

# System initialization.

si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0

l1:1:wait:/etc/rc.d/rc 1

l2:2:wait:/etc/rc.d/rc 2

l3:3:wait:/etc/rc.d/rc 3

l4:4:wait:/etc/rc.d/rc 4

l5:5:wait:/etc/rc.d/rc 5

l6:6:wait:/etc/rc.d/rc 6

Page 38: Week Nine Agenda

Next Lab Assignment# Trap CTRL-ALT-DELETE

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes

# of power left. Schedule a shutdown for 2 minutes from now.

# This does, of course, assume you have powerd installed and your

# UPS connected and working correctly.

pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down“

Page 39: Week Nine Agenda

Next Lab Assignment# If power was restored before the shutdown kicked in,

cancel it.

pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled“

# Run gettys in standard runlevels

1:2345:respawn:/sbin/mingetty tty1

2:2345:respawn:/sbin/mingetty tty2

3:2345:respawn:/sbin/mingetty tty3

###4:2345:respawn:/sbin/mingetty tty4

###5:2345:respawn:/sbin/mingetty tty5

###6:2345:respawn:/sbin/mingetty tty6

Page 40: Week Nine Agenda

Next Lab Assignment# Run xdm in runlevel 5

x:5:respawn:/etc/X11/prefdm -nodaemon

Page 41: Week Nine Agenda

Next Lab Assignment

Linux Performance Tools

sar command is performance monitoring tool. It can find out what Linux is doing all the time. It can generate report and email them to sys admin.

vmstat command that reports information about processes, memory, paging, block IO, traps, and cpu activity.

free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel.

Page 42: Week Nine Agenda

Next Lab Assignment

Linux Performance Tools

iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates i.e. it is useful to monitor disk throughput.

Page 43: Week Nine Agenda

Next Lab AssignmentLinux system run level modes

0 - Halt system1 – Single user2 – Multi-user mode3 – Full multi-user 4 – unused5 – X116 - Reboot

Shutdown commandshutdown

Review the Startup/Shutdown lab assignment

Page 44: Week Nine Agenda

Next Lab Assignment/etc/rc.d

init.d rc0.d rc2.d rc4.d rc6.d rc.sysinit

rc rc1.d rc3.d rc5.d rc.local

/etc

rc rc4.d init.d

rc0.d rc5.d rc.sysinit

rc1.d rc6.d

rc2.d rc.d

rc3.d rc.local

Page 45: Week Nine Agenda

Next Lab AssignmentActivities managed by the kernel

Responsive - users

Autonomous - daemons

The kernel consists of a collection of low level procedures. These procedures are called system calls and they are the primary means for a program to interact with other parts of the system.

Explain the difference between the K and S as a script prefix.

Demonstrate

Execution of the newuid.pl and process.sh scripts

Provide examples of pids and ppids (pid_ppid.sh)

Page 46: Week Nine Agenda

Next Lab AssignmentShell Commands

df (disk space usage)df –i (file system inode utilization)history (list commands previously input)tail (read records at end of file)head (read records at start of file)

Page 47: Week Nine Agenda

Break-out problems• What functionality does the mingetty or getty perform? • Define the kernel responsive and autonomous functions?• What system functionality does the /etc/fstab file provide?• What is the functionality does the /etc/sysconfig directory

provide?• What functionality does the /etc/inittab file provide?• Commands

ls -liwho -rkillkill –luptimewtelinitsleep

Page 48: Week Nine Agenda

Upcoming deadlinesLab Assignment 13-1 Public Domain/Open Software

Evaluation

Bulletin Board: Open Source Presentation Sign Up

No two presentations shall be the same.

Lab assignment grade components.

Paper: 0 – 75 points

Presentation 0 – 25 points

Presentation dates:

December 5 (week 14)

December 12 ( week 15)

Page 49: Week Nine Agenda

Upcoming deadlines

• Lab Assignment 9-1, Startup/Shutdown due November 13, 2011

• Lab Assignment 10-1 and 10-2, Account/LDAP and Process Exercise Scripts due November 20, 2011.

• Lab Assignment 11-1, Knoppix File System Exercise is due November 27, 2011

• Final exam outline will be available on December 4, 2011.

• Module 5, System Startup and Shutdown is for week 9.

Page 50: Week Nine Agenda

Lab assistance, questions and answers

• Questions• Comments• Concerns

• I am available after this Franklin Live session to discuss any problems and/or concerns regarding the lab assignments