Top Banner
63

Agenda

Mar 17, 2016

Download

Documents

aulani

Agenda. Administrative Issues Link of the Week This Week’s Expected Outcomes Review for midterm exam Moving around in UNIX Break-Out Problems Upcoming Deadlines Hands-on Information Lab Assistance, Questions, and Answers. Announcements - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Agenda
Page 2: Agenda

Agenda

Administrative IssuesLink of the WeekThis Week’s Expected OutcomesReview for midterm examMoving around in UNIXBreak-Out ProblemsUpcoming DeadlinesHands-on InformationLab Assistance, Questions, and Answers

Page 3: Agenda

AnnouncementsAnnouncements

AnnouncementsSign up for your open source topic if you have not

done so yet.Final exam April 14 through 19.

Page 4: Agenda

Link of the weekLink 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 5: Agenda

Link of the weekLink of the weekFirmware is 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 with on-board computer and various sensors.- Cisco IOS

Page 6: Agenda

This Week’s Expected OutcomesThis Week’s Expected OutcomesUpon successful completion of this

module, the student will be able to:/etc/fstab filefssk utility/proc directoriesASCII and EBCDIC Character setCMOSBIOSLinux boot-up procedure (System 5)Red Hat Enterprise Release 6.0 boot-up procedure (Upstart)

Page 7: Agenda

Application

Kernel

Firmware

CPUMemory

Concentric Circle Relationship

Devices

Page 8: Agenda

UNIX Operating SystemUNIX Operating SystemField description of /etc/fstab

1st field describes the block special device or remote file system or device name 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 9: Agenda

UNIX Operating SystemUNIX Operating SystemFile System Integrity Checks

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 10: Agenda

UNIX Operating SystemUNIX Operating SystemFsck CommandFsck 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

Page 11: Agenda

UNIX Operating SystemUNIX Operating SystemFsck 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 SizesPhase 2 – Check PathnamesPhase 3 – Check ConnectivityPhase 4 – Check Reference CountsPhase 5 – Check Cylinder Groups

Page 12: Agenda

UNIX Operating SystemUNIX Operating SystemFsck Phases

If the superblock is corrupted the file system still can be repaired using alternate superblocks created while making a 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 13: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystemsThe /proc/filesystems is the file used to detect

filesystems supported by running kernel. If a filesystem is listed, you will be able to mount it based file systems. This text listing of the filesystem is compiled into the kernel.The “nodev” string in the first column means that filesystem does not require a block device to be mounted, it’s called a virtual filesystem.

Page 14: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystemsIt is a special file system in UNIX-like systems

that presents information about processes and other system information in a hierarchical file like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. Typically, it is mapped to a mount point named /proc at boot time.

Page 15: Agenda

UNIX Operating SystemUNIX Operating System

/proc/filesystemsThe /proc/filesystems file provides a

method of communication between kernel space and user space.

Page 16: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystemsThe Linux implementation of /proc also clones

that of Plan 9. Under Linux, /proc includes a directory for each running process (including kernel processes) at /proc/PID, containing information about that process.

Plan 9 is an enhancement of the V8 Plan. Rather than have just one file containing all the information about a process, Plan 9 created a hierarchy of separate files to provide those functions, and made /proc a real part of the file system

Page 17: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystems /proc/PID/cmdline, which contains the command that

originally started the process. /proc/PID/cwd, a symlink to the current working

directory of the process. /proc/PID/environ, a file containing the names and

contents of the environment variables that affect the process.

/proc/PID/exe, a symlink to the original executable file, if it still exists (a process may continue running after its original executable has been deleted or replaced).

Page 18: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystems /proc/PID/fd, a directory containing a symbolic

link for each open file descriptor

/proc/PID/fdinfo, a directory containing files which describe the position and flags for each open file descriptor.

/proc/PID/maps, a text file containing information about mapped files and blocks (like heap and stack).

Page 19: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystems /proc/PID/mem, a binary file representing the

process's virtual memory, can only be accessed by a ptrace'ing process.

/proc/PID/root, a symlink to the root path as seen by the process. For most processes this will be a link to / unless the process is running in a chroot jail.

/proc/PID/status, a file containing basic information about a process including its run state and memory usage.

Page 20: Agenda

UNIX Operating SystemUNIX Operating System/proc/filesystems/proc/PID/task, a directory containing

hard links to any tasks that have been started by this (i.e.: the parent) process.

Page 21: Agenda

UNIX Operating SystemUNIX Operating SystemFile 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 their large computers.

Page 22: Agenda

UNIX Operating SystemUNIX Operating SystemEBCDIC character set

EBCDIC is an 8 bit character encoding used on IBM mainframes and AS/400s.

