The Linux System Administrators' Guide
Total Page:16
File Type:pdf, Size:1020Kb
The Linux System Administrators’ Guide Version 0.6.1 Lars Wirzenius <[email protected]> The Linux System Administrators’ Guide: Version 0.6.1 by Lars Wirzenius An introduction to system administration of a Linux system for novices. Copyright 1993–1998 Lars Wirzenius. Trademarks are owned by their owners. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to process the document source code through TeX or other formatters and print the results, and distribute the printed document, provided the printed document carries copying permission notice identical to this one, including the references to where the source code can be found and the official home page. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions. The author would appreciate a notification of modifications, translations, and printed versions. Thank you. Table of Contents Dedication...................................................................................................................................................7 Source and pre-formatted versions available..........................................................................................8 1. Introduction ...........................................................................................................................................9 The Linux Documentation Project...................................................................................................10 2. Overview of a Linux System...............................................................................................................12 Various parts of an operating system ...............................................................................................12 Important parts of the kernel ............................................................................................................12 Major services in a UNIX system ....................................................................................................14 init ..........................................................................................................................................14 Logins from terminals ............................................................................................................14 Syslog .....................................................................................................................................15 Periodic command execution: cron and at ............................................................................15 Graphical user interface..........................................................................................................15 Networking .............................................................................................................................15 Network logins .......................................................................................................................16 Network file systems ..............................................................................................................16 Mail.........................................................................................................................................16 Printing ...................................................................................................................................17 The filesystem layout..............................................................................................................17 3. Overview of the Directory Tree ..........................................................................................................19 Background ......................................................................................................................................19 The root filesystem...........................................................................................................................21 The /etc directory ..........................................................................................................................22 The /dev directory ..........................................................................................................................25 The /usr filesystem.........................................................................................................................25 The /var filesystem.........................................................................................................................26 The /proc filesystem ......................................................................................................................27 4. Using Disks and Other Storage Media ..............................................................................................31 Two kinds of devices........................................................................................................................31 Hard disks ........................................................................................................................................32 Floppies............................................................................................................................................35 CD-ROM’s .......................................................................................................................................36 Tapes ................................................................................................................................................37 Formatting ........................................................................................................................................37 Partitions ..........................................................................................................................................39 The MBR, boot sectors and partition table.............................................................................40 3 Extended and logical partitions ..............................................................................................41 Partition types.........................................................................................................................41 Partitioning a hard disk...........................................................................................................42 Device files and partitions ......................................................................................................43 Filesystems.......................................................................................................................................43 What are filesystems?.............................................................................................................44 Filesystems galore ..................................................................................................................44 Which filesystem should be used?..........................................................................................47 Creating a filesystem ..............................................................................................................47 Mounting and unmounting .....................................................................................................49 Checking filesystem integrity with fsck .................................................................................52 Checking for disk errors with badblocks...............................................................................53 Fighting fragmentation ...........................................................................................................54 Other tools for all filesystems.................................................................................................54 Other tools for the ext2 filesystem..........................................................................................54 Disks without filesystems.................................................................................................................56 Allocating disk space .......................................................................................................................56 Partitioning schemes...............................................................................................................57 Space requirements.................................................................................................................57 Examples of hard disk allocation ...........................................................................................58 Adding more disk space for Linux .........................................................................................58 Tips for saving disk space.......................................................................................................59 5. Memory Management .........................................................................................................................60 What is virtual memory?..................................................................................................................60 Creating a swap