440 likes | 613 Views
Chapter 10: Managing Software Packages and File Systems. The Complete Guide to Linux System Administration. Objectives. Manage software packages that use the rpm format Use Red Hat Network to update a Red Hat Linux or Fedora installation Manage and install new file systems.
E N D
Chapter 10:Managing Software Packages and File Systems The Complete Guide to Linux System Administration
Objectives • Manage software packages that use the rpm format • Use Red Hat Network to update a Red Hat Linux or Fedora installation • Manage and install new file systems The Complete Guide to Linux System Administration
Managing Packages • Linux groups related files into packages for easier management • Software package contains all files needed to install and use application • Red Hat Package Manager format • Abbreviated as rpm • Most popular data storage format for creating software packages The Complete Guide to Linux System Administration
Managing Packages (continued) • Debian package format • Used by the Debian Linux distribution • .deb file extension • dselect utility manages Debian packages The Complete Guide to Linux System Administration
Managing Packages Graphically • Use graphical utility to change what is installed • To start utility, enter system-config-packages in terminal window • Select check box next to any category of packages to add packages from category • Details link lists individual software packages included in category The Complete Guide to Linux System Administration
Managing Packages Graphically (continued) The Complete Guide to Linux System Administration
Using rpm to Manage Software Packages • rpm command-line utility maintains database listing all software packages installed on system • Lists: • Files included in each package • Packages are dependent on other packages • Other information • rpm command • Install new software packages • Erase software packages from system The Complete Guide to Linux System Administration
Using rpm to Manage Software Packages (continued) • Name of package file includes version information • Example • gedit-2.4.0-3.i386.rpm • Version 2.4.0 • Release code 3 • Platform i386 The Complete Guide to Linux System Administration
Using rpm to Manage Software Packages (continued) • Rpm command options fall into categories • -q option―query database and learn about packages • -i or -U option―install or upgrade package • -e option―erase (uninstall) rpm package • Options can be used in combination • Install new rpm files either from: • Linux CD-ROM • Internet The Complete Guide to Linux System Administration
Using rpm to Manage Software Packages (continued) • Install package zsh-4.2.0-1.i386.rpm • rpm -uvh /tmp/zsh-4.2.0-1.i386.rpm • Can use regular expression to specify package names • rpm utility maintains internal database of keys • Key is part of encryption information used to digitally sign rpm file The Complete Guide to Linux System Administration
Using rpm to Manage Software Packages (continued) • Fedora keys located in /usr/share/rhn • --import imports keys into rpm database • Check for keys • rpm --checksig -v packagefilename The Complete Guide to Linux System Administration
Updating the System Automatically • Red Hat Network • Download upgrades or security fixes for key operating system packages installed on system • Subscribe to Red Hat Network service • May be entitled to annual subscription as part of purchase • Individuals can use for free The Complete Guide to Linux System Administration
Updating the System Automatically (continued) • Red Hat Network • Uses icon on Panel in GNOME or KDE to indicate status • Check mark in blue circle • Flashing exclamation point in red circle • To register, double-click network alert icon on panel • To configure, right-click alert icon The Complete Guide to Linux System Administration
Updating the System Automatically (continued) • up2date utility • Manage updated software • Configure overall settings for Red Hat Network • System Tools then Red Hat Network on GNOME main menu • Tabs • General • Retrieval/installation • Package exceptions The Complete Guide to Linux System Administration
Updating the System Automatically (continued) • Management and provisioning products within Red Hat network’s offering • Must purchase • Add capabilities to help keep systems secure and up to date The Complete Guide to Linux System Administration
Understanding the File System • During installation • Partitions created • ext3 or similar file system The Complete Guide to Linux System Administration
Reviewing File System Types • File system • Collection of data structured in certain way so that it can be efficiently accessed • Superblock • Collection of information about file system as a whole • Found in ext2 and ext3 The Complete Guide to Linux System Administration
Reviewing File System Types (continued) • ext2 and ext3 file systems • Do not place files one after another filling up each area of hard disk in order • Permit file to grow in size without being as likely to be broken into pieces • Never need to defragment • ext3 • Journaling file system The Complete Guide to Linux System Administration
Reviewing File System Types (continued) • Other journaling file systems • ReiserFS • Journaling File System (JFS) • Virtual file system model • Used by kernel • Separates file system type from operation program wants to perform • Linux can support any new file system type for which driver is available The Complete Guide to Linux System Administration
Reviewing File System Types (continued) • Each file system must be mounted • Mount command • Without any parameters • List of currently mounted file systems The Complete Guide to Linux System Administration
Checking File System Status • Root file system becomes full • Linux kernel can crash • df command displays space usage information for each file system that is currently mounted • If file system becomes full, must free space in directories where file system is mounted The Complete Guide to Linux System Administration
Checking File System Status (continued) • Immediately free space • Look for large or numerous files in /tmp directory that can be deleted • Look for large or numerous files in /var subdirectories • Move system log file (/var/log/messages) to another file system that isn’t as full • See if any user subdirectories are using unusually large amounts of disk space • Delete unused archive files The Complete Guide to Linux System Administration
Checking File System Status (continued) • du utility lists size of directory and all its subdirectories • Various graphical tools and system administration scripts to check status of file systems • Hardware Browser • KDiskFree The Complete Guide to Linux System Administration
File System Attributes • ext3 file system assigns set of attributes to each file • Not displayed by ls command • lsattr command lists attributes of files in directory • chattr command changes attributes of one or more files The Complete Guide to Linux System Administration
Checking File Systems • fsck utility • Checks integrity of file systems • Usually pronounced fizz-check • Can also repair minor file system problems • Must be run on file system that is not mounted • Example: fsck /dev/hda1 The Complete Guide to Linux System Administration
Creating New File Systems • Adding file system means • Adding hard disk device to your system • Making hard disk available to Linux by: • Formatting • Mounting The Complete Guide to Linux System Administration
Using the fdisk Utility • Modifications to partition table only effective when you write changes to disk with w command to exit fdisk • Example: fdisk /dev/hdb The Complete Guide to Linux System Administration
Using the fdisk Utility (continued) The Complete Guide to Linux System Administration
Using the fdisk Utility (continued) The Complete Guide to Linux System Administration
Formatting File Systems • mke2fs command • Formats partition • Erasing all information on it • Organizes space for data to be recorded • Partition can be used by Linux • Use -j option to add journaling • For ext3 • Example: mke2fs -j /dev/sdb2 The Complete Guide to Linux System Administration
Formatting File Systems (continued) • fdformat command • Format 3.5-inch disks • gfloppy • Graphical removable disk formatter • tune2fs utility • Examine superblock of file system • Make minor changes to file system parameters The Complete Guide to Linux System Administration
Mounting New File Systems • mount command • To access file system • Indicate: • Device on which file system is stored • Directory where file system should be made accessible in directory structure • Example: mount -t ext3 /dev/sdb2 /archive The Complete Guide to Linux System Administration
Mounting New File Systems (continued) • lost+found directory • Placed in beginning of all new ext2 and ext3 file systems • Indicates successful mounting • File system cannot be in use when using umount command The Complete Guide to Linux System Administration
Using Networked File Systems • Many Linux networks use networked file systems to share data transparently over network • Use mount command to make directory on another computer appear as part of local file system • Similar to idea of “mapping a network drive” in Microsoft Windows The Complete Guide to Linux System Administration
Using Networked File Systems (continued) • Networked file systems normally accessed using • Network file system (NFS) • Server message block (SMB) The Complete Guide to Linux System Administration
Automating File System Mounting • /etc/fstab configuration file • Key to automounting file systems • Contains one line for each file system to automount • Add options when executing mount command • Example: mount -t ext3 -o defaults /dev/sdb2 /archive The Complete Guide to Linux System Administration
Using the autofs Mounting Service • autofs service • Daemon • Watches for users to change to preconfigured directories • Mounts needed file system in background • Operated by script in /etc/rc.d/init.d directory • /etc/auto.master lists directories to be automounted The Complete Guide to Linux System Administration
Using the autofs Mounting Service (continued) • autofs service • Example: • Mounting /misc directory • Create /etc/auto.misc file • Contains options to use when autofs mounts file system to /misc The Complete Guide to Linux System Administration
Managing Swap Space • mkswap command • Format partition set up using fdisk as swap space • Example: mkswap /dev/hda2 • swapon command activates swap space The Complete Guide to Linux System Administration
Setting Quotas on Disk Usage • Disk quotas • Limit on amount of hard disk space user or group can use • Steps to create quota • Enable quotas on file system • Establish quota for users or groups • Activate quota system • Review current disk usage for file system The Complete Guide to Linux System Administration
Setting Quotas on Disk Usage (continued) • ulimit command • Part of bash shell • Impose limits on actions of users The Complete Guide to Linux System Administration
Summary • Software packages are single files that contain all files and instructions needed to install application or collection of utilities • RHN service permits automatic updating of operating system files over Internet • Information about ext3 file system is stored in superblock • etc/fstab file contains list of all file systems that system mounts at boot time The Complete Guide to Linux System Administration
Summary (continued) • /df and du commands watch how disk space is being used • fsck utility examines file system to see that contents have not been corrupted • fdisk utility configures partition data on hard disk The Complete Guide to Linux System Administration
Summary (continued) • Linux supports networked file systems • autofs service automatically mounts file systems whenever user enters named directory • Disk quotas configured using edquota command The Complete Guide to Linux System Administration