Single byte EBCDIC takes up eight bits, which are divided in two pieces. The first four bits are called the zone and represent the category of the character, whereas the last four bits are called the digit and identify the specific character.

Page 23: Agenda

UNIX Operating SystemUNIX Operating SystemFile Representation Binary image files represent 256

different binary codes.

Page 24: Agenda

UNIX Operating SystemUNIX Operating SystemIn the past, Binary 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 25: Agenda

UNIX Operating SystemUNIX Operating SystemWhat does the CMOS do?

The CMOS memory stores information your computer needs when it boots up, such as, disk drive, keyboard type, configuration details of the PCI Bus slots, and Video Interface information. If the power to the CMOS memory is lost, your computer will boot with the CMOS defaults. In most cases, this will prevent use of your disk drives until this information is supplied.

Page 26: Agenda

UNIX Operating SystemUNIX Operating SystemCMOS specifications

The information stored in the CMS memory is battery backed up. The CMOS memory is a 64 or 128 byte memory that is part of the system clock chipset chips. The CMOS memory is made from Complementary Metal Oxide Semiconductor. This material can be backed up by battery, which requires a very low current to keep the data in the memory with the power turned off.

Page 27: Agenda

UNIX Operating SystemUNIX Operating SystemHow is the CMOS information used?

The CMOS information is required by your computers Basis Input/Output System (BIOS). The system BIOS is a 64K by 8 bit wide ROM mounted on the motherboard. If the BIOS ROM were accessed during normal operation the computer would be greatly reduced. Instead, the information is copied to some RAM where it can be accessed 32 or 64 bits at a time, thus increasing the system performance. The differences in access speed between RAM device and ROM’s is approximately 3 times faster.

Page 28: Agenda

UNIX Operating SystemUNIX Operating SystemRole of system BIOS

It is to test the system, initialize some I/O devices, recognize the hardware devices (basic power test), and load the operating system. Once, the operating system is loaded, the BIOS works with the operating system to enable access to the hardware devices. At this point, the BIOS provide basic input/output services to the operating system and applications.

Page 29: Agenda

UNIX Operating SystemUNIX Operating SystemWhat is UEFI ?UEFI is a specification defined between the operating system and the platform firmware. UEFI was developed to replace the Basic I/O System firmware interface system. The UEFI can support remote diagnostics and repair of computers, even without another operating system.

Page 30: Agenda

UNIX Operating SystemUNIX Operating SystemUEFI

Page 31: Agenda

UNIX Operating SystemUNIX Operating SystemUEFI

Page 32: Agenda

UNIX Operating SystemUNIX Operating SystemInitializing 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 33: Agenda

UNIX Operating SystemUNIX Operating SystemLinux 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 34: Agenda

UNIX Operating SystemUNIX Operating SystemLinux 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 35: Agenda

UNIX Operating SystemUNIX Operating SystemLinux 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 36: Agenda

UNIX Operating SystemUNIX Operating SystemLinux 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 37: Agenda

UNIX Operating SystemUNIX Operating SystemWhat is the Master Boot Record (MBR)It is a small program that is a special type of boot sector that manages the boot process. The MBR is not located in a partition, but located at the beginning of partitioned computer mass storage devices, such as, fixed disks or removable devices.The organization of the partition table in the Master Boot Record sets the boundaries for the maximum addressable storage space of a disk to 2 TB (2exp32 x 512 bytes)

Page 38: Agenda

UNIX Operating SystemUNIX Operating SystemMaster Boot Record (MBR)

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 39: Agenda

UNIX Operating SystemUNIX Operating SystemBoot Loaders

The following /boot directory contains all the important files which are required for successful booting process:

Demonstrate: /boot Red Hat Linux kernelsKernel configuration files for Red Hat

LinuxDemonstrate: /boot/grubThe 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 40: Agenda

UNIX Operating SystemUNIX Operating SystemBoot loader

The role of the boot loader is to place the operating system of the system in memory.

In Linux, the most commonly used boot-loading tool is LILO, the Linux Loader. During the installation process, Linux will generate LILO values and ask you to verify them. At that point, you are given the opportunity to insert additional LILO options. Such options might be to include more partitions, and identify the operating system to be installed.

Page 41: Agenda

UNIX Operating SystemUNIX Operating SystemBoot loader

First, what exactly is GRUB? GRUB is a boot loader, which means it passes control of the boot process from the Power-On Self Test (POST) to the kernel of your GNU/Linux distribution. GRUB works in a modular, layered fashion so that any unneeded modules are not loaded. Not only does this reduce execution time, but it saves valuable resources when running from removable media.

Page 42: Agenda

UNIX Operating SystemUNIX Operating SystemBoot loader

GRUB optionally loads its configuration file at run/boot time, so you don’t have to type in commands manually each time. However, the command-line option is still available in case there is an error in your configuration file.

