• No results found

Linux+ Guide to Linux Certification, Third Edition. Chapter 11 Compression, System Backup, and Software Installation

N/A
N/A
Protected

Academic year: 2021

Share "Linux+ Guide to Linux Certification, Third Edition. Chapter 11 Compression, System Backup, and Software Installation"

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)

Linux+ Guide to Linux

Certification, Third Edition

Chapter 11

Compression, System Backup,

and Software Installation

(2)

Objectives

• Outline the features of common compression utilities

• Compress and decompress files using common compression utilities

• Perform system backups using the tar, cpio, and dump commands

• View and extract archives using the tar, cpio, and restore commands

(3)

Objectives (continued)

• Use burning software to back up files to CD and DVD

• Describe common types of Linux software

• Compile and install software packages from source code

• Use the Red Hat Package Manager to install, manage, and remove software packages

• Use the yum command to obtain software from Internet software repositories

(4)

Compression

• Compression: process in which files are reduced in size by stripping out characters

• Compression algorithm: standard set of instructions used to compress a file

• Compression ratio: percentage by which the file size was decreased

• Common compression utilities include compress, gzip, and bzip2

(5)

The compress Utility

• Use to compress files using the Adaptive Lempel Ziv coding (LZW) compression algorithm

– Average compression ratio of 40-50%

• compress command: used to compress files

• zcat command: used to display the contents of an archive created with compress

– Can use zmore and zless commands to view contents page-by-page

• uncompress command: used to decompress files compressed by compress command

(6)

The compress Utility (continued)

(7)

The gzip Utility

• GNU zip (gzip): used to compress files using the Lempel-Ziv compression algorithm (LZ77)

– Varies slightly from algorithm used by compress – Average compression ratio of 60-70%

– Uses .gz filename extension by default

– Can control level of compression via numeric option

(8)

The gzip Utility (continued)

(9)

The gzip Utility (continued)

(10)

The gzip Utility (continued)

(11)

The bzip2 Utility

• bzip2 command: used to compress files using Burrows-Wheeler Block Sorting Huffman Coding compression algorithm

– Cannot compress directory full of files

– Cannot use zcat and zmore to view files

• Must use bzcat command

– Compression ratio is 50% to 75% on average – Uses .bz2 filename extension by default

• bunzip2 command: used to decompress files compressed via bzip2

(12)

The bzip2 Utility (continued)

(13)

The bzip2 Utility (continued)

(14)

System Backup

• System backup: process whereby files are copied to an archive

• Archive: location (file or device) that contains copy of files

– Typically created by a backup utility

• Should backup user files from home directories and any important system configuration files

– Possibly files used by system services as well

• Several backup utilities available

(15)

System Backup (continued)

(16)

The tar Utility

• Tape archive (tar) utility: one of oldest and most common backup utilities

– Can create archive in a file on a filesystem or directly on a device

• tar command: activates tar utility

– Arguments list the files to place in the archive

– Accepts options to determine location of archive and action to perform on archive

(17)

The tar Utility (continued)

(18)
(19)

The tar Utility (continued)

• tar utility does not compress files inside archive

– Time needed to transfer archive across a network is high

– Can compress archive

• Backing up files to compressed archive on a

filesystem is useful when transferring data across a network

– Use options of the tar command to compress an archive immediately after creation

(20)

The cpio Utility

• Copy in/out (cpio): common backup utility

– Activated by the cpio command

• Has various options

– Includes options similar to tar utility – Has added features

• Ability to back up device files • Long filenames

(21)

The cpio Utility (continued)

(22)

The cpio Utility (continued)

(23)

The dump/restore Utility

• dump/restore: Used to back up files and directories to device or file on filesystem

– Works only with files on ext2 and ext3 filesystems

• Designed to backup entire filesystems to an archive

• /etc/dumpdates: file used to store information about incremental and full backups

(24)

The dump/restore Utility (continued)

• Full backup: archiving all data on filesystem

• Incremental backup: backs up only data that has changed since last backup

– Can perform up to nine different incremental backups

• dump command: create archives for full or incremental backup

