Docsity

Linux Compression, Backup, and Software Installation: A Comprehensive Guide, Slides of Advanced Operating Systems

Partial preview of the text

Download Linux Compression, Backup, and Software Installation: A Comprehensive Guide and more Slides Advanced Operating Systems in PDF only on Docsity!

Chapter 12

Compression, System Backup, and

Software Installation

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

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
    • bzip

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

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

The gzip Utility (continued)

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

The gzip Utility (continued)

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

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 bzip

The bzip2 Utility (continued)

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

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

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

The tar Utility (continued)

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

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

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