agenda administrative issues link of the week this week’s expected outcomes review for midterm...

61

Upload: lesley-baldwin

Post on 26-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

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

Link of the weekLink of the week

http://www.kernel.org/The Linux Kernel Archives web sitehttp://www.kernelnewbies.org/

This web site is a community of people that want to improve or update their kernels. This site is referenced by experienced developers willing to share their knowledge with newcomers.

The Kernel is the central component of most operating systems. The kernel is responsible for managing the system’s resources and the communications between hardware and software.

Link of the weekLink of the weekDefine: Kernel space is space allocated specifically for

the kernel. Users are not able to access this area. This area is generally larger than user space. The kernel is never swapped out to disk.

Define: User space is space in memory where all user mode applications execute. Applications executing in this space are subject to being swapped out to disk.

Define: monolithic kernel is where all code is executed in kernel addresses space to increase the performance of the system.

Define: microkernel uses system calls to implement minimal OS services such as memory management, multitasking, and inter process communication.

Link of the weekLink of the week

http://vista.intersystems.com/csp/docbook/DocBook.UI.Page.cls?KEY=GCI_unixparms#GCI_unixparms_notes_hpuxCalculating System Parameters for UNIX and LinuxConfigure Unix Kernel Turnable Parameters

Swap spaceNumber of global/routine buffersNumber of usersNumber of inodesMaximum database sizeNumber of semaphores

This Week’s Expected This Week’s Expected OutcomesOutcomes

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

Be current on one of the latest memory technologies, SSD.

Review package manager and manual commands.

NAND memory characteristicsRegular expressionsLinux package management and it’s

characteristicsTar command functionality

Previous Weeks Expected Previous Weeks Expected OutcomesOutcomes

Demonstrate: pid_ppid.shawksrc.sh

UNIX Operating SystemUNIX Operating System

Solid State Drive (SSD) or Electronic Disk

The SSD actually does not have an actual disk or motors to drive the disks. There are no moving parts inside this device. It is a data storage device that uses integrated circuit assemblies as memory to store data persistently. The SSD technology uses electronic interfaces compatible with traditional block input and output HDD, which permits simple replacement in common applications. A new input and output interface like SATA Express was created to keep pace with the speed advancements in the SSD technology

UNIX Operating SystemUNIX Operating SystemSSD features

When compared to electromechanical disks, SSD are more resistant to physical shock, operates silently, has a lower access time, and has less latency. Since 2012, the price of SSDs has declined. SSDs are approximately 7 to 8 times more expensive per unit of storage than HDDs.

UNIX Operating SystemUNIX Operating System

As of 2010, the majority of SSDs used NAND-based flash memory, which retains the stored data without power. For applications requiring fast access, but not persistent memory after a power loss or crash, SSDs can be constructed from RAM. Such devices could have separate power supplies or batteries, to maintain data after power loss.

UNIX Operating SystemUNIX Operating System

UNIX Operating SystemUNIX Operating System

UNIX Operating SystemUNIX Operating System

NAND memoryNAND is a flash based memory

introduced by Toshiba in 1989. SSDs behave similar to HDDs that we are familiar with, like accessing data on a block device. Each block consists of a number of pages. Page sizes range from 512 or 2,048 or 4096 bytes.

UNIX Operating SystemUNIX Operating System

Standardization of NANDThe group called the Open NAND Flash

Interface Working Group (ONFI) developed a standardized low-level interface for NAND flash chips. This allows for interoperability between conforming NAND devices from different vendors. The ONFI released their version 1 .0 on ONFI is supported by major NAND flash manufactures December 2006.

Toshiba is one of those manufactures, but has chosen to use an interface of their own design known as Toggle Mode ( and now Toggle V2.0). This interface is not directly, pin and pin, which is compatible with the ONFI specification.

UNIX Operating SystemUNIX Operating SystemNAND characteristics

NAND flash memory is a non-volatile memory technology that does not require power to retain data. A non-volatile storage is one where stored data can be retrieved even when not powered.

NAND flash is an electronically addressed system, rather than mechanical. Electrically addressed systems are more expensive, faster, where mechanical addressed systems are the inverse.

UNIX Operating SystemUNIX Operating System

NAND characteristicsOne important goal of NAND flash

