The Complete Freebsd(Μúèý°Æ)
Total Page:16
File Type:pdf, Size:1020Kb
The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 Introduction to the text version This document is the complete text of the third edition of ``The Complete FreeBSD'', including all updates as of 16 September 1999. It does not include the man pages, which you can view more conveniently using the man program, but they are included in the table of contents so that there are page numbers for the cross references. Don't use these cross reference numbers: they are dif- ferent from the page numbers in the printed book. You can best view the text in an xterm window at least 85 characters wide and exactly 56 lines high: this is the height of the "page". If you're using Emacs, use a window 59 lines high. Some of the tables are wider than 85 char- acters, and if you can display 100 characters width, it will work better. ``The Complete FreeBSD'' includes standard printing features such as: o Text of varied size and font to indicate specific meanings. This ASCII ver- sion can't reproduce them. This will make it very hard to read. See the dis- cussion on page xxxii to see how much difference this makes. o Illustrations such as screen images. I have had to completely omit them from this version. o Diagrams. Most of these are still present, but the low resolution of nroff means that some would be distorted beyond recognition, for example the moni- tor waveform diagrams in the chapter on X theory. There's no good way to do this kind of diagram in ASCII, so I have omitted them. You may still be able to recognize something in the diagram of the reference network on page 485, so I have left it in there. All in all, the result is very second-rate. So why even bother? There are a couple of reasons: 1. You can use programs such as grep to search for specific texts. 2. It may be better than nothing if you're in trouble installing the system. 3. Since none of these problems exist with the printed book, it may make you decide to buy the book :-) i 第页 1 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 One thing you should note, though: this book is copyright. By buying the CD- ROM, you have a license to use it for your own personal use. You may not give it to other people, or use the text in other documents without the prior writ- ten approval of Walnut Creek CDROM. If you distribute this image without prior agreement, a royalty of $1.00 per copy shall apply. ii 第页 2 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 The Complete FreeBSD(R) _____________________________________________________________ 第页 3 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 Important notice A list of errata and addenda is available for this book on the first CD- ROM in the file /book/errata. The most up-to-date list is on ftp://ftp.lemis.com/pub/cfbsd/errata-3. Please check these lists before reporting problems. If you find errors in this book, please report them to Greg Lehey <[email protected]> for inclusion in the errata list. 第页 4 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 The Complete FreeBSD(R) Third Edition Greg Lehey Walnut Creek CDROM 第页 5 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 The Complete FreeBSD(R) by Greg Lehey <[email protected]> Published by Walnut Creek CDROM Suite 260, 1547 Palos Verdes Mall Walnut Creek CA 94596 USA o Sales +1-925 674-0783 o Technical support +1-925 603-1234 o Fax +1-925 674-0821 o Email: [email protected] o Web: http://www.cdrom.com/ All Rights Reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without written permission from the publisher. Copyright (C) 1996, 1997, 1999 Greg Lehey and Walnut Creek CDROM Cover design by Kristina Fuxell. FreeBSD(R) is a Registered Trade Mark of FreeBSD Inc. and Walnut Creek CDROM. UNIX(R) is currently a Registered Trade Mark of The Open Group. For more in- formation, see http://www.rdg.opengroup.org/public/tech/unix/trademark.html. As used in this book, UNIX refers to the operating system development which predated the registration of the UNIX trademark. Significant portions copyright (C) 1993, 1994, 1995 FreeBSD Inc. Portions copyright (C) 1994, 1995 The XFree86 Project, Inc. Many of the man pages are Copyright (C) of the Free Software Foundation. See the FSF license on page 737 for further details. The Berkeley daemon on the cover was included with kind permission of M. Kirk McKusick. Walnut Creek CDROM acknowledges copyright names and trademarks which may be in- cidentally mentioned in this material. See page xxxvi for the list of the RCS IDs which was previously printed on this page. This book was written in troff and formatted on 16 September 1999 with GNU groff version 1.11 running under FreeBSD 4.0-CURRENT. 第页 6 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 Contents Introduction to the text version i Preface xxxi The third edition xxxi Conventions used in this book xxxii Describing the keyboard xxxiii Acknowledgements xxxiv Book reviewers xxxiv How this book was written xxxv Chapter 1: Introduction 1 How to use this book 1 FreeBSD features 5 A little history 8 Other free UNIX-like operating systems 10 FreeBSD and Linux 11 Other documentation on FreeBSD 13 Reading the handbook 14 The online manual 15 GNU info 17 The FreeBSD community 18 Support 18 Reporting bugs 21 The Berkeley daemon 21 Page vii 第页 7 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 Chapter 2: Before you install 27 Hardware requirements 27 Compaq/Digital Alpha machines 28 Laptops 29 Drivers 30 Supported hardware--Alpha architecture 33 The CD-ROM distribution 33 CD-ROM 1: Installation 34 CD-ROM 2: Live File System, CVS Repository, web pages 36 CD-ROMs 3 and 4: The Ports Collection 37 PC hardware 37 How the system detects hardware 38 Disks 39 PC BIOS and disks 41 Logical and physical disk drives 42 Making the file systems 47 Using a boot manager 48 Interaction with Microsoft 48 Sharing a disk with Microsoft 48 Using compressed MS-DOS file systems from FreeBSD 49 Running Microsoft binaries under FreeBSD 49 Disk size limitations 49 Chapter 3: FreeBSD version 3 54 Multiple processor support 55 The CAM SCSI driver 56 DMA support for IDE disks 57 The new console driver 57 Kernel loadable modules 58 The new bootstrap 59 Boot floppies 60 The ELF object format 61 Converting the source tree to ELF 61 Building a new kernel 62 What happened to my libraries? 67 The Ports Collection and ELF 70 Page viii 第页 8 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 Chapter 4: Quick Installation 71 Making things easy for yourself 71 FreeBSD alone on the disk 73 Installing XFree86 74 FreeBSD shared with Microsoft 75 Chapter 5: Installing FreeBSD 77 Installing FreeBSD on the Intel i386 architecture 77 Booting from CD-ROM 78 Preparing a boot floppy 78 Creating floppies for a floppy installation 79 Installing via FTP 80 Installing via NFS 82 Installing from a Microsoft partition 82 Installing from tape 83 Installing from a FreeBSD partition 83 Booting the install kernel 83 Booting from CD-ROM 83 Booting from floppy 84 Installing from a running Microsoft system 84 The boot process 85 Using sysinstall 86 Kinds of installation 87 Creating space on disk 88 Specifying disk labels 91 Selecting distributions 97 Selecting the installation medium 98 Installing via FTP 98 Installing via NFS 99 Installing from floppy disk 99 Performing the installation 99 Network services 101 Setting up network interfaces 101 Other network options 102 Machine configuration 102 Rebooting the new system 102 Where to put /var and /tmp 103 Installing FreeBSD on a Compaq AXP (Alpha) system 104 Upgrade installation 105 Changing configuration 106 Installing additional software 106 How to uninstall FreeBSD 106 Page ix 第页 9 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 Chapter 6: Shared OS Installation 107 Repartitioning with FIPS 107 Repartitioning--an example 109 Installing FreeBSD on a second partition 113 Chapter 7: Installation Problems 117 If things go wrong 117 Problems with sysinstall 118 Problems with CD-ROM installation 118 Install tries to install from floppy 118 Can't boot 119 Can't find correct geometry 119 System hangs during boot 120 Panic: cannot mount root 121 Can't find Intel EtherExpress board 122 Can't see 3Com PCMCIA board 122 No packets are transmitted on PCMCIA network board 123 Device timeout on ed Ethernet boards 123 Devices at IRQ 9 don't work 124 Kernel doesn't find Matsushita/Panasonic CD-ROM 124 Can't install from tape 125 Can't detect SCSI boards on HP Netserver 125 Can't install on Panasonic AL-N1 or Rios Chandler 125 Problems with the CMD640 IDE controller 126 Can't find the floppy on Compaq Aero notebook 126 Read errors on Intel AL440LX based systems 126 Can't recognize Dell DSA on Poweredge XE 126 Can't use the AMD PCnet-FAST Ethernet board 127 Can't operate IBM EtherJet board 127 IBM Netfinity 3500 freezes during network installation 127 TEAC CD-220E (rev 1.0D) IDE CD-ROM hangs the system 127 Root file system fills up 128 Panic 128 Fixing a broken installation 130 Chapter 8: The Ports Collection 131 How to install a package 132 Building a port 133 Installing ports during system installation 133 Install ports from the first CD-ROM 133 Installing ports from the ports CD-ROM 133 Ports via FTP 134 Page x 第页 10 / 824 The Complete FreeBSD(第三版 ).txt 2001-10-10 0:29 What's in that port? 135 Ports via CVSup 136 Getting the source archive 137 Building the port 138 Port dependencies 138 Getting common software 139 Maintaining ports 140 Submitting a new port 142 Chapter