Page 43: Agenda

UNIX Operating SystemUNIX Operating SystemWhen 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.

Page 44: Agenda

UNIX Operating SystemUNIX Operating SystemSo why use GRUB when there are

other options out there? The beauty of free software is that you have choices. Alternatives to GRUB include LILO, syslinux and isolinux. The benefit of GRUB is that it will work with many different types of boot devices, but you only need to learn one set of menu commands. In addition, GRUB can work on other forms of bootable storage, such as CD-R/W,

Page 45: Agenda

UNIX Operating SystemUNIX Operating SystemWith the release of Red Hat Enterprise

Linux (RHEL) 6, Red Hat will utilize the new Upstart boot service. This service will replace the System V init boot procedure that is based on runlevels directories that contain contained scripts that all had to be started. Upstart is event driven, so it contains scripts that are activated on demand, which makes the boot process a lot faster.

Page 46: Agenda

UNIX Operating SystemUNIX Operating SystemIn an attempt to simplify the

new concept, Upstart still utilizes the services from the init process. The /sbin/init, which is the mother of all user services

Page 47: Agenda

UNIX Operating SystemUNIX Operating SystemInit Process

Location: /sbin/init First process to execute in user spaceExecutes: backgroundProcess ID: 1 (one)Parent Process ID: 0 (zero)Owner: root

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

Page 48: Agenda

UNIX Operating SystemUNIX Operating SystemRed Hat Enterprize Release 6.0 (Upstart)

Handles initialization by starting the most fundamental services.

/etc/init/rcS.conf Handles starting the individual runlevels/etc/init/rc.confThe following two areas specify how

terminals are to be handled. /etc/init/tty.conf and /etc/init/serial.confThere were some additional configuration

files included to the /etc/sysconfig/init file.

Page 49: Agenda

UNIX Operating SystemUNIX Operating SystemThe /etc/inittab file is referenced only for

determining the default run level of the system. All other previous tasks are handled by the new Upstart procedure.

id:3:initdefault

Page 50: Agenda

UNIX Operating SystemUNIX Operating SystemUNIX-like runlevelsDefault runlevel. The runlevels used by RHS are:0 - halt (Do NOT set initdefault to this)1 - Single user mode2 - Multiuser, without NFS (The same as 3, if you

do not have networking)3 - Full multiuser mode4 - unused5 - X116 - reboot (Do NOT set initdefault to this)

Page 51: Agenda

UNIX Operating SystemUNIX Operating SystemUNIX-like 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 52: Agenda

UNIX Operating SystemUNIX Operating SystemLinux 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 53: Agenda

UNIX Operating SystemUNIX Operating SystemUNIX-like shutdown commandThe shutdown command is used to

shutdown the system in a safe way.

After bringing down the system, shutdown command can halt or reboot the system according to the options that are specified.

Example: shutdown –h now

Page 54: Agenda

UNIX Operating SystemUNIX Operating System/etc/rc.d

init.d rc0.d rc2.d rc4.d rc6.d rc.sysinitrc rc1.d rc3.d rc5.d rc.local

/etcrc rc4.d init.drc0.d rc5.d rc.sysinitrc1.d rc6.drc2.d rc.drc3.d rc.local

Page 55: Agenda

UNIX Operating SystemUNIX Operating System/etc/rc.d/rc0.d

Explain the k and s script prefixesExplain the two digit numberingKnoppix software directory names are similar but slightly different.

Page 56: Agenda

UNIX Operating SystemUNIX Operating SystemRoles of the kernel

1. Responsive - users2. 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.

Page 57: Agenda

UNIX Operating SystemUNIX Operating SystemThe kernel supports the following file systems:

Demonstrate: /proc cat filesystems

Demonstrate: pid_ppid.sh (use two putty windows)

Demonstrate:Execution of the newuid.pl and

process.sh scripts

Page 58: Agenda

UNIX Operating SystemUNIX Operating SystemPoints of interestMBRs are not present on non-partitioned media like floppies, superfloppies or other storage devices.

Page 59: Agenda

Moving Around in UNIXMoving Around in UNIXuptimewwho –rwho am i

Page 60: Agenda

Break-out problemsBreak-out problemsWhat 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?

Page 61: Agenda

Hands on informationHands on information

Lab Assignment 8-1, Installation Exercise due March 9, 2014Lab Assignment 9-1,Startup /Shutdown due March 16, 2014Lab Assignment 10-1, 10-2 Account/LDAP/Process due

Page 62: Agenda

After class assistanceAfter class assistance

QuestionsCommentsConcerns

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

Page 63: Agenda

Lab Assistance available by phone Lab Assistance available by phone and/or emailand/or email