development has been to reduce the cost per bit and increase chip capacity so that flash memory can compete with magnetic storage devices like hard drives.

UNIX Operating SystemUNIX Operating SystemNAND market

NAND flash technology has a market in devices where large files are uploaded frequently and replaced. The digital cameras, USB drives, and MP-3 players all use NAND flash memory.

UNIX Operating SystemUNIX Operating SystemDown-side of NAND flash memory

The NAND flash has a finite number of write cycles. Another term for write cycle is called program/erase (P/E) cycles. Overtime, NAND fails gradually as individual cells fail and performance becomes noticeably slower. To compensate for this shortcoming, some vendors include more memory in their devices than actually claimed.

UNIX Operating SystemUNIX Operating System

Regular expressionRegular expression is a sequence of

characters that form a search pattern. This is similar to the principle of the wildcards that can be used to specify multiple file names.

The grep command searches for files that contain a specific string and returns the name of the file and line of context for that string.

UNIX Operating SystemUNIX Operating SystemRegular Expression Special Characters Open square bracket [ Backslash \

Caret ^Dollar sign $Dot .Pipe symbol |Question mark ?Asterisk *Plus sign +Opening and closing round brackets ( )

UNIX Operating SystemUNIX Operating SystemRegular Expression Special Characters

∅ denotes the empty set ∅ε denotes the set containing only the

"empty" string, which has no characters at all.

UNIX Operating SystemUNIX Operating SystemRegular Expression Examples:

a | b * denotes {ε, "a", "b", "bb", "bbb", ...}

(a | b) * denotes the set of all strings with no symbols other than "a" and "b", including the empty string:

{ε, "a", "b", "aa", "ab", "ba", "bb", "aaa", ...}

UNIX Operating SystemUNIX Operating SystemRegular Expression Examples: .at matches any three character string ending

with “at”, including “hat”, “cat”, and “bat”.

[hc]at matches “hat” and “cat”

[^b]at matches all strings matched by .at except “bat’.

^[hc]at matches “hat” and “cat”, but only at the beginning of the string or line.

Review week six lab assignmentReview week six lab assignmentRegular expression

Sed is a stream editor used for filtering and transforming text.

The sed command modifies the contents of files, sending the changed file to standard output.

UNIX Operating SystemUNIX Operating SystemSed commands= Display current line numbera\text Append text to the filei\text Insert text into the filer\text Append text from filename into the filec\text Replace the selected range of lines with

the provided text.s/original info/replacement info/ Replace text

that matches the regular expression (original info) with replace (replacement info).

Review week six lab assignmentReview week six lab assignmentSed commandsw file name Write the current pattern

space to the specified fileq Immediately quit the script, but print the

current pattern spaceQ Immediately quit the script.

Review week six lab assignmentReview week six lab assignmentSed commandsExamples:sed s/day/night/ <original_file >new_file

echo Sunday | sed ‘s/day/night/’

UNIX Operating SystemsUNIX Operating SystemsLinux package management

Envision any computer’s software as a house of cards. One program may rely on other programs or libraries, each of which relies on more and more software. The basic foundation for which house of cards relies on the Linux kernel. Anyone one of these packages can be replaced with an equivalent program. In turn, replacing programs can lead to much needed performance improvement or cause problems. Extracting cards from the stack can cause the house to tumble.

UNIX Operating SystemsUNIX Operating Systems

Linux package managementPackages are basic information that

package systems maintain about the software package, such as, the collection of files that are installed on the computer. Packages are distributed as one file, similar to a tarball. Most packages consist of many files, and the package system keeps track of them all.

UNIX Operating SystemsUNIX Operating SystemsLinux package components

The database package systems maintain a database of installed files. The database contains a list of all files installed, provided by the package system, and other information.

Dependencies is the package system that maintains dependency information. This is the requirements information of packages for one another.

UNIX Operating SystemsUNIX Operating Systems

Linux package componentsChecksum – The package system

maintains checksums and other ancillary information on all files. This information can be used to verify the validity of the installed software. This feature is intended to help you to be aware of disk errors. It does have a limited use for detecting intrusion, because an intruder could use the package system to install altered system software.

UNIX Operating SystemsUNIX Operating SystemsLinux package management

Upgrades and uninstallation – By tracking files and dependencies, a package system permits upgrades and uninstallations. Telling the package system to upgrade or remove a package, and it will do just that to files in the package.

Binary package creation – RPM and Debian package systems provide tools to help create binary packages from source code. This feature is useful when executing Linux on a particular CPU.

UNIX Operating SystemsUNIX Operating Systems

Linux package managementYou can download source code and

create a binary package that has advantages over compiling software from source in more conventional ways, because you can use the package management system to track dependencies, and attend to individual files.

Review week six lab assignmentReview week six lab assignmentSoftware Installation

Installing through a software packagePackage managerThe simple definition for Ant might

state that Ant is a Java-based build tool. There are a number of steps required to transform the source into a employable and useable software solution.

Review week six lab assignmentReview week six lab assignmentSoftware Installation

Installing through a software packagePackage managerRPM is a powerful and mature

command-line driven package management system capable of installing, uninstalling, verifying, querying, and updating UNIX software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like. There is also an API library, permitting advanced developers to manage such transactions from programming languages such as C, Perl or Python.

Review week six lab assignmentReview week six lab assignmentSoftware Installation

Installing through system commands and files

Manualmake commandmakefile fileconfigure file

Review week six lab assignmentReview week six lab assignmentSoftware Installation

Installing software under UNIX is not always straightforward and easy. System administrators must be familiar with the layout of the file system. During a software installation, the possibility exists that the system could panic and/or have a hard disk failure.

Review week six lab assignmentReview week six lab assignment

Package Install Instructions

  A package is used by the installer to correctly place all the binary and data files on a system.  The installer records version numbers, file locations and check sums for verification, uninstalls and does version updates.  By using the installer all other packages that a particular application depend on will be installed at the same time. 

Review week six lab assignmentReview week six lab assignmentDoing an Installation

To install a package use the pkg_update utility.  For example, if you wish to install bash you will enter the following command:

pkg_update -L bash

This command will automatically download and install the most current bash package.  If the package needs to have another package installed with it, that package will be downloaded and installed too.  Pkg_update also takes care of which machine architecture you are using and what is the most current version of the software.

Review week six lab assignmentReview week six lab assignmentWhat's Installed, Removing an Installation

To display information about the current software packages installed on a system.

Synopsis: pkg_info [options] [pkg-name]

To remove a software package from a system .  You do not need to know the version to delete a package. 

Synopsis: [pkg_delete [options] [pkg-name]

To install a software package on a system.Synopsis: pkg_add [options] [pkg- name]

Review week six lab assignmentReview week six lab assignment

Package Licensing

The licensing terms for each package can be easily viewed from the Warehouse web page before you decide to download by selecting the src directory.  It is important for you to understand that there are many different licenses used. Our preference is to use Full Open License software such as BSD and MIT.  There are many packages that are GPL or LGPL that may place restrictions on what you may do with a package's utilities and/or libraries. 

Review week six lab assignmentReview week six lab assignmentInstallation Recommendations

It is recommended that software packages be installed using the following command:pkg_update -L {pkg-name}

This command provides to you the most trouble-free installation since so many packages are dependent on other packages.  This command ensures that you get the most current release of a package and avoiding any unnecessary downloads.  Regularly checking for updates is very important for bug and security fixes. Several times people have reported that they are having a problem with a package that they downloaded 30 to 40 days ago.  During that time the problem has been fixed.

Review week six lab assignmentReview week six lab assignmentChecking for updates for all installed

packages is easily done using the command:

pkg_update -La

These installations and updates are done over the Internet and packages are not stored in directory locations: /var/db/pkg/<pkg_name>

Review week six lab assignmentReview week six lab assignmentThere are two ways to do an installation. You

can choose the type of installation you want based on the type of installation you are going to perform.  For the multiple versions of software and multiple hardware platforms. It is strongly recommend to use the pkg_update for single or multiple packages.  Administrators will want to keep users using pkg_update.

It is always recommended to install a package as:

pkg_update -L {name}

The software version number isn’t needed for this type of installation.  The current version number will be discovered. The most recent/current version number will be used.

Review week six lab assignmentReview week six lab assignmentMultiple Software Versions

When a group of packages requires installation, you want to verify that all currently installed packages are up-to-date.  To do an automated check for new packages then pkg_update is the tool to use.  You may always refer to the pkg_update manual page for more information.

Review week six lab assignmentReview week six lab assignment

Multiple Software VersionsNew users usually want to install a group of

packages to match their profile.  Currently three profiles exist: user, developer and administrator.  their profiles may be added in the future based on /Tools member feedback . By using a profile, a large number of packages can be selected and installed at one time. You can do the installations easily as:

user: pkg_update -A developer: pkg_update -D administrator: pkg_update -G

Review week six lab assignmentReview week six lab assignmentpkg_add Install

Caveat:The pkg_add utility is the "older" tool

that should be used with care.  The pkg_add command should be used when a specific package is to be installed (such as an older archived version for comparison).  You may always refer to the pkg_add manual page for more information.

Review week six lab assignmentReview week six lab assignmentMultiple Hardware Platforms

Administrators of several machines want to control what software can be installed or updated. Administrators usually like to test and validate software (for a multitude of reasons that we won't cover here) before making this software available to the user community.  We understand the needs for this requirement and want to help.

Review week six lab assignmentReview week six lab assignmentMultiple Hardware Platforms

This control can be done setting these conditions: 1.  Cache packages have to be validated on a local network drive. 2.  Create your own "list" file in the cache directory with 'tags'. 3.  Set the PKG_LOCATION and PKG_PATH environment variables to this network drive on each system for members of the administrators group. 4.  Have members of the administrators group only use pkg_update for installations and updates.

Review week six lab assignmentReview week six lab assignmentProblems, Bugs, Your Suggestions

If you encounter a problem installing a package please check that you are installing the most recent version of the package.  The installer itself receives regular updates too.  So keeping the installer up-to-date will help too. 

The installer can update itself. It is often recommended that when a new version is announced you update to that version.  You can safely update the installer by doing:

pkg_update -L pkg

If you already have the current version the installer will notice and leave things as they are.

UNIX Operating SystemUNIX Operating SystemDefine: tar was originally designed for tape

backups. Tar creates one large file called a heap that contains a collection of many files and directories. A tar file occupies a large amount of space for the files and directories, and a bit more. A tar file is not compressed.

The extension for a tar file is .tar. Create a tar file

tar –cf newpack.tar /export/home/dandrear

Extract the contents from a tar filetar –xvf origpack.tar

List the table of contents tar –tvf origpack.tar

UNIX Operating SystemUNIX Operating SystemDefine: gzip is a utility that compresses a tar

file. The compressed file extension becomes tar.gz.Compress a tar file

gzip filename.tar Decompress a compressed tar file

gzip –d filename.tar.gzgunzip filename.tar.gz

Define: bzip2 / bunzip2 Used to compress and decompress tar files. File extension .bz2.Compress a tar file

bzip2 filename.tarDecompress a compressed bzip2 file

bunzip2 –d filename.tar.bz2

UNIX Operating SystemUNIX Operating SystemDemonstrate the execution of listdir.pl script# Case #1: ./listdir.pl# Explanation: List current directory files in ascending

order.# Case #2: ./listdir.pl –l# Explanation: List current directory files with format

File name, Size, User, and Group column headings.# Case #3: ./listdir.pl -l -d /bin# Explanation: List /bin directory files with formatted

column headings (File name, Size, User, and Group). # Case #4: ./listdir.pl -d /bin# Explanation: List /bin directory files in ascending

order.

UNIX Operating SystemUNIX Operating System

Demonstrate:./listdir.pl

UNIX Operating SystemUNIX Operating System

Points of interestgcc Compile a program written in C languageg++ Compile a program written in C++ languagessh Open a secure connection to a remote hostsftp Upload or download files with a secure connection.

Moving Around in UNIXMoving Around in UNIXps –o pid,ppid,commmpstatmorepasswordgzip ping dudf

Break-out problemsBreak-out problemsinodeSystem panic SemaphoreTunable UNIX ParametersKernel spaceCall by valueCall by referenceData structureDefinition of a kernelUser space

Hands on informationHands on information

Lab Assignment 6-1, Programming Assignment 1, due June 21, 2015.Lab Assignment 8-1, Installation Exercise due June 28, 2015.Lab Assignment 9-1,Startup /Shutdown due July 5, 2015.

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

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