Top Banner
Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation
36

Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Dec 22, 2015

Download

Documents

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: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification

Chapter 12Compression, System Backup,

and Software Installation

Page 2: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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

Page 3: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 3

Objectives (continued)

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

• 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

Page 4: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 4

Compression

• Compression: Process in which files are reduced in size by a compression algorithm

• Compression algorithm: Set of instructions used to systematically reduce a file’s contents

• Compression ratio: Amount of compression occurring during compression

• Three most common compression utilities:– Compress– gzip– bzip2

Page 5: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 5

The compress Utility

• compress command: Used to compress files using Lempel-Ziv compression algorithm

• zcat command: Used to view contents of an archive created with compress or gzip to Standard Output

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

Page 6: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 6

The compress Utility (continued)

Table 12-1: Common options used with the compress utility

Page 7: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 7

The gzip Utility

• GNU zip (gzip): Used to compress files using Lempel-Ziv compression algorithm– Varies slightly from algorithm used by compress– Typically yields better compression than compress– Uses .gz filename extension by default– Can control level of compression

• gunzip command: Used to decompress .gz files

Page 8: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 8

The gzip Utility (continued)

Table 12-2: Common options used with the gzip utility

Page 9: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 9

The gzip Utility (continued)

Table 12-2 (continued): Common options used with the gzip utility

Page 10: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 10

The gzip Utility (continued)

Table 12-2 (continued): Common options used with the gzip utility

Page 11: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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

• bunzip2 command: Used to decompress files compressed via bzip2

Page 12: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 12

The bzip2 Utility (continued)

Table 12-3: Common options used with the bzip2 utility

Page 13: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 13

The bzip2 Utility (continued)

Table 12-3 (continued): Common options used with the bzip2 utility

Page 14: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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– tar, cpio, dump/restore, burning software

Page 15: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 15

System Backup (continued)

Table 12-4: Common tape device files

Page 16: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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– Accepts options to determine location of archive and

action to perform on archive

Page 17: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 17

The tar Utility (continued)

Table 12-5: Common options used with the tar utility

Page 18: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 18

The tar Utility (continued)

Table 12-5 (continued): Common options used with the tar utility

Page 19: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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– Ill suited to backing up large amounts of data for

system recovery

Page 20: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 20

The cpio Utility

• Copy in/out (cpio): Common backup utility– Includes options similar to tar utility– Has added features

• Ability to back up device files

• Long filenames

– Uses absolute pathnames by default when archiving

Page 21: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 21

The cpio Utility (continued)

Table 12-6: Common options used with the cpio utility

Page 22: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 22

The cpio Utility (continued)

Table 12-6 (continued): Common options used with the cpio utility

Page 23: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 23

The dump/restore Utility

• dump/restore: Used to back up files and directories to device or file on filesystem– Works with files on ext2 and ext3 filesystems

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

Page 24: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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

• restore command: Extract archives created with dump

Page 25: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 25

The dump/restore Utility (continued)

Figure 12-1: A sample backup strategy

Page 26: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 26

The dump/restore Utility (continued)

Table 12-7: Common options used with the dump/restore utility

Page 27: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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

• Burning software: Used to write files to CD-RW or DVD-RW media

• Red Hat Fedora Core 2 comes with X-CD-Roast

Page 28: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 28

Burning Software (continued)

Figure 12-2: The X-CD-Roast program

Page 29: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 29

Software Installation

• Software for Linux can consist of: – Binary files precompiled to run on certain hardware

architectures – Source code, which must be compiled

• 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

Page 30: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 30

Compiling Source Code into Programs

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

• GNU C Compiler (gcc): Command used to compile source code into binary programs– After compilation, must move program files to

appropriate directory

• Makefile: Contains most of information and commands necessary to compile program

Page 31: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 31

Compiling Source Code into Programs (continued)

Figure 12-3: The rdesktop program

Page 32: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 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

Page 33: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 33

Installing Programs Using RPM (continued)

Figure 12-4: The bluefish program

Page 34: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 34

Installing Programs Using RPM (continued)

Table 12-8: Common options used with the rpm utility

Page 35: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 35

Installing Programs Using RPM (continued)

Table 12-8 (continued): Common options used with the rpm utility

Page 36: Linux+ Guide to Linux Certification Chapter 12 Compression, System Backup, and Software Installation.

Linux+ Guide to Linux Certification, 2e 36

Installing Programs Using RPM (continued)

Figure 12-5: Configuring Fedora core software packages after installation