The Linux System Administrator's Guide

Transcription

The Linux System Administrator's GuideVersion 0.9Lars Wirzenius Email address removed by request Joanna Oja Current email address unknown Stephen Stafford stephen@clothcat.demon.co.uk.NOSPAM Alex Weeks draxeman@gmail.com.NOSPAM An introduction to system administration of a Linux system for novices.Copyright 1993 1998 Lars Wirzenius.Copyright 1998 2001 Joanna Oja.Copyright 2001 2003 Stephen Stafford.Copyright 2003 2004 Stephen Stafford & Alex Weeks.Copyright 2004 Present Alex Weeks.Trademarks are owned by their owners.Permission is granted to copy, distribute and/or modify this document under the terms of the GNU FreeDocumentation License, Version 1.2 or any later version published by the Free Software Foundation; with noInvariant Sections, no Front Cover Texts, and no Back Cover Texts. A copy of the license is included in thesection entitled "GNU Free Documentation License".

The Linux System Administrator's GuideTable of ContentsAbout This Book.11. Acknowledgments.11.1. Joanna's acknowledgments.11.2. Stephen's acknowledgments.11.3. Alex's Acknowledgments.22. Revision History.23. Source and pre formatted versions available.24. Typographical Conventions.3Chapter 1. Introduction.41.1. Linux or GNU/Linux, that is the question.51.2. Trademarks.5Chapter 2. Overview of a Linux System.72.1. Various parts of an operating system.72.2. Important parts of the kernel.72.3. Major services in a UNIX system.82.3.1. init.92.3.2. Logins from terminals.92.3.3. Syslog.92.3.4. Periodic command execution: cron and at.102.3.5. Graphical user interface.102.3.6. Networking.102.3.7. Network logins.112.3.8. Network file systems.112.3.9. Mail.112.3.10. Printing.122.3.11. The filesystem layout.12Chapter 3. Overview of the Directory Tree.133.1. Background.133.2. The root filesystem.143.3. The /etc directory.153.4. The /dev directory.173.5. The /usr filesystem.193.6. The /var filesystem.193.7. The /proc filesystem.20Chapter 4. Hardware, Devices, and Tools.224.1. Hardware Utilities.224.1.1. The MAKEDEV Script.224.1.2. The mknod command.224.1.3. The lspci command.234.1.4. The lsdev command.234.1.5. The lsusb command.234.1.6. The lsraid command.234.1.7. The hdparm command.234.1.8. More Hardware Resources.23i

The Linux System Administrator's GuideTable of ContentsChapter 4. Hardware, Devices, and Tools4.2. Kernel Modules.234.2.1. lsmod.244.2.2. insmod.244.2.3. depmod.244.2.4. rmmod.244.2.5. modprobe.24Chapter 5. Using Disks and Other Storage Media.255.1. Two kinds of devices.255.2. Hard disks.265.3. Storage Area Networks Draft.285.4. Network Attached Storage Draft.285.4.1. NFS.295.4.2. CIFS.295.5. Floppies.295.6. CD ROMs.305.7. Tapes.315.8. Formatting.315.9. Partitions.325.9.1. The MBR, boot sectors and partition table.335.9.2. Extended and logical partitions.335.9.3. Partition types.345.9.4. Partitioning a hard disk.355.9.5. Device files and partitions.365.10. Filesystems.365.10.1. What are filesystems?.365.10.2. Filesystems galore.375.10.3. Which filesystem should be used?.395.10.4. Creating a filesystem.395.10.5. Filesystem block size.405.10.6. Filesystem comparison.415.10.7. Mounting and unmounting.425.10.8. Filesystem Security.455.10.9. Checking filesystem integrity with fsck.455.10.10. Checking for disk errors with badblocks.465.10.11. Fighting fragmentation?.465.10.12. Other tools for all filesystems.475.10.13. Other tools for the ext2/ext3 filesystem.475.11. Disks without filesystems.485.12. Allocating disk space.495.12.1. Partitioning schemes.495.12.2. Logical Volume Manager (LVM).505.12.3. Space requirements.505.12.4. Examples of hard disk allocation.505.12.5. Adding more disk space for Linux.515.12.6. Tips for saving disk space.51ii

The Linux System Administrator's GuideTable of ContentsChapter 6. Memory Management.526.1. What is virtual memory?.526.2. Creating a swap space.526.3. Using a swap space.536.4. Sharing swap spaces with other operating systems.546.5. Allocating swap space.556.6. The buffer cache.56Chapter 7. System Monitoring.587.1. System Resources.587.1.1. The top command.587.1.2. The iostat command.597.1.3. The ps command.607.1.4. The vmstat command.617.1.5. The lsof command.617.1.6. Finding More Utilities.627.2. Filesystem Usage.627.2.1. The df command.627.2.2. The du command.627.2.3. Quotas.637.3. Monitoring Users.637.3.1. The who command.637.3.2. The ps command again!.647.3.3. The w command.647.3.4. The skill command.647.3.5. nice and renice.64Chapter 8. Boots And Shutdowns.658.1. An overview of boots and shutdowns.658.2. The boot process in closer look.658.2.1. A Word About Bootloaders.678.3. More about shutdowns.678.4. Rebooting.688.5. Single user mode.698.6. Emergency boot floppies.69Chapter 9. init.709.1. init comes first.709.2. Configuring init to start getty: the /etc/inittab file.709.3. Run levels.719.4. Special configuration in /etc/inittab.739.5. Booting in single user mode.73Chapter 10. Logging In And Out.7510.1. Logins via terminals.7510.2. Logins via the network.7610.3. What login does.7710.4. X and xdm.78iii

The Linux System Administrator's GuideTable of ContentsCh

administration columns in Linux Journal. They are quite informative and inspirational. Many useful comments have been sent by a large number of people. My miniature black hole of an archive doesn't let me find all their names, but some of them a