• restore command: extract archives created with dump

(25)

The dump/restore Utility (continued)

(26)
(27)

Burning Software

• tar, cpio, and dump utilities copy data to backup

medium in character-by-character or block-by-block format

– Typically used with tape, floppy, and hard disk media

• Disc burning software: used to write files to CD or DVD media

– Build CD or DVD filesystem, organize the data, and write it all to CD or DVD

• Fedora 13 comes with Brasero Disc Burner burning software

(28)
(29)

Software Installation

• Software for Linux can consist of:

– Binary files precompiled to run on certain hardware architectures

– Source code, which must be compiled before use

• Typically distributed in tarball format

• Package manager: system that defines standard package format

– Used to install, query, and remove packages

• Red Hat Package Manager (RPM): most common package manager used by Linux systems today

(30)

Compiling Source Code into Programs

• Procedure for compiling source code into binary programs standardized among most OSS

developers

• make command: looks for Makefile and it to

compile the source code into binary using compiler

– Makefile: contains most of the information and

commands necessary to compile a program, as well as instructions for use of commented areas

• make install command: copies complied executable programs to correct location

(31)

Compiling Source Code into Programs

(continued)

(32)

Installing Programs Using RPM

• Packages in RPM format have filenames that indicate hardware architecture for which the software was compiled

– End with .rpm extension

• To install an RPM package, use –i option to rpm command

– Command used to install, query, and remove RPM packages

(33)

Installing Programs Using RPM

(continued)

• After installation RPM database is updated to contain information about the installed package and files contained in it

-q option: query the full package name

-i option: together with –q used to display full package information

-f option: together with –q used to display the

package to which a specific file belongs

-e option: used to remove a package from the system

(34)

Installing Programs Using RPM

(continued)

(35)

Installing Programs Using RPM

(continued)

(36)

Installing Programs Using RPM

(continued)

(37)

Installing Programs Using RPM

(continued)

• Most RPM packages are located on Internet Servers

– Called software repositories

• yum command: used to search Internet software repositories for RPM packages

– Installs dependent packages if necessary – yum install packagename command – yum update packagename command

– KPackageKit: graphical utility for installing or updating packages

(38)

Installing Programs Using RPM

(continued)

(39)

Summary

• Many compression utilities are available for Linux systems; each uses a different compression

algorithm and produces a different compression ratio

• Files can be backed up to an archive using a backup utility

– To back up files to CD-RW or DVD-RW, use burning software instead of a backup utility

(40)

Summary (continued)

• tar is the most common backup utility used today

– Typically used to create compressed archives called tarballs

• Source code for Linux software can be obtained and compiled afterward using the GNU C Compiler

– Most source code is available in tarball format via the Internet

(41)

Summary (continued)

• Package Managers install and manage compiled software of the same format

– The Red Hat Package Manager is the most common package manager available for Linux systems today

• You can install or upgrade RPM packages using the yum command

– yum command obtains RPM packages from software repositories on the Internet

References

Related documents

Instead of devaluating conservative treatments [10] the surgical communitiy should focus on the long-term complications of spinal fusion surgery as conservative treatment is far

In 2006 and 2007, as part of my doctoral research which examined the journeys of Iraqi refugees from the Middle East to Australia, I interviewed Iraqi refugees in

In publication II a potential for helium in iron was developed and in publication III it was complemented with a po- tential for helium in chromium, and the potentials are used to

Percent of LHDs with strategies to manage program and/or staffing cuts in order to minimize the negative impact: Funding.. Shah, Leep, Ye

Results: Using four identical QCMs, installed into the Vitrocell W mammalian 6/4 CF Stainless exposure module, we were able to quantify deposited smoke particle deposition,

If certain learning styles may be preferred by minority students, and faculty employ teaching methods appropriate for learning styles that may be prevalent in a group,

To specify whether Iranian university students considered themselves to have attained adult status, participants’ responses to the three questions of “Is this period

After their arrival in Perugia, all students participate in a comprehensive set of activities led by staff and designed to introduce students to the Umbra Institute: the city