610 likes | 711 Views
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. http://www.kernel.org/ The Linux Kernel Archives web site
E N D
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
http://www.kernel.org/ The Linux Kernel Archives web site http://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. Define: 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 week
Define: 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 week
http://vista.intersystems.com/csp/docbook/DocBook.UI.Page.cls?KEY=GCI_unixparms#GCI_unixparms_notes_hpuxhttp://vista.intersystems.com/csp/docbook/DocBook.UI.Page.cls?KEY=GCI_unixparms#GCI_unixparms_notes_hpux Calculating System Parameters for UNIX and Linux Configure Unix Kernel Parameters Swap space Number of global/routine buffers Number of users Number of inodes Maximum database size Number of semaphores Link of the week
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 characteristics Regular expressions Linux package management and it’s characteristics Tar command functionality This Week’s Expected Outcomes
Demomstrate: pid_ppid.sh Previous Weeks Expected Outcomes
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 System
SSD features When compared to electromechanical disks, SSD are more resistant to physical shock, operate silently, have lower access time, and less latency. Since 2012, the price of SSDs has declined. But are approximately 7 to 8 times more expensive per unit of storage than HDDs. UNIX 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 System
NAND memory NAND is a flash based memory introduced by Toshiba in 1989. SSDs behave similar to HDDs that we are familiar, 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 System
Standardization of NAND The 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 System
NAND 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 System
NAND characteristics One 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 System
NAND 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 System
Down-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. Over time, NAND fails gradually as individual cells fail and performance becomes noticeable slower. To compensate for this shortcoming, some vendors include more memory in their devices than actually claimed. UNIX Operating System
Regular expression Regular 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 System
Regular 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 System
Regular Expression Special Characters ∅ denotes the empty set ∅ ε denotes the set containing only the "empty" string, which has no characters at all. UNIX Operating System
Regular 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 System
Regular 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. UNIX Operating System
Regular 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. Review week six lab assignment
Sed commands = Display current line number a\text Append text to the file i\text Insert text into the file r\text Append text from filename into the file c\text Replace the selected range of lines with the provided text. s/reg/replac/ Replace text that matches the regular expression (reg) with replace (replac). UNIX Operating System
Sed commands w file name Write the current pattern space to the specified file q Immediately quit the script, but print the current pattern space Q Immediately quit the script. Review week six lab assignment
Sed commands Examples: sed s/day/night/ <original_file >new_file echo Sunday | sed ‘s/day/night/’ System_date=`date + “%y-%m-%d”` sed “s/THE_DATE/$system_date/” < orig_file.xml > new_file.xml Review week six lab assignment
Linux 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 is 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 Systems
Linux package management Packages – 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 Systems
Linux package components 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 – The package system maintains about dependency information. This is the requirements information of packages for one another. UNIX Operating Systems
Linux package components Checksum – 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 Systems
Linux 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 Systems
Linux package management You can download source code and create a binary package 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. UNIX Operating Systems
Software Installation Installing through a software package Package manager The simple definition for Ant might state that Ant is a Java-based build tool. There is a number of steps required to transform the source into a employable and useable software solution. Review week six lab assignment
Software Installation Installing through a software package Package manager RPM 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 assignment
Software Installation Installing through system commands and files Manual make command makefile file configure file Review week six lab assignment
Software 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 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 assignment
Doing an InstallationTo 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 bashThis 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 alsotakes care of which machine architecture you are using and what is the most current version of the software. Review week six lab assignment
What's Installed, Removing an InstallationTo 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 assignment
Package LicensingThe 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 assignment
Installation RecommendationsIt 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 importantfor 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 assignment
Checking 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 on your system -- this helps the system to keep more free disk space on a local system. Directory locations: /var/db/pkg/<pkg_name> Review week six lab assignment
There 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 assignment
Multiple Software VersionsWhen 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 for you to use. You may always refer to the pkg_update manual page for more information. Review 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 -Adeveloper: pkg_update -Dadministrator: pkg_update -G Review week six lab assignment
pkg_add InstallCaveat: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 assignment
Multiple Hardware PlatformsAdministrators 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 their users. We understand the needs for this requirement and want to help. Review week six lab assignment
Multiple Hardware PlatformsThis 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 assignment