The Linux FAQ David C. Merrill david -AT- lupercalia.net 2003-09-19 Revision History Revision 1.20 2001-12-04 Revised by: rk Revision 2.0 2002-04-25 Revised by: dcm Some reorganization and markup changes. Revision 2.1 2003-05-19 Revised by: dcm Fairly complete reorganization and conversion to WikiText. Revision 2.1.1 2003-09-19 Revised by: dcm Minor corrections. Revision 2.1.2 2004-02-28 Revised by: dcm Minor corrections. This is the list of Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems. ----------------------------------------------------------------------------- Table of Contents 1. Introduction 1.1. About the FAQ 1.2. Asking Questions and Sending Comments 1.3. Authorship and Acknowledgments 1.4. Copyright and License 1.5. Disclaimer 2. General Information 3. The Linux Kernel 4. Disk Drives 5. Partitions And Filesystems 6. System Libraries 7. Linux Distributions 8. Booting the OS 9. Application Software Management 10. Directory And File Management 11. Connecting To A Network 12. Troubleshooting 13. Software Development 14. Solutions to Common Problems 15. Tips And Tricks 16. The X Window System 17. Frequently Encountered Error Messages 18. Online Resources 19. How To Get Further Assistance 19.1. If this Document Still Hasn't Answered Your Question.... 19.2. What to Put in a Request for Help 19.3. How To Email Someone about Your Problem A. GNU Free Documentation License A.1. 0. PREAMBLE A.2. 1. APPLICABILITY AND DEFINITIONS A.3. 2. VERBATIM COPYING A.4. 3. COPYING IN QUANTITY A.5. 4. MODIFICATIONS A.6. 5. COMBINING DOCUMENTS A.7. 6. COLLECTIONS OF DOCUMENTS A.8. 7. AGGREGATION WITH INDEPENDENT WORKS A.9. 8. TRANSLATION A.10. 9. TERMINATION A.11. 10. FUTURE REVISIONS OF THIS LICENSE A.12. Addendum 1. Introduction 1.1. About the FAQ This document contains a collection of the answers to the most common questions people ask about Linux. It is available as WikiText source, DocBook XML, an ASCII text file, an HTML World Wide Web page, Postscript, PDF, Plucker, and as a USENET news posting. DocBook XML is generated from WikiText source using wt2db. HTML is generated from the XML using the LDP's XSL customization layer on top of Norm Walsh's standard DocBook XSL stylesheets. Text is generated from the HTML using lynx. Most of these programs are found in most Linux distributions. The Usenet version is posted regularly to news:news.answers, news: comp.answers, and news:comp.os.linux.misc. It is archived at ftp:// rtfm.mit.edu/pub/usenet-by-hierarchy/comp/os/linux/misc. The latest versions are available from the Linux Documentation Project. ----------------------------------------------------------------------------- 1.2. Asking Questions and Sending Comments If you have any comments, or if you have a question about Linux that was not answered here, feel free to send it to the maintainer: david -AT- lupercalia.net. Place the letters FAQ in the subject of your message. I won't guarantee to answer all questions, but I'll answer as many as I can. Questions that I receive repeatedly will be added to the FAQ. If you wish to refer to a question in the FAQ, please include the title of the question in your email. If you have an addition to the FAQ, by all means send it. Contributions may be in any format, but I prefer comments in English to patch files. Context diff is not my first language. ----------------------------------------------------------------------------- 1.3. Authorship and Acknowledgments This FAQ is currently compiled and maintained by David Merrill, with assistance and comments from Linux users all over the world. Over the years it has passed through several hands, and I'd like to recognize all the folks who have worked on it. In addition to those of us who have been official maintainers, the FAQ is full of individual contributions. The name of the contributor is listed along with the contribution. The FAQ was maintained by Robert Kiesling until January, 2002 Freddy Contreras, the_blur_oc@hotmail.com, designed and GPL'd the Linux Frequently Asked Questions logos. Special thanks are due to Matt Welsh, who moderated news: comp.os.linux.announce and news:comp.os.linux.answers, coordinated the HOWTO's and wrote substantial portions of many of them, Greg Hankins the former Linux Documentation Project HOWTO maintainer, Lars Wirzenius and Mikko Rauhala, the former and current moderators of news:comp.os.linux.announce, Marc-Michel Corsini, who wrote the original Linux FAQ, and Ian Jackson, the previous FAQ maintainer. Thanks also to Roman Maurer for his many updates and additions, especially with European Web sites, translations, and general miscellany. Other contributors include:   * Doug Jensen djen@ispwest.com Last but not least, thanks to Linus Torvalds and the other contributors to Linux for giving us something to talk about! ----------------------------------------------------------------------------- 1.4. Copyright and License Copyright (c) 2001 Robert Kiesling. Copyright (c) 2002, 2003 David Merrill. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is provided in the appendix, GNU Free Documentation License. The maintainer would be happy to answer any questions regarding the copyright. Unix is a trademark of AT&T Bell Laboratories. Linux is a trademark of Linus Torvalds. Other trademarks belong to their holders. ----------------------------------------------------------------------------- 1.5. Disclaimer While every attempt has been made to provide accurate and helpful information, I make no promises or guarantees of any kind. Use this information at your own risk. ----------------------------------------------------------------------------- 2. General Information Q: What Is Linux? Q: Is Linux Unix? Q: Who Wrote Linux? Q: How Is Linux Licensed? Q: How Does One Pronounce Linux? Q: How Many People Use Linux? Q: What Is Linux? A: The name "Linux" is used to refer to three similar yet slightly different things, which can be confusing to all but the hardcore geek. The three usages vary by how much of a complete software system the speaker is talking about. At the lowest level, every Linux system is based on the Linux kernel ?? the very low-level software that manages your computer hardware, multi-tasks the many programs that are running at any given time, and other such essential things. These low-level functions are used by other programs, so their authors can focus on the specific functionality they want to provide. Without the kernel, your computer is a very expensive doorstop. It has all of the features of a modern operating system: true multitasking, threads, virtual memory, shared libraries, demand loading, shared, copy-on-write executables, proper memory management, loadable device driver modules, video frame buffering, and TCP/IP networking. Most often, the name "Linux" is used to refer to the Linux Operating System. An OS includes the kernel, but also adds various utilities ?? the kinds of programs you need to get anything done. For example, it includes a shell (the program that provides a command prompt and lets you run programs), a program to copy files, a program to delete files, and many other odds and ends. Some people honor the request of Richard Stallman and the GNU Project, and call the Linux OS GNU/Linux, because a good number of these utility programs were written by the GNU folks. Finally, software companies (and sometimes volunteer groups) add on lots of extra software, like the XFree86 X Window System, Gnome, KDE, games and many other applications. These software compilations which are based on the Linux OS are called Linux distributions. So, there are three Linuxes: the Linux kernel, the Linux OS, and the various Linux distributions. Most people, however, refer to the operating system kernel, system software, and application software, collectively, as "Linux", and that convention is used in this FAQ as well. See also the Wikipedia articles on the Linux kernel and the Linux operating system. Q: Is Linux Unix? A: Officially an operating system is not allowed to be called a Unix until it passes the Open Group's certification tests, and supports the necessary API's. Nobody has yet stepped forward to pay the large fees that certification involves, so we're not allowed to call it Unix. Certification really doesn't mean very much anyway. Very few of the commercial operating systems have passed the Open Group tests. A: Unofficially, Linux is very similar to the operating systems which are known as Unix, and for many purposes they are equivalent. Linux the kernel is an operating system kernel that behaves and performs similarly to the famous Unix operating system from AT&T Bell Labs. Linux is often called a "Unix-like" operating system. For more information, see http:// www.unix-systems.org/what_is_unix.html. [Bob Friesenhahn] Q: Who Wrote Linux? A: Linus Torvalds and a loosely knit team of volunteer hackers from across the Internet wrote (and still are writing) Linux from scratch. Q: How Is Linux Licensed? A: Linus has placed the Linux kernel under the GNU General Public License, which basically means that you may freely copy, change, and distribute it, but you may not impose any restrictions on further distribution, and you must make the source code available. This is not the same as Public Domain. See the Copyright FAQ, ftp:// rtfm.mit.edu/pub/usenet/news.answers/law/copyright, for details. Full details are in the file COPYING in the Linux kernel sources (probably in /usr/src/linux on your system). There is a FAQ for the GPL at: http:// www.gnu.org/copyleft/gpl-faq.html. The licenses of the utilities and programs which come with the installations vary. Much of the code is from the GNU Project at the Free Software Foundation, and is also under the GPL. Some other major programs often included in Linux distributions are under a BSD license and other similar licenses. Note that discussion about the merits or otherwise of the GPL should be posted to the news group gnu.misc.discuss, and not to the news:comp.os.linux hierarchy. For legal questions, refer to the answer: Where Are Linux Legal Issues Discussed?. Q: How Does One Pronounce Linux? A: This question produces an outrageous amount of heated debate. If you want to hear Linus himself say how he pronounces it, download english.au or swedish.au from ftp://ftp.funet.fi/pub/Linux/PEOPLE/Linus/ SillySounds/. If you have a sound card or the PC-speaker audio driver you can hear them by typing $ cat english.au >/dev/audio The difference isn't in the pronunciation of Linux but in the language Linus uses to say, "hello". For the benefit of those who don't have the equipment or inclination: Linus pronounces Linux approximately as Leenus, where the ee is pronounced as in "feet," but rather shorter, and the u is like a much shorter version of the French eu sound in peur (pronouncing it as the u in "put" is probably passable). Q: How Many People Use Linux? A: Linux is freely available, and no one is required to register with any central authority, so it is difficult to know. Several businesses survive solely on selling and supporting Linux. Linux newsgroups are some of the most heavily read on Usenet. Accurate numbers are hard to come by, but the number is almost certainly in the millions. However, people can register as Linux users at the Linux Counter project, which has been in existence since 1993. In May of 2003 the project counted more than 134,000 users, but that is certainly only a small fraction of all users. The operator of the Linux Counter estimated 18 million users, as of May 2003. Visit the Web site at http://counter.li.org/ and fill in the registration form. The current count is posted monthly to news:comp.os.linux.misc, and is always available from the Web site. [Harald Tveit Alvestrand] A: In 1999, International Data Corporation released its first commercial forecast of Linux sales. The report quantifies Linux vendor sales in 1996, 1997, and 1998, and forecasts through the year 2003. To obtain the report, contact IDC at ctoffel@idc.com. Their Web site is http: //www.itresearch.com/. ----------------------------------------------------------------------------- 3. The Linux Kernel Q: What Platforms Does Linux Support? Q: What Hardware Is Supported? Q: Ports to Other Processors Q: How Does Linux Kernel Versioning Work? Q: Where Is the Latest Kernel Version on the Internet? Q: Does Linux Support Threads or Lightweight Processes? Q: What Version of Linux and What Machine Name Is This? Q: What is a BogoMip? Q: Does Linux Support USB Devices? Q: Can Linux Use More than 3 Serial Ports by Sharing Interrupts? Q: What Platforms Does Linux Support? A: Linux runs on almost every general-purpose computer made in the last 10 years. It runs on systems as small as PDAs (for example, the Sharp Zaurus) and on systems as large as IBM mainframes. There are Linux distributions specifically for mobile and handheld platforms. Information on the Linux distribution for the Compaq iPAQ is at http:// www.handhelds.org. A: Linux was written originally for Intel processor based PC's, using the hardware facilities of the 80386 processor and its successors to implement its features. The 80386 family includes the 80486 and all of the Pentium chips. However, there are now many ports to other hardware platforms. See Ports to Other Processors. Refer also to the Linux INFO-SHEET for more details as well as the answers to Where Is the Documentation?, What Hardware Is Supported?, and Ports to Other Processors, below. Q: What Hardware Is Supported? A: A minimal Linux installation requires a machine for which a port exists, at least 2Mb of RAM, and a single floppy drive, but to do anything even remotely useful, more RAM and disk space are needed. Refer to: Ports to Other Processors, What are the Disk Space Requirements for Minimal, Server, and Workstation Use?, and What are the Minimum and Maximum Memory Requirements?. Intel CPU, PC-compatible machines require at least an 80386 processor to run the standard Linux kernel. Linux, including the X Window System GUI, runs on most current laptops. Refer to the answer for: How Do I Find Out If a Notebook Runs Linux?. There are numerous sources of information about specific PC's, video cards, disk controllers, and other hardware. Refer to the INFO-SHEET, Laptop-HOWTO, and the Unix-Hardware-Buyer-HOWTO. See Where Is the Documentation?. Q: Ports to Other Processors A: Ports are currently available for:   * Compaq Alpha AXP   * Sun SPARC and UltraSPARC   * Motorola 68000   * PowerPC   * PowerPC64   * ARM   * Hitachi SuperH   * IBM zSeries and S/390   * MIPS   * HP PA-RISC   * Intel IA-64   * DEC VAX   * AMD x86-64   * CRIS A: There are always efforts underway to port Linux onto new processors. Linux Online maintains a http://www.linux.org/projects/ports.html:list of ports currently in development. In addition, the following information is available about specific ports: On Intel platforms, VESA Local Bus and PCI bus are supported. MCA (IBM's proprietary bus) and ESDI hard drives are mostly supported. There is further information on the MCA bus and what cards Linux supports on the Micro Channel Linux Web page, http://www.dgmicro.com/mca. Refer also to the answer for: Where Is the Linux Stuff on the World Wide Web?. There is a port of Linux to the 8086, known as the Embeddable Linux Kernel Subset (ELKS). This is a 16-bit subset of the Linux kernel which will mainly be used for embedded systems, at: http://www.linux.org.uk/Linux8086.html. Standard Linux does not run 8086 or 80286 processors, because it requires task-switching and memory management facilities found on 80386 and later processors. Linux supports multiprocessing with Intel MP architecture. See the file Documentation/smp.tex in the Linux kernel source code distribution. An API specification and developers kit for the Crusoe Smart Microprocessor developed by Transmeta Corporation are at http://www.transmeta.com. A project has been underway for a while to port Linux to suitable 68000-series based systems like Amigas and Ataris. The Linux/m68K FAQ is located at http://www.clark.net/pub/lawrencc/linux/faq/faq.html. The URL of the Linux/m68k home page is http://www.linux-m68k.org/faq/faq.html. There is also a linux-680x0 mailing list. See What Mailing Lists Are There?. There is (or was) a FTP site for the Linux-m68k project on ftp:// ftp.phil.uni-sb.de/pub/atari/linux-68k, but this address may no longer be current. Debian GNU/Linux has ports to Alpha, Sparc, Motorola 68k, PowerPC, ARM, IBM S /390, MIPS, HP PA-RISC, and IA-64. A Port to amd64 is being developed. There are mailing lists for all of them. See http://www.debian.org/MailingLists/ for general information, then follow the "subscription" link, and find the mailing list you are interested in. One of the Linux-PPC project pages is http://www.linuxppc.org, and the archive site is ftp://ftp.linuxppc.org/linuxppc. There are two sites for the Linux iMac port: http://w3.one.net/~johnb/ imaclinux, and http://www.imaclinux.net:8080/content/index.html. A port to the 64-bit DEC Alpha/AXP is at http://www.azstarnet.com/~axplinux/. There is a mailing list at vger.redhat.com: see What Mailing Lists Are There? . Ralf Baechle is working on a port to the MIPS, initially for the R4600 on Deskstation Tyne machines. The Linux-MIPS FTP sites are ftp://ftp.fnet.fr/ linux-mips and ftp://ftp.linux.sgi.com/pub/mips-linux. Interested people may mail their questions and offers of assistance to linux@waldorf-gmbh.de. There is (or was) also a MIPS channel on the Linux Activists mail server and a linux-mips mailing list. See What Mailing Lists Are There?. There are currently two ports of Linux to the ARM family of processors. One of these is for the ARM3, fitted to the Acorn A5000, and it includes I/O drivers for the 82710/11 as appropriate. The other is to the ARM610 of the Acorn RISC PC. The RISC PC port is currently in its early to middle stages, owing to the need to rewrite much of the memory handling. The A5000 port is in restricted beta testing. A release is likely soon. For more, up-to-date information, read the newsgroup news:comp.sys.acorn.misc . There is a FAQ at http://www.arm.uk.linux.org. The Linux SPARC project is a hotbed of activity. There is a FAQ and plenty of other information available from the UltraLinux page, http:// www.ultralinux.org. The Home Page of the UltraSPARC port ("UltraPenguin") is located at http:// sunsite.mff.cuni.cz/linux/ultrapenguin-1.0/, although the URL may not be current. There is also a port to SGI/Indy machines ("Hardhat"). The URL is http:// www.linux.sgi.com. Q: How Does Linux Kernel Versioning Work? A: At any given time, there are several "stable" versions of Linux, and one "development" version. Unlike most proprietary software, older stable versions continue to be supported for as long as there is interest, which is why multiple versions exist. Linux version numbers follow a longstanding tradition. Each version has three numbers, i.e., X.Y.Z. The "X" is only incremented when a really significant change happens, one that makes software written for one version no longer operate correctly on the other. This happens very rarely -- in Linux's history it has happened exactly once. The "Y" tells you which development "series" you are in. A stable kernel will always have an even number in this position, while a development kernel will always have an odd number. The "Z" specifies which exact version of the kernel you have, and it is incremented on every release. The current stable series is 2.4.x, and the current development series is 2.5.x. However, many people continue to run 2.2.x and even 2.0.x kernels, and they als o continue to receive bugfixes. The development series is the code that the Linu x developers are actively working on, which is always available for public viewing, testing, and even use, although production use is not recommended! This is part of the "open source development" method. Eventually, the 2.5.x development series will be "sprinkled with holy penguin pee" and become the 2.6.0 kernel and a new stable series will then be established, and a 2.7.x development series begun. Or, if any really major changes happen, it might become 3.0.0 instead, and a 3.1.x series begun. Q: Where Is the Latest Kernel Version on the Internet? A: The easiest way to update your kernel is to get the update directly from the distribution which you are running. A: If you need or want to configure and compile your own kernel, the web page at http://www.kernel.org/ lists the current versions of the development and production kernels. If you want to download the source code, FTP to ftp.xx.kernel.org, where xx is the two-letter Internet domain abbreviation of your country; e.g., us for United States, ca for Canada, or de for Germany. Kernel versions 2.2.x are archived in the directory pub/linux/kernel/v2.2, as are patches for the prerelease versions. The kernel source code is archived as a .tar.gz file, and as a .tar.bz2 file. Follow the instructions in any of the standard references to compile the kernel, as you would with any other custom kernel. The Documentation subdirectory contains information by the authors of various subsystems and drivers, and much of that information is not documented elsewhere. If you want to participate in kernel development, make sure that you sign on to the linux-kernel mailing list to find out what people are working on. Refer to the answer: What Mailing Lists Are There?. There is a story about the features of the 2.4 series kernels at http:// features.linuxtoday.com/stories/8191.html. Q: Does Linux Support Threads or Lightweight Processes? A: As well as the Unix multiprocessing model involving heavyweight processes, which is of course part of the standard Linux kernel, there are several implementations of lightweight processes or threads. Recent kernels implement a thread model, kthreads. In addition, there are the following packages available for Linux.   * GNU glibc2 for Linux has optional support for threads. The archive is available from the same place as glibc2, ftp://ftp.gnu.org/pub/gnu/   * In ftp://sipb.mit.edu/pub/pthread/ or ftp://ftp.ibp.fr:/pub/unix/threads/ pthreads. Documentation isn't in the package, but is available on the World Wide Web at http://www.mit.edu:8001/people/proven/home_page.html. Newer Linux libc's contain the pthreads source. The GNU Ada compiler on ftp://metalab.unc.edu/pub/Linux/devel/lang/ada/ contains binaries made from that source code.   * In ftp://ftp.cs.washington.edu/pub/qt-001.tar.Z is QuickThreads. More information can be found in the technical report, available on the same site is /tr/1993/05/UW-CSE-93-05-06.PS.Z.   * In ftp://ftp.cs.fsu.edu/pub/PART/, an Ada implementation. This is useful mainly because it has a lot of Postscript papers that you'll find useful in learning more about threads. This is not directly usable under Linux. Please contact the authors of the packages in question for details. Q: What Version of Linux and What Machine Name Is This? A: Type: $ uname -a Q: What is a BogoMip? A: "BogoMips" is a combination of Bogus and Mips. MIPS stands for (depending on who you ask) Millions of Instructions per Second, or Meaningless Indication of Processor Speed. The number printed at boot time is the result of a kernel timing calibration, used for very short delay loops by some device drivers. According to the BogoMips mini-HOWTO, the rating for your machine will be: Common BogoMips Ratings Processor BogoMips Comparison --------- -------- ---------- Intel 8088 clock * 0.004 0.02 Intel/AMD 386SX clock * 0.14 0.8 Intel/AMD 386DX clock * 0.18 1 (definition) Motorola 68030 clock * 0.25 1.4 Cyrix/IBM 486 clock * 0.34 1.8 Intel Pentium clock * 0.40 2.2 Intel 486 clock * 0.50 2.8 AMD 5x86 clock * 0.50 2.8 Mips R4000/R4400 clock * 0.50 2.8 Nexgen Nx586 clock * 0.75 4.2 PowerPC 601 clock * 0.84 4.7 Alpha 21064/21064A clock * 0.99 5.5 Alpha 21066/21066A clock * 0.99 5.5 Alpha 21164/21164A clock * 0.99 5.5 Intel Pentium Pro clock * 0.99 5.5 Cyrix 5x86/6x86 clock * 1.00 5.6 Intel Pentium II/III clock * 1.00 5.6 Intel Celeron clock * 1.00 5.6 Mips R4600 clock * 1.00 5.6 Alpha 21264 clock * 1.99 11.1 AMD K5/K6/K6-2/K6-III clock * 2.00 11.1 UltraSparc II clock * 2.00 11.1 Pentium MMX clock * 2.00 11.1 PowerPC 604/604e/750 clock * 2.00 11.1 Motorola 68060 clock * 2.01 11.2 Motorola 68040 Not enough data (yet). AMD Athlon Not enough data (yet). IBM S390 Not enough data (yet). If the number is wildly lower, you may have the Turbo button or CPU speed set incorrectly, or have some kind of caching problem (as described in Why Does the System Slow to a Crawl When Adding More Memory?). For values people have seen with other, rarer, chips, or to calculate your own BogoMips rating, please refer to the BogoMips Mini-HOWTO, on ftp:// metalab.unc.edu/. See Where Is the Documentation?. [Wim van Dorst] Q: Does Linux Support USB Devices? A: Linux supports a few dozen USB devices at present, and work is underway to develop additional device drivers. There is a Web page devoted to the subject, at http://www.linux-usb.org. There is also LDP documentation, at: Where Is the Linux Stuff on the World Wide Web?. Support for USB version 2.0 was recently added to development kernels, but is not yet available in the 2.4 series. Q: Can Linux Use More than 3 Serial Ports by Sharing Interrupts? A: Yes, but you won't be able to use simultaneously two ordinary ports which share an interrupt (without some trickery). This is a limitation of the ISA Bus architecture. See the Serial HOWTO for information about possible solutions and workarounds for this problem. ----------------------------------------------------------------------------- 4. Disk Drives Q: Does Linux Support SCSI Drives? Q: Does Linux Support IDE Drives? Q: Does Linux Support CD-ROM Drives? Q: Does Linux Support DVD Drives? Q: Why Doesn't the AHA1542C Card Work With Linux? Q: How Can I Get Linux to Work With My Disk? Q: Does Linux Support SCSI Drives? A: Coming soon... Q: Does Linux Support IDE Drives? A: Coming soon... Q: Does Linux Support CD-ROM Drives? A: Coming soon... Q: Does Linux Support DVD Drives? A: Coming soon... Q: Why Doesn't the AHA1542C Card Work With Linux? A: The option to allow disks with more than 1024 cylinders, which the AHA1542C card can recognize, is only required as a workaround for a PC-compatible BIOS misfeature and should be turned off under Linux. For older Linux kernels you need to turn off most of the advanced BIOS options all but the one about scanning the bus for bootable devices. Q: How Can I Get Linux to Work With My Disk? A: If your disk is an IDE or EIDE drive, you should read the file /usr/src/ linux/drivers/block/README.ide (part of the Linux kernel source code). This README contains many helpful hints about IDE drives. Many modern IDE controllers do translation between "physical" cylinders/heads/sectors, and "logical" ones. SCSI disks are accessed by linear block numbers. The BIOS invents some "logical" cylinder/head/sector fiction to support DOS. Older IBM PC-compatible BIOS's will usually not be able to access partitions which extend beyond 1024 logical cylinders, and will make booting a Linux kernel from such partitions using LILO problematic at best. You can still use such partitions for Linux or other operating systems that access the controller directly. It's recommend that you create at least one Linux partition entirely under the 1024 logical cylinder limit, and boot from that. The other partitions will then be okay. Also there seems to be a bit of trouble with the newer Ultra-DMA drives. I haven't gotten the straight scoop on thembut they are becoming a very common problem at the SVLUG installfests. When you can get 8 to 12 Gig drives for $200 to $300 it's no wonder. [Jim Dennis] ----------------------------------------------------------------------------- 5. Partitions And Filesystems Q: Does Linux Support Virtualized File Systems Like RAID? Q: Can Linux Use the Same Hard Drive as MS-DOS? OS/2? 386BSD? Win95? Q: How Do I Access Files on a MS-DOS Partition or Floppy? Q: Does Linux Support Compressed Ext2 File Systems? Q: Can Linux Use Stacked/DBLSPC/Etc. DOS Drives? Q: Can Linux Access OS/2 HPFS Partitions? Q: Can Linux Access Amiga File Systems? Q: Can Linux Access BSD, SysV, Etc. UFS? Q: Can Linux Access MacIntosh File Systems? Q: How Do I Create a File System on a Floppy? Q: Does Linux Support File System Encryption? Q: How Do I Resize a Partition Non-Destructively? Q: Where Is the Journalling File System on the Net? Q: Why Isn't My Virtual Memory Swap Area Working? Q: How Do I Add Temporary Swap Space? Q: Does Linux Support Virtualized File Systems Like RAID? A: The most recent Linux kernels support software RAID, and they will work with RAID disk controllers. An automounter for NFS partitions is part of most Linux distributions. In addition, several virtual file system projects exist. One of them, the Linux Logical Volume Manager, is located at http://linux.msede.com/lvm/. Q: Can Linux Use the Same Hard Drive as MS-DOS? OS/2? 386BSD? Win95? A: Yes. Linux supports many, many filesystems, including the standard MS-DOS partitioning scheme, so it can share your disk with other operating systems. Linux supports all known versions of the Microsoft FAT and VFAT file systems, including those used by Windows 95, Windows 98, Windows NT, Windows 2000 and Windows ME through loadable kernel modules. In a correctly configured system, they should load automatically when the partitions are mounted. Note, however, that many other operating systems may not be exactly compatible. DOS's FDISK.EXE and FORMAT.EXE, for example, can overwrite data in a Linux partition, because they sometimes incorrectly use partition data from the partition's boot sector rather than the partition table. In order to prevent programs from doing this, it is a good idea to zero out under Linux the start of a partition you created, before you use MS-DOS or whatever to format it. Type: $ dd if=/dev/zero of=/dev/hdXY bs=512 count=1 where hdXY is the relevant partition; e.g., /dev/hda1 for the first partition of the first (IDE) disk. Linux can read and write the files on your DOS and OS/2 FAT partitions and floppies using either the DOS file system type built into the kernel or mtools. There is reportedly a GPL'd OS/2 device driver that will read and write Linux ext2 partitions. For information about FAT32 partition support, see http://bmrc.berkeley.edu/ people/chaffee/fat32.html. See What Software does Linux Support? for details and status of the emulators for DOS, MS Windows, and System V programs. See also, "Can Linux access Amiga file systems?", "Can Linux access Macintosh file systems?", "Can Linux access BSD, SysV, etc., UFS?", and "Can Linux access SMB file systems?" There are said to be NTFS drivers under development, which should support compression as a standard feature. Q: How Do I Access Files on a MS-DOS Partition or Floppy? A: Use the DOS file system, type, for example: $ mkdir /dos $ mount -t msdos -o conv=text,umask=022,uid=100,gid=100 /dev/hda3 /dos If it's a floppy, don't forget to umount it before ejecting it! You can use the conv=text/binary/auto, umask=nnn, uid=nnn, and gid=nnn options to control the automatic line-ending conversion, permissions and ownerships of the files in the DOS file system as they appear under Linux. If you mount your DOS file system by putting it in your /etc/fstab, you can record the options (comma-separated) there, instead of defaults. Alternatively, you can use mtools, available in both binary and source form on the FTP sites. See Where Are the Linux FTP Archives?. A kernel patch (known as the fd-patches) is available which allows floppies with nonstandard numbers of tracks and/or sectors to be used; this patch is included in the 1.1 alpha testing kernel series. Q: Does Linux Support Compressed Ext2 File Systems? A: The ext2compr project provides a kernel patch Information about them is located at http://e2ompr.memalpha.cx/e2compr/. There is also a Web site for the e2compr patches. The code is still experimental and consists of patches for the 2.0 and 2.1 kernels. For more information about the project, including the latest patches, and the address of the mailing list, look up the URL at http://debs.fuller.edu/e2compr/. [Roderich Schupp, Peter Moulder A: zlibc is a program that allows existing applications to read compressed (GNU gzip'ed) files as if they were not compressed. Look at ftp:// metalab.unc.edu/pub/Linux/libs/. The author is Alain Knaff. A: There is also a compressing block device driver, "DouBle," by Jean-Marc Verbavatz, which can provide on-the-fly disk compression in the kernel. The source-only distribution is located at ftp://metalab.unc.edu/pub/Linux/ patches/diskdrives/. This driver compresses inodes and directory information as well as files, so any corruption of the file system is likely to be serious. A: There is also a package called tcx (Transparently Compressed Executables), which allows you to keep infrequently used executables compressed and only uncompress them temporarily when in use. It is located at ftp:// metalab.unc.edu/pub/Linux/utils/compress/. Q: Can Linux Use Stacked/DBLSPC/Etc. DOS Drives? A: Until recently, not very easily. You can access DOS 6.X volumes from the DOS emulator ("What software does Linux support? "), but it's harder than accessing a normal DOS volume via the DOS kernel option, a module, or mtools. There is a recently added package, dmsdos, that reads and writes compressed file systems like DoubleSpace/DriveSpace in MS-DOS 6.x and Win95, as well as Stacker versions 3 and 4. It is a loadable kernel module. Look at ftp:// metalab.unc.edu/pub/Linux/system/filesystems/dosfs/. Q: Can Linux Access OS/2 HPFS Partitions? A: Yes, but Linux access to HPFS partitions is read-only. HPFS file system access is available as an option when compiling the kernel or as a module. See the Documentation/filesystems/hpfs.txt file in the kernel source distribution. See How To Upgrade/Recompile a Kernel. Then you can mount HPFS partition, using, for example: $ mkdir /hpfs $ mount -t hpfs /dev/hda5 /hpfs Q: Can Linux Access Amiga File Systems? A: The Linux kernel has support for the Amiga Fast File System (AFFS) version 1.3 and later, both as a compile-time option and as a module. The file Documentation/filesystems/affs.txt in the Linux kernel source distribution has more information. See How To Upgrade/Recompile a Kernel. Linux supports AFFS hard-drive partitions only. Floppy access is not supported due to incompatibilities between Amiga floppy controllers and PC and workstation controllers. The AFFS driver can also mount disk partitions used by the Un*x Amiga Emulator, by Bernd Schmidt. Q: Can Linux Access BSD, SysV, Etc. UFS? A: Recent kernels can mount (read only) the UFS file system used by System V; Coherent; Xenix; BSD; and derivatives like SunOS, FreeBSD, NetBSD, and NeXTStep. UFS support is available as a kernel compile-time option and a module. See How To Upgrade/Recompile a Kernel. Q: Can Linux Access MacIntosh File Systems? A: There is a set of user-level programs that read and write the older Macintosh Hierarchical File System (HFS). It is available at metalab.unc.edu/ pub/Linux/utils/disk-management/. Access to the newer, HFS+ file systems is still under development. Q: How Do I Create a File System on a Floppy? A: If you are running recent Gnome or KDE desktops, you have a GUI tool that makes formatting floppies easy. A: To format a 3.5-inch, high density floppy at the command prompt: $ fdformat /dev/fd0H1440 $ mkfs -t ext2 -m 0 /dev/fd0H1440 1440 For a 5.25 inch floppy, use /dev/fd0h1200 and 1200 as appropriate. For the B: drive use /dev/fd1 instead of /dev/fd0. The -m 0 option tells mkfs.ext2 not to reserve any space on the disk for the superuserusually the last 10% is reserved for root. The first command performs a low-level format. The second creates an empty file system. You can mount the floppy like a hard disk partition and simply cp and mv files, etc. Device naming conventions generally are the same as for other unices. They can be found in Matt Welsh's Installation and Getting Started guide. Refer to Where Is the Documentation?. A more detailed and technical description is Linux Allocated Devices by H. Peter Anvin, hpa@zytor.com, which is included in LaTeX and ASCII form in the kernel source distribution (probably in /usr/ src/kernel/Documentation/), as devices.tex and devices.txt. Q: Does Linux Support File System Encryption? A: Yes. One file system, ppdd, is archived at http://pweb.de.uu.net/ flexsys.mtk/. Q: How Do I Resize a Partition Non-Destructively? A: Use the FIPS.EXE program, included with most Linux distributions,under MS-DOS. A: GNU parted, a partition editor, is stable enough for non-guru, mere-mortal use with relative confidence. Source code for the latest version is at: ftp:/ /ftp.gnu.org/pub/gnu/parted/. There's also a boot disk image for resizing root partitions and for running parted on non-Linux machines. The disk image may be easier for beginners. Building from source could require some extra configuration. Parted also has tutorial-style, plain-text documentation for Linux and FAT (MS-DOS) file systems. A: Also, some commercial distributions come with their own partitioning software, like Partition Magic. Q: Where Is the Journalling File System on the Net? A: Linux actually supports several journalling file systems. ext3 is now included in current 2.4.x kernels. A: The journalling file system named Reiserfs has just been released from testing. It is said to make Linux even faster than Linux with the Ext2 file system installed, particularly when dealing with many small files. Complete information is available at http://devlinux.org/namesys/. A: JFS is still under development. Q: Why Isn't My Virtual Memory Swap Area Working? A: When you boot (or enable swapping manually) you should see Adding Swap: NNNNk swap-space If you don't see any messages at all you are probably missing swapon -av (the command to enable swapping) in your /etc/rc.local or /etc/rc.d/* (the system startup scripts), or have forgotten to make the right entry in /etc/ fstab: /dev/hda2 none swap sw for example. If you see: Unable to find swap-space signature you have forgotten to run mkswap. See the manual page for details; it works much like mkfs. Running the command free, in addition to showing free memory, should display: total used free Swap: 10188 2960 7228 If typing cat /proc/swaps reveals only file or partition names, but no swap space information, then the swap file or partition needs re-initialization. Use fdisk (as root) to determine which partition on a hard drive has been designated as the swap partition. The partition still needs to be initialized with mkswap before enabling it with swapon. [Andy Jefferson, Steve Withers] Q: How Do I Add Temporary Swap Space? A: In addition to a swap partition, Linux can also use a swap file. Some programs, like g++, can use huge amounts of virtual memory, requiring the temporary creation of extra space. To install an extra 64 MB of swap space, for example, use the following shell commands: # dd if=/dev/zero of=/swap bs=1024 count=65535 # mkswap /swap # swapon /swap The count= argument to dd determines how big the swap file will be. In this example the swap file's name is /swap, but the name and location are, generally, arbitrary, depending only on the file system's available space and your having write permissions in the directory. When you don't need the swap space any more, remove it with the following statements: # swapoff /swap # rm /swap Take a look also at the Installation HOWTO and Installation & Getting Started for detailed instructions. If that still doesn't provide enough swap space, refer to How To Have More Than 128Mb of Swap. ----------------------------------------------------------------------------- 6. System Libraries Q: Where Can I Find Linux System Specifications? Q: What Is ld.so and How Do I Get It? Q: How Do I Upgrade the Libraries without Trashing the System? Q: What's All This about ELF? glibc? Q: Where Can I Find Linux System Specifications? A: As a start, look at the Linux Standards Base, http://www.linuxbase.org. The site contains information about test software, file system organization, and shared library naming conventions. Q: What Is ld.so and How Do I Get It? A: ld.so is the dynamic library loader. Each binary using shared libraries used to have about 3K of start-up code to find and load the shared libraries. Now that code has been put in a special shared library, /lib/ld.so, where all binaries can look for it, so that it wastes less disk space, and can be upgraded more easily. ld.so can be obtained from http://tsx-11.mit.edu/pub/linux/packages/GCC/ and mirror sites. The latest version at the time of writing is ld.so.1.9.5.tar.gz. /lib/ld-linux.so.1 is the same thing for ELF ("What's all this about ELF? ") and comes in the same package as the a.out loader. Q: How Do I Upgrade the Libraries without Trashing the System? A: Warning You should always have a rescue disk set ready when you perform this procedure, in the likely event that something goes wrong! This procedure is especially difficult if you're upgrading very old libraries like libc4. But you should be able to keep libc4 on the same system with libc5 libraries for the programs that still need them. The same holds true for upgrading from libc5 to the newer-yet glibc2 libraries. The problem with upgrading dynamic libraries is that the moment you remove the old libraries, the utilities that you need to upgrade to the new version of the libraries don't work. There are ways around around this. One is to temporarily place a spare copy of the run time libraries, which are in /lib/, in /usr/lib/, or /usr/local/lib/, or another directory that is listed in the /etc/ld.so.conf file. For example, when upgrading libc5 libraries, the files in /lib/ might look something like: libc.so.5 libc.so.5.4.33 libm.so.5 libm.so.5.0.9 These are the C libraries and the math libraries. Copy them to another directory that is listed in /etc/ld.so.conf, like /usr/lib/: $ cp -df /lib/libc.so.5* /usr/lib/ $ cp -df /lib/libm.so.5* /usr/lib/ $ ldconfig Be sure to run ldconfig to upgrade the library configuration. The files libc.so.5 and libm.so.5 are symbolic links to the actual library files. When you upgrade, the new links will not be created if the old links are still there, unless you use the -f flag with cp. The -d flag to cp will copy the symbolic link itself, and not the file it points to. If you need to overwrite the link to the library directly, use the -f flag with ln. For example, to copy new libraries over the old ones, try this. Make a symbolic link to the new libraries first, then copy both the libraries and the links to /lib/, with the following commands. $ ln -sf ./libm.so.5.0.48 libm.so.5 $ ln -sf ./libc.so.5.0.48 libc.so.5 $ cp -df libm.so.5* /lib $ cp -df libc.so.5* /lib Again, remember to run ldconfig after you copy the libraries. If you are satisfied that everything is working correctly, you can remove the temporary copies of the old libraries from /usr/lib/ or wherever you copied them. Q: What's All This about ELF? glibc? A: See the ELF HOWTO by Daniel Barlow. Note that this is not the file move-to-elf, which is a blow-by-blow account of how to upgrade to ELF manually. Linux has two different formats for executables, object files, and object code libraries, known as, "ELF". (The old format is called "a.out".) They have advantages, including better support for shared libraries and dynamic linking. Both a.out and ELF binaries can coexist on a system. However, they use different shared C libraries, both of which have to be installed. If you want to find out whether your system can run ELF binaries, look in / lib for a file named, libc.so.5. If it's there, you probably have ELF libraries. If you want to know whether your installation actually is ELF you can pick a representative program, like ls, and run file on it: -chiark:~> file /bin/ls /bin/ls: Linux/i386 impure executable (OMAGIC) - stripped valour:~> file /bin/ls /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1, stripped There is a patch to get 1.2.x to compile using the ELF compilers, and produce ELF core dumps, at ftp://tsx-11.mit.edu/pub/packages/GCC/. You do not need the patch merely to run ELF binaries. 1.3.x and later do not need the patch at all. The GNU glibc2 libraries are essentially more recent versions of ELF libraries that follow most of the same processes for dynamic linking and loading. Upgrade information is contained in How Do I Upgrade the Libraries without Trashing the System?. ----------------------------------------------------------------------------- 7. Linux Distributions Q: How Do I Get Started? Q: What are the Disk Space Requirements for Minimal, Server, and Workstation Use? Q: What are the Minimum and Maximum Memory Requirements? Q: What Is the Best Distribution, SCSI Card, Editor, CD-ROM Drive, etc? Q: How Can I Get a Distribution? Q: Where Are the Linux FTP Archives? Q: How Do I Install Linux Using FTP? Q: How Can I Get Linux Without FTP Access? Q: How Do I Install Linux? Q: How Do I Get Started? A: If you are new to Linux, you should start by buying or downloading a general-purpose Linux distribution. A distribution is a complete operating system, including the Linux kernel and all the utilities and software you are likely to need, ready to install and use. Most distributions include thousands of software packages, including user-friendly desktops, office suites, and games. There are a handful of major Linux distributions, and as a beginner you are probably safer using one of them. For information about them, and how they are installed, see the Distributions-HOWTO from the Linux Documentation Project. Also, a list of distributions is updated weekly at http://lwn.net. Before you select which distribution you want to try, read their descriptions carefully and compare them to your needs. Each distribution is tailored to a particular type of user. Some are optimized to function as servers, some are optimized for gaming, and some are optimized for desktop and office use. There are a few distributions which are considered to be outstanding choices for new users:   * Red Hat is particularly good for servers   * Mandrake is excellent as a desktop system   * SuSE is also excellent as a desktop system There are also a large number of releases which are distributed less globally that suit special local and national needs. Many of them are archived at ftp: //ftp.tux.org. Q: What are the Disk Space Requirements for Minimal, Server, and Workstation Use? A: Linux needs about 10Mb for a very minimal installation, suitable for trying Linux, and not much else. You can fit a typical server installation, including the X Window System GUI, into 80Mb. Installing a small Debian GNU/Linux workstation takes from 500Mb to 1GB, including kernel source code, some space for user files, and spool areas. Installing a commercial distribution that has a desktop GUI environment, commercial word processor, and front-office productivity suite, will claim 15.1 GB of disk space, approximately. A fully installed Debian GNU/Linux system could use several Gigabytes of disk space. Q: What are the Minimum and Maximum Memory Requirements? A: Linux needs at least 4MB, and then you will need to use special installation procedures until the disk swap space is installed. Linux will run comfortably in 4MB of RAM, although running GUI apps is impractically slow because they need to swap out to disk. Some applications, like StarOffice, require 32 MB of physical memory, and compiling C++ code can easily consume over 100 MB of combined physical and virtual memory. There is a distribution, "Small Linux", that will run on machines with 2MB of RAM. Refer to the answer to: Where Are the Linux FTP Archives?. A number of people have asked how to address more than 64 MB of memory, which is the default upper limit in most standard kernels. Either type, at the BOOT lilo: prompt: mem=XXM Or place the following in your /etc/lilo.conf file: append="mem=XXM" The parameter "XXM" is the amount of memory, specified as megabytes; for example, "128M." If an "append=" directive with other configuration options already exists in /etc/lilo.conf, then add the mem= directive to the end of the existing argument, and separated from the previous arguments by a space; e.g.: # Example only; do not use. append="parport=0x3bc,none serial=0x3f8,4 mem=XXM" Be sure to run the "lilo" command to install the new configuration. If Linux still doesn't recognize the extra memory, the kernel may need additional configuration. Refer to the /usr/src/linux/Documentation/ memory.txt file in the kernel source as a start. For further information about LILO, refer to the manual pages for lilo and lilo.conf, the documentation in /usr/doc/lilo, the LILO-HOWTO, and the answer for: How Do I Set the Boot-Time Configuration?, below. Q: What Is the Best Distribution, SCSI Card, Editor, CD-ROM Drive, etc? A: The "best" of anything depends on your particular needs. Discussions like these frequently occur on Usenet. Most often they're flame bait. Answering is generally a waste of time. Free software licensing is unrestrictive enough, that, with a little experience, you can perform your own testing on your own hosts. A better way to phrase a specific inquiry might be: "Where can I find...." Q: How Can I Get a Distribution? A: If you can, please dig into your wallet and buy a copy of your distribution. Linux distributions are extremely inexpensive - usually around $30 for a complete system, and anywhere from $70 to around $150 for a larger system with more server software or development tools. Even the $30 "basic" systems contain the equivalent of thousands of dollars in proprietary tools, and are an incredible value. The distributors invest many of your dollars into further development, and most of them fund outside open source projects. Commercial distributions are available from book and electronics stores, or you can order from their websites. If you use Debian GNU/Linux, which is a volunteer project and a non-profit, you can donate directly to them instead. A: There are some websites that sell Linux CD's very inexpensively. Try:   * http://www.cheapbytes.com A: Every distribution provides a download on their home page. This is a requirement of the licensing terms of the software, so if you cannot afford to pay for your distribution, you can get a copy this way. Some people compromise between paying and downloading, for example by buying each major release (such as 6.0) but downloading the point releases (such as 6.1 and 6.2). Also, archives of many of the distributions are on line at: ftp://ftp.tux.org and http://planetmirror.com/pub/linux. A: Some hardware vendors now ship systems with Linux pre-installed. However, they sometimes make it very difficult to buy them - they offer Linux on only a few systems, which are server machines, or they require you to go to a special "Linux" section on their website. Q: Where Are the Linux FTP Archives? A: There are three main archive sites for Linux:   * ftp://ftp.funet.fi/pub/OS/Linux/ (Finland).   * http://ibiblio.org/pub/linux/ (US), with a nice WWW interface.   * ftp://tsx-11.mit.edu//pub/linux/ (US). The best place to get the Linux kernel is ftp://ftp.kernel.org/pub/linux/ kernel/. Linus Torvalds uploads the most recent kernel versions to this site. Of the U.S. distributions, Debian GNU/Linux is available at http:// www.debian.org/distrib/. Red Hat Linux's home site is ftp://ftp.redhat.com/, and Linux Slackware's is ftp://ftp.freesoftware.com/. The Small Linux distribution, which can run in 2 MB of RAM, is located at http://smalllinux.netpedia.net/. The contents of these sites is mirrored (copied, usually approximately daily) by a number of other sites. Please use a site close to you will be faster for you and easier on the network.   * ftp://ftp.sun.ac.za/pub/linux/sunsite/ (South Africa)   * ftp://ftp.is.co.za/linux/sunsite/ (South Africa)   * ftp://ftp.cs.cuhk.hk/pub/Linux/ (Hong Kong)   * ftp://sunsite.ust.hk/pub/Linux/ (Hong Kong)   * ftp://ftp.spin.ad.jp/pub/linux/ (Japan)   * ftp://ftp.nuri.net/pub/Linux/ (Korea)   * ftp://ftp.jaring.my/pub/Linux/ (Malaysia)   * ftp://ftp.nus.sg/pub/unix/Linux/ (Singapore)   * ftp://ftp.nectec.or.th/pub/mirrors/linux/ (Thailand)   * ftp://planetmirror.com/pub/linux (Australia) (Also take a look at http:// planetmirror.com/archives.php.)   * ftp://ftp.monash.edu.au/pub/linux/ (Australia)   * ftp://ftp.univie.ac.at/systems/linux/sunsite/ (Austria)   * ftp://ftp.fi.muni.cz/pub/Unix/linux/ (Czech Republic)   * ftp://ftp.funet.fi/pub/Linux/sunsite/ (Finland)   * ftp://ftp.univ-angers.fr/pub/Linux/ (France)   * ftp://ftp.iut-bm.univ-fcomte.fr/ (France)   * ftp://ftp.ibp.fr/pub/linux/sunsite/ (France)   * ftp://ftp.loria.fr/pub/linux/sunsite/ (France)   * ftp://ftp.dfv.rwth-aachen.de/pub/linux/sunsite/ (Germany)   * ftp://ftp.germany.eu.net/pub/os/Linux/Mirror.SunSITE/ (Germany)   * ftp://ftp.tu-dresden.de/pub/Linux/sunsite/ (Germany)   * ftp://ftp.uni-erlangen.de/pub/Linux/MIRROR.sunsite/ (Germany)   * ftp://ftp.gwdg.de/pub/linux/mirrors/sunsite/ (Germany)   * ftp://ftp.rz.uni-karlsruhe.de/pub/linux/mirror.sunsite/ (Germany)   * ftp://ftp.ba-mannheim.de/pub/linux/mirror.sunsite/ (Germany)   * ftp://ftp.uni-paderborn.de/pub/Mirrors/sunsite.unc.edu/ (Germany)   * ftp://ftp.uni-rostock.de/Linux/sunsite/ (Germany)   * ftp://ftp.rus.uni-stuttgart.de/pub/unix/systems/linux/MIRROR.sunsite/ (Germany)   * ftp://ftp.uni-tuebingen.de/pub/linux/Mirror.sunsite/ (Germany)   * ftp://ftp.kfki.hu/pub/linux/ (Hungary)   * ftp://linux.italnet.it/pub/Linux/ (Italy)   * ftp://ftp.unina.it/pub/linux/sunsite/ (Italy)   * ftp://giotto.unipd.it/pub/unix/Linux/ (Italy)   * ftp://cnuce-arch.cnr.it/pub/Linux/ (Italy)   * ftp://ftp.flashnet.it/mirror2/metalab.unc.edu/ (Italy)   * ftp://ftp.nijenrode.nl/pub/linux/ (Netherlands)   * ftp://ftp.LeidenUniv.nl/pub/linux/sunsite/ (Netherlands)   * ftp://ftp.nvg.unit.no/pub/linux/sunsite/ (Norway)   * ftp://sunsite.icm.edu.pl/pub/Linux/metalab.unc.edu/ (Poland)   * ftp://ftp.rediris.es/software/os/linux/sunsite/ (Spain)   * ftp://sunsite.rediris.es/software/linux/ (Spain)   * ftp://ftp.cs.us.es/pub/Linux/sunsite-mirror/ (Spain)   * ftp://ftp.etse.urv.es/pub/mirror/linux/ (Spain)   * ftp://ftp.etsimo.uniovi.es/pub/linux/ (Spain)   * ftp://ftp.luna.gui.es/pub/linux.new/ (Spain)   * ftp://ftp.metu.edu.tr/pub/linux/sunsite/ (Turkey)   * ftp://unix.hensa.ac.uk/mirrors/sunsite/pub/Linux/ (UK)   * ftp://ftp.maths.warwick.ac.uk/mirrors/linux/sunsite.unc-mirror/ (UK)   * ftp://ftp.idiscover.co.uk/pub/Linux/sunsite.unc-mirror/ (UK)   * ftp://sunsite.doc.ic.ac.uk/packages/linux/sunsite.unc-mirror/ (UK)   * ftp://ftp.io.org/pub/mirrors/linux/sunsite/ (Canada)   * ftp://ftp.cc.gatech.edu/pub/linux/ (US)   * ftp://ftp.freesoftware.com/pub/linux/sunsite/ (US)   * ftp://ftp.siriuscc.com/pub/Linux/Sunsite/ (US)   * ftp://ftp.engr.uark.edu/pub/linux/sunsite/ (US)   * ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ (US)   * ftp://linux.if.usp.br/pub/mirror/metalab.unc.edu/pub/Linux/ (Brazil)   * ftp://farofa.ime.usp.br/pub/linux/ (Brazil) Please send updates and corrections to this list to the Linux FAQ maintainer, see Asking Questions and Sending Comments. Not all of these mirror all of the other "source" sites, and some have material not available on the "source" sites. Q: How Do I Install Linux Using FTP? A: Most distributions are too large and complex to make FTP installation practical. Installing a basic Linux system that doesn't have a GUI or major applications is possible with FTP, however. The main non-commercial distribution in use is Debian GNU/Linux, and this answer describes an installation of a basic Debian system, to which you can add other Linux applications and commercial software as necessary. This answer describes installation on IBM-compatible machines with an Intel x86 or Pentium processor. You will need a machine with at least a 80386 processor, 8 Mb of memory, and about 100 Mb of disk space. More memory and a larger disk is necessary however, for practical everyday use. For other hardware, substitute "-arm", "-ppc", "-m68k", or other abbreviation in directory names for "-i386". For detailed and hardware-specific information refer to: http:// www.debian.org/releases/stable/.   * Connect to http://ftp.debian.org/dists/stable/main/disks-i386/current/. If you use anonymous FTP, connect to ftp://ftp.debian.org/debian/dists/ stable/main/disks-i386/current/.   * Choose the images-*/ subdirectory that matches the type of floppy drive installed on your machine, if unsure try images-1.44/. Retrieve the rescue.bin, root.bin, and driver-*.bin disk images. Once you have installed those floppy images, the rest of the system can be retrieved from a Debian mirror site, or installed from CD. If you have a Linux machine, you can use dd to write the images to the diskettes. If you are creating the installation diskettes on a MS-DOS machine, also download the RAWRITE.EXE MS-DOS utility, which will copy the raw binary images to floppy disks. Also download the install.en.txt document, which contains the detailed installation instructions.   * Create the installation disk set on floppies using either dd under Linux (e.g.: dd if=resc1440.bin of=/dev/fd0), or the RAWRITE.EXE utility under MS-DOS. Be sure to label each installation diskette.   * Insert the rescue diskette into the floppy drive and reboot the computer. If all goes well, the Linux kernel will boot, and you will be able start the installation program by pressing Enter at the boot: prompt.   * Follow the on-screen instructions for partitioning the hard disk, installing device drivers, the basic system software, and the Linux kernel. If the machine is connected to a local network, enter the network information when the system asks for it.   * To install additional software over the Internet, be sure that you have installed the ppp module during the installation process, and run (as root) the /usr/sbin/pppconfig utility. You will need to provide your user name with your ISP, your password, the ISP's dial-up phone number, the address(es) of the ISP's Domain Name Service, and the serial port that your modem is connected to, /dev/ttyS0 /dev/ttyS3. Be sure also to specify the defaultroute option to the PPP system, so the computer knows to use the PPP connection for remote Internet addresses.   * You may have to perform additional configuration on the PPP scripts in the /etc/ppp subdirectory, and in particular, the ISP-specific script in the /etc/ppp/peers subdirectory. There are basic instructions in each script. For detailed information, refer to the Debian/GNU Linux installation instructions that you downloaded, the pppd manual page (type man pppd), and the PPP HOWTO from the Linux Documentation project, http:/ /tldp.org/.   * Once you have a PPP connection established with your ISP (it will be displayed in the output of ifconfig), use the dselect program to specify which additional software you want to install. Use the apt [A]ccess option to retrieve packages via anonymous FTP, and make sure to use the [U]pdate option to retrieve a current list of packages from the FTP archive. Q: How Can I Get Linux Without FTP Access? A: The easiest thing is probably to find a friend with FTP access. If there is a Linux user's group near you, they may be able to help. If you have a reasonably good email connection, you could try the FTP-by-mail servers at ftpmail@ftp.sunet.se, or ftpmail@ftp.uni-stuttgart.de. Linux is also available via traditional mail on CD-ROM. The file ftp:// metalab.unc.edu/pub/Linux/docs/HOWTO/Installation-HOWTO, and the file ftp:// metalab.unc.edu/pub/Linux/docs/HOWTO/Distribution-HOWTO contain information on these distributions. Q: How Do I Install Linux? A: Once you obtain a distribution, it will contain instructions on installation. Each distribution has its own installation program. A: There is a very thorough installation guide on line at http:// heather.cs.ucdavis.edu/~matloff/linux.html A: Some distributions (e.g., Debian GNU/Linux) can be installed via anonymous FTP from various Linux archive sites, but unless you have cable, DSL, or some other broadband Internet access, the size of the distribution makes this impractical. See Where Are the Linux FTP Archives?. Postings on the Usenet News groups, including the FAQ, are archived on http:/ /groups.google.com/. Search for news:comp.os.linux, news:alt.uu.comp.os.linux and their subgroups, or whatever is appropriate, to retrieve articles from the Linux News groups. See What News Groups Are There for Linux?. ----------------------------------------------------------------------------- 8. Booting the OS Q: Can Linux Boot from MS-DOS? Q: How Can Linux Boot from OS/2's Boot Manager? Q: How Do I Set the Boot-Time Configuration? Q: How Do I Get LILO to Boot the Kernel Image? Q: Can I Remove LILO So the System Boots DOS Again? Q: Why Does the System Check the Ext2fs Partitions Each Reboot? Q: How Do I Make Sure the System Boots after Re-Installing the Operating System? Q: How To Make a Rescue Floppy Q: Can Linux Boot from MS-DOS? A: If LILO doesn't work, and if the machine has MS-DOS or Microsoft Windows, you may be left with a computer that won't boot. This can also happen on an upgrade to your Linux distribution. Re-installing LILO is the last thing that the installation does. It is vitally important when installing or upgrading Linux on a dual boot machine, to have a MS-DOS or Windows rescue disk nearby so you can FDISK -MBR. Then you can go about using LOADLIN.EXE instead of LILO. This config.sys file is one possible way to invoke LOADLIN.EXE and boot MS-DOS or Linux. [menu] menuitem=DOS, Dos Boot menuitem=LINUX, Linux Boot [LINUX] shell=c: edhatloadlin.exe c: edhatautobootvmlinuz vga=5 root=/dev [DOS] STACKS = 0,0 rem all the other DOS drivers get loaded here. This creates a menu where you can directly jump to LOADLIN.EXE before all of the MS-DOS drivers get loaded. The paths and options are peculiar to one machine and should be intuitively obvious to the most casual observer. See the LOADLIN.EXE docs for options. They are the same as LILO, and options are just passed to the kernel, anyhow. [Jim Harvey] Q: How Can Linux Boot from OS/2's Boot Manager? A: #Create a partition using OS/2's FDISK.EXE (Not Linux's fdisk). 1. Format the partition under OS/2, either with FAT or HPFS. This is so that OS/2 knows about the partition being formatted. (This step is not necessary with OS/2 Warp 3.0.) 2. Add the partition to the Boot Manager. 3. Boot Linux, and create a file system on the partition using mkfs -t ext2 or mke2fs. At this point you may, if you like, use Linux's fdisk to change the code of the new partition to type 83 (Linux Native)this may help some automated installation scripts find the right partition to use. 4. Install Linux on the partition. 5. Install LILO on the Linux partition NOT on the master boot record of the hard drive. This installs LILO as a second-stage boot loader on the Linux partition itself, to start up the kernel specified in the LILO configuration file. To do this, you should put boot = /dev/hda2 (where /dev/hda2 is the partition you want to boot from) in your /etc/ lilo/config or /etc/lilo.config file. 6. Make sure that it is the Boot Manager partition that is marked active, so that you can use Boot Manager to choose what to boot. There is a set of HOWTO's on the subject of multi-boot systems at the LDP Home Page, http://tldp.org. Q: How Do I Set the Boot-Time Configuration? A: You can configure Linux at the lilo: prompt either by typing the kernel arguments at the BOOT lilo: prompt, or by adding an append= directive to the /etc/lilo.conf file; for example, at the LILO prompt (example only): BOOT lilo: parport=0x3bc,7 parport=0x3bc,none serial=0x3f8,4 serial=0x2f8,3 Example statement for /etc/lilo.conf: append="parport=0x3bc,none serial=0x3f8,4 serial=0x2f8,3" If you modify the /etc/lilo.conf file, be sure to run the lilo command to install the new configuration. Configuration notes for specific hardware devices are in the documentation of the kernel source distribution, /usr/src/linux/Documentation in most distributions. Refer to the lilo and /etc/lilo.conf manual pages, as well as the LDP BootPrompt-HowTo, see Where Is the Documentation?, and the documentation in / usr/doc/lilo. Q: How Do I Get LILO to Boot the Kernel Image? A: From kernel versions 1.1.80 on, the compressed kernel image, which is what LILO needs to find, is in arch/i386/boot/zImage, or arch/i386/boot/bzImage when it is built, and is normally stored in the /boot/ directory. The /etc/ lilo.conf file should refer to the vmlinuz symbolic link, not the actual kernel image. This was changed to make it easier to build kernel versions for several different processors from one source tree. Q: Can I Remove LILO So the System Boots DOS Again? A: The lilo program (not the complete LILO package), uses the command line option -u to uninstall the LILO boot loader. You have to supply the device name of the device you installed LILO on, for example: lilo -u /dev/hda This rewrites the original, pre-LILO master boot record back to the first hard drive, from the boot record saved in /boot/boot.0300. If you installed LILO to a partition as a secondary boot loader, for example, /dev/hda1, lilo re-installs the original boot sector from the save file /boot/boot.0301. Refer to the lilo manual page for details. Thanks to Villy Kruse for reminding me to update this answer. If you have an earlier version of LILO, you will have to use the DOS (MS-DOS 5.0 or later, or OS/2) FDISK /MBR (which is not documented). This will overwrite the lilo boot loader with a standard MS-DOS Master Boot Record. If you have DR-DOS 6.0, go into FDISK.EXE in the normal way and then select the Re-write Master Boot Record option. If you create a boot floppy during the Windows installation process, make sure that it contains the programs FDISK.EXE, FORMAT.COM, and SYS.COM, and use that to re-install MS-DOS on the hard disk. If you don't have MS-DOS or DR-DOS, you need to have the boot sector that LILO saved when you first installed it. You did keep that file, didn't you? It's probably called boot.0301 or some such. Type: dd if=boot.0301 of=/dev/hda bs=445 count=1 (or /dev/sda if you're using a SCSI disk). This may also wipe out your partition table, so beware! If you're desperate, you could use dd if=/dev/zero of=/dev/hda bs=512 count=1 This will erase your partition table and boot sector completely: you can then reformat the disk using your favorite software. But this will render the contents of your disk inaccessible you'll lose it all unless you're an expert. Note that the DOS MBR boots whichever (single!) partition is flagged as "active." You may need to use fdisk to set and clear the active flags on partitions appropriately. Q: Why Does the System Check the Ext2fs Partitions Each Reboot? A: Refer to EXT2-fs: warning: mounting unchecked file system. Q: How Do I Make Sure the System Boots after Re-Installing the Operating System? A: This should work whether you're re-installing Linux or some other, commercial, operating system:   * Insert a blank, formatted floppy in drive A:   * Save a copy of the boot hard drive's Master Boot Record to the floppy, by executing the command: #dd if=/dev/hda of=/dev/fd0 count=1 dd is a standard program on Linux systems. A MS-Windows compatible version is available from ftp://ftp.gnu.org/, as well as many MS software archives.   * Test that the floppy boots the system by rebooting with the floppy in the A: drive.   * Then you should be able to install the other operating system (on a different hard drive and/or partition, if you don't want to uninstall Linux).   * After installation, boot Linux again from the floppy, and re-install the MBR with the command: /sbin/lilo. [Jacques Guy] Q: How To Make a Rescue Floppy A: Make a file system on it with bin, etc, lib and dev directorieseverything you need. Install a kernel on it and arrange to have LILO boot it from the floppy (see the LILO documentation, in lilo.u.*.ps). If you build the kernel (or tell LILO to tell the kernel) to have a RAM disk the same size as the floppy the RAM disk will be loaded at boot time and mounted as root in place of the floppy. See the Bootdisk HOWTO. ----------------------------------------------------------------------------- 9. Application Software Management Q: How To Determine What Packages Are Installed on a System Q: How Do I Find a Particular Application? Q: What Software does Linux Support? Q: Can Linux Use True Type Fonts? Q: Can Linux Run Microsoft Windows Programs? Q: How Do I Install GNU Software? Q: Where Can I Get Java? Q: Where Can I Find Kermit for Linux? Q: Is There an ICQ Program That Runs under Linux? Q: How To Determine What Packages Are Installed on a System A: For distributions that use RPM format packages, use the command: $ rpm -qa You need to be logged in as root. You can save the output to a text file for future reference, a command like: $ rpm -qa >installed-packages A: For Debian systems, the equivalent command is: $ dpkg -l A: For Slackware and Slackware based distributions, look in the directory / var/log/packages. [Steven J. Hathaway] There is one file that describes the contents of each *.tgz package installed on your system. Q: How Do I Find a Particular Application? A: Look first in the Linux Software Map. It's at: ftp://metalab.unc.edu/pub/ Linux/docs/linux-software-map/, and on the other FTP sites. A search engine is available on the World Wide Web at http://www.boutell.com/lsm/. Also check out the Freshmeat Web site: http://www.freshmeat.net, which is where many new announcements of free software first appear. Freshmeat is basically a site index that continuously updates the notices of new or upgraded software for Linux, and maintains indexes of the announcements and links to their URL's. The FTP sites (Where Are the Linux FTP Archives?) often have ls-lR or INDEX directory listings which you can search using grep or a text editor. The directory listings files can be very large, however, making them unwieldy for quick searches. Also look at the Linux Project's Map: ftp://ftp.ix.de/pub/ix/Linux/docs/ Projects-Map.gz. There's a search engine for Linux FTP archives at: http://lfw.linuxhq.com. Searching for "Linux" on the World Wide Web provides copious references. ( Where Is the Linux Stuff on the World Wide Web?) If you don't find anything, you could download the sources to the program yourself and compile them. See (How Do I Port XXX to Linux?). If it's a large package that may require some porting, post a message to news: comp.os.linux.development.apps. The popularity of Linux makes this an extremely unlikely occurrence. The great majority of software available on other Unix-type systems has already been ported to Linux. If you compile a large-ish program, please upload it to one or more of the FTP sites, and post a message to news:comp.os.linux.announce (submit your posting to linux-announce@news.ornl.gov. If you're looking for an application program, the chances are that someone has already written a free version. The news:comp.sources.wanted FAQ has instructions for finding the source code. Q: What Software does Linux Support? A: Linux runs all of the standard open source utilities, like GCC, (X)Emacs, the X Window System, all the standard Unix utilities, TCP/IP (including SLIP and PPP), and all of the hundreds of programs that people have compiled or ported to it. There is a DOS emulator, called DOSEMU, that lets Linux run programs written for DOS. The latest stable release is 0.98.3. The FTP archives are at ftp:// ftp.dosemu.org/dosemu. The Web site is http://www.dosemu.org. The emulator can run DOS itself and some (but not all) DOS applications. Be sure to look at the README file to determine which version you should get. Also, see the DOSEMU-HOWTO (slightly dated at this point it doesn't cover the most recent version of the program), at ftp://metalab.unc.edu/pub/Linux/docs/ HOWTO. Work has been progressing on WINE, an emulator for Microsoft Windows binaries. See Can Linux Run Microsoft Windows Programs?. Intel Binary Compatibility Standard (iBCS2) emulator code for SVR4 ELF and SVR3.2 COFF binaries can be included in the kernel as a compile-time option. There is information at ftp://tsx-11.mit.edu/pub/linux/BETA/ibcs2/README. For more information see the INFO-SHEET. Some companies have commercial software available. They often announce their availability on news:comp.os.linux.announce try searching the archives. See Are the News Groups Archived Anywhere?. Q: Can Linux Use True Type Fonts? A: Yes. There are a number of True Type font servers for the X Window System. One of them is xfsft. Its home page is http://www.dcs.ed.ac.uk/home/jec/ programs/xfsft/. There are also instructions for configuration. A: Another True Type font server is xfstt A: People have reported success with other True Type font servers. There are links from the xfsft Home Page to them as well. A: You can also compile True Type Font support into your X server directly. Again, refer to the xfsft Home Page for details. A: Debian users should consult the TT-Debian-HOWTO. Q: Can Linux Run Microsoft Windows Programs? A: If you need to run MS Windows programs, the safest bet is to dual-boot Windows and Linux. LILO, the Linux boot loader, can boot one of several operating systems from a menu. Booting Windows is obviously the most reliable way to run all your Windows programs. See the LILO documentation for details on dual booting. Also, LOADLIN.EXE (a DOS program to load a Linux, or other OS, kernel is one way to make Linux co-exist with DOS. LOADLIN.EXE is particularly handy when you want to install Linux on a 3rd or 4th drive on a system (or when you're adding a SCSI drive to a system with an existing IDE). In these cases, it is common for LILO's boot loader to be unable to find or load the kernel on the "other" drive. So you just create a C:LINUX directory (or whatever), put LOADLIN.EXE in it with a copy of your kernel, and use that. LOADLIN.EXE is a VCPI compliant program. Win95 will want to "shutdown into DOS mode," to run it (as it would with certain other DOS protected-mode programs). Earlier versions of LOADLIN.EXE sometimes required a package called REALBIOS.COM, which required a boot procedure on an (almost) blank floppy to map the interrupt vectors (prior to the loading of any software drivers). (Current versions don't seem to ship with it, and don't seem to need it). [Jim Dennis] A: WINE (WINE Is Not an Emulator), is a reimplementation of Windows APIs for Linux and Unix. WINE is a great project with huge potential, but it is still not ready for general distribution. The WINE team is still working toward a 1.0 release. However, it is already capable of running many Windows programs. If you want to contribute to its development, look for the status reports in the news:comp.emulators.ms-windows.wine newsgroup. There is also a FAQ, compiled by P. David Gardner, at ftp://metalab.unc.edu/ pub/Linux/docs/faqs/Wine-FAQ/. A: A proprietary program called VMWare is also available to let you run Windows under a Linux "host" operating system. See the company's website at http://www.vmware.com. A: Another package that will help is Win4Lin, a proprietary package. Win4Lin also allows you to run many Windows programs under *NIX. Here is how one user reports on Win4Lin:   I just finished installing it on a new installation of   Mandrake 8.1 and I have found it to be very satisfactory. It only cost $49 (received a special offer after registering at their website for information). I installed it in just a very few minutes, and it now allows me to run all of the Windows applications programs I have been used to using for a long time (Pagemaker, Lview, Paint Shop Pro, Explorer etc.) in a window on one of my Linux KDE desktop screens ... concurrently with all of my Linux tools. --Josef Lowder   Q: How Do I Install GNU Software? A: On a correctly configured system, installing a GNU software package requires four steps: 1. With the source.tar.gz archive in the /usr/src/ directory, or wherever you maintain your source files, untar and decompress the package with the command: tar zxvf package-name.tar.gz 2. Run the ./configure script in the untarred source archive's top-level directory with whatever command line arguments you need. The options that configure recognizes are usually contained in a file called INSTALL or README. 3. Run make. This will build the source code into an executable program (or programs) and may take a few minutes or a few hours, depending on the speed of the computer and the size of the package. 4. Run make install. This will install the compiled binaries, configuration files, and any libraries in the appropriate directories. Q: Where Can I Get Java? A: The Sun Microsystems Java runtime environments and developer's kits are at http://java.sun.com You can also get the source code, which is licensed by Sun Microsystems. A: The home page of IBM's Jikes Java compiler is http:// www10.software.ibm.com/developerworks/opensource/jikes. A: There is a version of Sun's HotJava browser for Linux at: http:// www.java.sun.com/products/hotjava/. A: Kaffee, a free Java clone, is available from: http://www.kaffe.org. A: There is a resource page of free and commercial Java packages at: http:// www.blackdown.org/java-linux.html. A: Netscape Communicator comes with its own version of the Java Runtime Environment, so if you need Java only to view Web graphics, you may already have the runtime version of the Java Virtual Machine and libraries that you need installed on your system. You can download Communicator from http:// www.netscape.com. Q: Where Can I Find Kermit for Linux? A: Kermit is distributed under a non-GPL copyright that makes its terms of distribution somewhat different. The sources and some binaries are available on ftp://kermit.columbia.edu. The WWW Home Page of the Columbia University Kermit project is http:// www.columbia.edu/kermit/. Q: Is There an ICQ Program That Runs under Linux? A: Several ICQ clients are available on metalab.unc.edu. Refer to Where Are the Linux FTP Archives?). ICQ itself does not have a Linux client, but there is a Java client at http://www.mirabilis.com/download/. Q; Where Can I Find lint for Linux?|lint-for-linux A: Roughly equivalent functionality is built into GCC. Use the -Wall option to turn on most of the useful extra warnings. See the GCC manual for more details (type F1-i in Emacs and select the entry for GCC). There is a freely available program called lclint that does much the same thing as traditional lint. The announcement and source code are available at ftp://ftp.sds.lcs.mit.edu/pub/lclint; on the World Wide Web, look at http:// lclint.cs.virginia.edu. ----------------------------------------------------------------------------- 10. Directory And File Management Q: How Do I Undelete Files? Q: How Do I Make Backups? Q: Is There a Defragmenter for Ext2fs? Q: How Do I Undelete Files? A: In general, this is very hard to do on unices because of their multitasking nature. Undelete functionality for the ext2fs file system is being worked on, but don't hold your breath. There are a number of packages available which instead provide new commands for deleting and copying which move deleted files into a "wastebasket" directory. The files can be recovered until cleaned out automatically by background processing. The Midnight Commander file manager provides an undelete facility that uses Ext2 file system library functions and an undelete directory for each file system. Commercial distribution packages of MC may or may not have this feature enabled, so be sure to look in the source code distribution for instructions on how to enable the undelete feature. Alternatively, you can search the raw disk device which holds the file system in question. This is hard work, and you will need to be logged in as root to do this. But it can be done. Run grep on the raw device; e.g.: grep -b 'bookmarks' /dev/hda If the data has not been overwritten, you should be able to recover it with a text editor. [Dave Cinege, Daniel Novotny] Q: How Do I Make Backups? A: You can back up a directory hierarchy or complete file system to any media using GNU tar or cpio, the standard *nix tools for this purpose. tar seems to be the more commonly used program currently, and includes command line options to make compressed, incremental, and multi-volume backups. Complete information is contained in the documentation, which is in GNU Texinfo format. A: The free program, Amanda, receives a lot of mentions on Usenet. Its home page is http://www.amanda.org. A: Several commercial backup utilities also exist. They are often included in commercial distributions. Q: Is There a Defragmenter for Ext2fs? A: Yes. There is defrag, a Linux file system defragmenter for ext2, Minix, and old-style ext file systems. It is available at ftp://metalab.unc.edu/pub/ Linux/system/filesystems/defrag-0.70.tar.gz. Users of the ext2 file system can probably do without defrag, because ext2 contains extra code to keep fragmentation reduced even in very full file systems. ----------------------------------------------------------------------------- 11. Connecting To A Network Q: How I Configure Dial-up PPP? Q: How Do I Use Linux with a Cable Modem? Q: Where Is Information about NFS Compatibility? Q: What Does VFS Stand For? Q: Can Linux Access SMB File Systems? Q: How I Configure Dial-up PPP? A: This information is mainly for people who do not have a wrapper utility like kppp or pppconfig, or are not able to get those utilities to work correctly. If you need to manually configure PPP to dial in to your ISP, you will need the following information:   * The port that your modem is connected to: /dev/ttyS0-/dev/ttyS3, which correspond to COM1-COM4 under MS-DOS.   * The phone number of your ISP's data connection.   * The user name and password that your ISP gave you.   * The IP addresses of the primary and possibly secondary Domain Name Service that you will use when dialing in to the ISP. This assumes that you will not be using a DNS that you installed on your system. When you have all of this information, make sure that the programs pppd and chat, at the very minimum, are installed correctly. In most current distributions, they are installed in the /usr/sbin/ directory, and you will need to be logged in as root to use them. In addition, the following programs are also useful for configuring network connections, determining network status, and diagnosing problems: /sbin/ifconfig, /sbin/route, / bin/ping, /usr/sbin/traceroute. These are the basic steps that you need to follow to configure PPP. You must be logged in as root.   * Make sure that the serial port and modem are operating correctly. Using a program like minicomm or kermit, you should be able to send AT commands to the modem and receive the OK string in response from the modem.   * Enter the primary and possibly secondary Domain Name Server IP addresses in the /etc/resolv.conf file, using dotted quad notation, with the nameserver label. For example: order hosts,bind nameserver 196.182.101.103 nameserver 196.182.101.104 The nameserver addresses in the example above are examples only. They don't correspond to actual network hosts. The first line, order hosts,bind, tells your networking software, when it resolves network domain addresses, to first look in the /etc/hosts file, and then use the bind service; i.e., the DNS servers, which are specified on the lines that begin with nameserver.   * Locate the chat script that PPP will use to dial the modem and connect to your ISP. In many systems, this is either in the /etc/chatscripts or /etc /ppp directory, and will be called provider or something similar. You can store a chat script anywhere, provided that you tell pppd to use it rather than the default script. Refer to the chat and pppd manual pages, and the information below, for details. Here is a sample chat script: ABORT BUSY ABORT "NO CARRIER" ABORT VOICE ABORT "NO DIALTONE" "" ATDT ogin word This is a chat program for a simple, script based login. The chat program uses the pair of strings on each line as a match/response pair. When it starts, it sends the string "ATDTyour_isp's_phone_number," where you have substituted the actual phone number of course. It then waits for the string ogin (a substring of the word login) and sends your user name. It then waits for word (a substring of password) and sends your password. If your ISP uses a different login and password prompts, and any additional prompts, you will need to edit the script accordingly. Again, refer to the chat manual page for details. If your ISP uses PAP or CHAP authentication, you will need to edit the pap-secrets or chap-secrets files in /etc/ppp directory as well. Refer to the manual pages for these files, as well as the instruction in the files themselves.   * The configuration of pppd, the program that maintains the actual connection, is usually contained in two or three separate files. The first is usually /etc/ppp/options, which contains options that all of your system's PPP connections will use. (Yes, you can have more than one; as many as your computer has serial ports, generally.) Here is a sample /etc/ppp/options file: #/etc/ppp/options asyncmap 0 auth crtscts lock noipx # ------ The options may be given on one line or each on a separate line. Many options files are much longer, and come with a description of each option. Here, the options mean, in order, don't remap any characters between the PPP client and server; always use password, PAP, or CHAP authentication when making a connection; use the modem's hardware handshake lines for flow control; lock the serial port when in use so no other programs can access it; and do not use the IPX network protocol.   * For connection set-up on each individual serial port or PPP host, there will either be an /etc/ppp/options.ttyS1, for example, options file for / etc/ttyS1, or a file for your ISP in the /etc/ppp/peers directory. The default is often called /etc/ppp/peers/provider. Here is a sample of the default provider file: noauth connect "/usr/sbin/chat -v -f /etc/chatscripts/provider" defaultroute /dev/ttyS1 38400 persist There might be an explanation of these and other options in the /etc/ppp/ peers/provider file itself. You can also refer to the pppd manual page for details. Briefly, they mean: do not use PAP authentication for this connection; use the chat program and the /etc/chatscripts/provider script, which is described above, to dial the phone and log in; set the network default route to the PPP connection (so when your network software needs to resolve an network address that is not on your local machine(s), it will use the PPP connection to the Internet); use /dev/ ttyS1 as the serial port for the connection; set the modem speed to 38400; and keep the pppd daemon running even if the connection fails. That is all of the configuration you need. To actually start and stop PPP, there are often /usr/bin/pon and /usr/bin/poff scripts (in Debian), or something similar, and they are usually very simple, and only contain the command: $ /usr/sbin/pppd call ${1:-provider} This will start pppd and use the call option to call the server that you type on the command line, or the provider given in the /etc/ppp/peers/provider file if you do not specify a remote server. After making the call and logging in (about 30 seconds), you should be able to use the /sbin/ifconfig program to determine that the connection really did establish a PPP interface (the first will be ppp0, the second will be ppp1, etc., depending on how many simultaneous PPP connections you have. If something goes wrong, you can look at the /var/log/ppp.log file to determine what happened. You can also view the log as the connection is being made, by "tailing" it in another window; that is, viewing it as pppd logs the connection's status information. To do this, use the command (again, as root): $ tail -f /var/log/ppp.log On some systems the PPP output is directed to /var/log/messages, in which case your system may not have a dedicated PPP log file. You should be also able to ping one of your ISP's domain names (e.g., mail.isp.com) and receive a response. These are the most basic steps for configuring a PPP connection. You will also need to take into account what other network connections may be present (for example, if there's an Ethernet connection that has already been assigned the default route), as well as various security measures at your ISP's end. If you're having trouble making the dial-up connection, usually the best way to determine what may be going wrong is to use Seyon, minicomm, kermit, or some other program to dial and log in manually to the ISP, and determine just exactly what you have to do to log in, then duplicate that in the PPP scripts. Most Linux documentation also has additional instructions for configuring PPP connections. Refer to Where Are the Linux FTP Archives? and Where Is the Documentation?. Q: How Do I Use Linux with a Cable Modem? A: The www.CablemodemInfo.com and xDSL Web page at http:// www.cablemodeminfo.com has a section devoted to Linux. See also the Cable-Modem-HOWTO at the LDP. Q: Where Is Information about NFS Compatibility? A: See the NFS-HOWTO for up to date information. A: This information is partly taken from Nicolai Langfeldt's excellent NFS HOWTO, and is current as of 10/1/1999: Most version 2.2.x kernels need a set of patches to install the knfsd subsystem, maintained by H.J. Lu, to communicate efficiently (if at all) with Sparc, IBM RS, and Alpha machines, and probably others. This package is actually a collection of patches to the kernel sources. Better support for non-Intel architectures is included in the 2.4 kernels. There is also a user-space server. Although it lacks remote file locking, it is easier to install. It may be equally efficient. In the Documentation/Changes of recent kernel distributions, there is a list of URL's for both the knfsd server and the user-space server. In the case of older Solaris releases, the lack of statd or lockd on a client or server machine may cause incompatibility. On some versions of Solaris, statd can be used to exploit features of the automounter. Sun released a patch to correct this, but statd still needs to be started by root on such systems. On recent Solaris systems, refer to the information in /etc/dfs/ dfstab and the share(1M) manual page to enable volume sharing. In addition, the rpcinfo program can tell you if statd or lockd are available on the local or remote machines. The linux-kernel mailing list has on-and-off discussions of the status of the NFS subsystem, which appears to be changing rapidly. [Nicolai Langfeldt, Robert Kiesling, Anders Hammarquist] Q: What Does VFS Stand For? A: Virtual File System. It's the abstraction layer between the user and real file systems like ext2, Minix and MS-DOS. Among other things, its job is to flush the read buffer when it detects a disk change on the floppy disk drive. VFS: Disk change detected on device 2/0 Q: Can Linux Access SMB File Systems? A: Linux supports read/write access of Windows for Workgroups and Windows NT SMB volumes. See the file Documentation/filesystems/smbfs.txt of the Linux kernel source distribution, and How To Upgrade/Recompile a Kernel. There is also a suite of programs called Samba which provide support for WfW networked file systems (provided they're for TCP/IP). Information is available in the README file at metalab.unc.edu/pub/Linux/system/network/ samba/. The SMB Web site is http://www.samba.org, and there is also a Web site at samba.anu.edu.au/samba/. ----------------------------------------------------------------------------- 12. Troubleshooting Q: What are these Nasty Messages about Inodes, Blocks, and the Like? Q: Why Do FTP Transfers Seem to Hang? Q: Why Does Free Dump Core? Q: Why Does Netscape Crash Frequently? Q: Why Won't My FTP or Telnet Server Allow Logins? Q: How Do I Keep Track of Bookmarks in Netscape? Q: Why Does the Computer Have the Wrong Time? Q: Why Don't Setuid Scripts Work? Q: Why Is Free Memory as Reported by free Shrinking? Q: Why Does the System Slow to a Crawl When Adding More Memory? Q: Why Won't Some Programs (e.g., xdm) Allow Logins? Q: Why Do Some Programs Allow Logins with No Password? Q: Why Does the Machine Run Very Slowly with GCC / X / ...? Q: Why Does My System Only Allow Root Logins? Q: Why Is the Screen Is All Full of Weird Characters Instead of Letters? Q: If I Screwed Up the System and Can't Log In, How Can I Fix It? Q: What if I Forget the root Password? Q: What's This Huge Security Hole in rm!?!?! Q: Why Don't lpr and/or lpd Work? Q: Why Are the Timestamps on Files on MS-DOS Partitions Set Incorrectly? Q: Why is My Root File System Read-Only? Q: What Is /proc/kcore? Q: Why Does fdformat Require Superuser Privileges? Q: Why Doesn't My PCMCIA Card Work after Upgrading the Kernel? Q: What are these Nasty Messages about Inodes, Blocks, and the Like? A: You may have a corrupted file system, probably caused by not shutting Linux down properly before turning off the power or resetting. You need to use a recent shutdown program to do this for example, the one included in the util-linux package, available on sunsite and tsx-11. If you're lucky, the program fsck (or e2fsck or xfsck as appropriate if you don't have the automatic fsck front-end) will be able to repair your file system. If you're unlucky, the file system is trashed, and you'll have to re-initialize it with mkfs (or mke2fs, mkxfs, etc.), and restore from a backup. NB: don't try to check a file system that's mounted read/writethis includes the root partition, if you don't see VFS: mounted root ... read-only at boot time. Q: Why Do FTP Transfers Seem to Hang? A: FTP transfers that die suddenly are due, apparently, to some form of overrunning buffer. It occurs both with Linux and Microsoft servers. On Linux systems, the problem seems to occur most commonly with the distribution's server software. If you receive ftp: connection refused errors, then the problem is likely due to a lack of authentication. Refer to Why Won't My FTP or Telnet Server Allow Logins?. One remedy is to be replacing the distribution FTP server with the Linux port of the OpenBSD FTP server. The home page is: http://www.eleves.ens.fr:8080/ home/madore/programs/. To install the BSD server, follow the installation instructions, and refer to the manual pages for inetd and inetd.conf. (If you have the newer xinetd, see below.) Be sure to tell inetd to run the BSD daemon alone, not as a subprocess of, for example, tcpd. Comment out the line that begins ftp in the /etc/inetd.conf file and replace it with a line similar to (if you install the new ftpd in /usr/local/sbin/): # Original entry, commented out. #ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.ftpd # Replacement entry: ftp stream tcp nowait root /usr/local/sbin/ftpd -l The replacement daemon will become effective after rebooting or sending (as root) a SIGHUP to inetd, e.g.: # kill -HUP inetd To configure xinetd, create an entry in /etc/xinetd.d per the instructions in the xinetd.conf manual page. Make sure, again, that the command-line arguments for ftpd are correct, and that you have installed the /etc/ftpusers and /etc/pam.d/ftp files. Then restart xinetd with the command: /etc/rc.d/ init.d/xinetd restart. The command should report "OK," and the restart will be noted in the system message log. Q: Why Does Free Dump Core? A: In Linux 1.3.57 and later, the format of /proc/meminfo was changed in a way that the implementation of free doesn't understand. Get the latest version, from metalab.unc.edu, in /pub/Linux/system/Status/ps/ procps-0.99.tgz. Q: Why Does Netscape Crash Frequently? A: Netscape shouldn't crash, if it and the network are properly configured. Some things to check:   * Make sure that the MOZILLA_HOME environment variable is correctly set. If you installed Netscape under /usr/local/netscape/, for example, that should be the value of MOZILLA_HOME. Set it from the command line (e.g, "export MOZILLA_HOME="/usr/local/netscape"" under bash or add it to one your personal or system initialization files. Refer to the manual page for your shell for details.   * If you have a brand-new version of Netscape, try a previous version, in case the run-time libraries are slightly incompatible. For example, if Netscape version 4.75 is installed (type "netscape --version" at the shell prompt), try installing version 4.7. All versions are archived at ftp://ftp.netscape.com/.   * Netscape uses its own Motif and Java Runtime Environment libraries. If a separate version of either is installed on your system, ensure that they aren't interfering with Netscape's libraries; e.g., by un-installing them.   * Make sure that Netscape can connect to its default name servers. The program will appear to freeze and time out after several minutes if it can't. This indicates a problem with the system's Internet connection; likely, the system can't connect to other sites, either. Q: Why Won't My FTP or Telnet Server Allow Logins? A: This applies to server daemons that respond to clients, but don't allow logins. On new systems that have Pluggable Authentication Modules installed, look for a file named, "ftp," or "telnet," in the directory /etc/pam/ or /etc /pam.d/. If the corresponding authentication file doesn't exist, the instructions for configuring FTP and Telnet authentication and other PAM configuration, should be in /usr/doc/pam-&version&. Refer also to the answer for FTP server says: "421 service not available, remote server has closed connection.". If it's an FTP server on an older system, make sure that the account exists in /etc/passwd, especially anonymous. This type of problem may also be caused a failure to resolve the host addresses properly, especially if using Reverse Address Resolution Protocol (RARP). The simple answer to this is to list all relevant host names and IP addresses in the /etc/hosts files on each machine. ( Refer to the example / etc/hosts and /etc/resolv.conf files in Sendmail Pauses for Up to a Minute at Each Command. If the network has an internal DNS, make sure that each host can resolve network addresses using it. If the host machine doesn't respond to FTP or Telnet clients at all, then the server daemon is not installed correctly, or at all. Refer to the manual pages: inetd and inetd.conf on older systems, or xinetd and xinetd.conf, as well as ftpd, and telnetd. Q: How Do I Keep Track of Bookmarks in Netscape? A: This probably applies to most other browsers, too. In the Preferences/ Navigator menu, set your home page to Netscape's bookmarks.html file, which is located in the .netscape (with a leading period) subdirectory. For example, if your login name is smith, set the home page to: file://home/smith/.netscape/bookmarks.html Setting up your personal home page like this will present you with a nicely formatted (albeit possibly long) page of bookmarks when Netscape starts. And the file is automatically updated whenever you add, delete, or visit a bookmarked site. Q: Why Does the Computer Have the Wrong Time? A: There are two clocks in your computer. The hardware (CMOS) clock runs even when the computer is turned off, and is used when the system starts up and by DOS (if you use DOS). The ordinary system time, shown and set by date, is maintained by the kernel while Linux is running. You can display the CMOS clock time, or set either clock from the other, with /sbin/clock (now called hwclock in many distributions). Refer to: man 8 clock or man 8 hwclock. There are various other programs that can correct either or both clocks for system drift or transfer time across the network. Some of them may already be installed on your system. Try looking for adjtimex (corrects for drift), Network Time Protocol clients like netdate, getdate, and xntp, or NTP client-server suite like chrony. Refer to How Do I Find a Particular Application?. Q: Why Don't Setuid Scripts Work? A: They aren't supposed to. This feature has been disabled in the Linux kernel on purpose, because setuid scripts are almost always a security hole. Sudo and SuidPerl can provide more security than setuid scripts or binaries, especially if execute permissions are limited to a certain user ID or group ID. If you want to know why setuid scripts are a security hole, read the FAQ for news:comp.unix.questions. Q: Why Is Free Memory as Reported by free Shrinking? A: The "free" figure printed by free doesn't include memory used as a disk buffer cacheshown in the buffers column. If you want to know how much memory is really free add the buffers amount to free. Newer versions of free print an extra line with this info. The disk buffer cache tends to grow soon after starting Linux up. As you load more programs and use more files, the contents get cached. It will stabilize after a while. Q: Why Does the System Slow to a Crawl When Adding More Memory? A: This is a common symptom of a failure to cache the additional memory. The exact problem depends on your motherboard. Sometimes you have to enable caching of certain regions in your BIOS setup. Look in the CMOS setup and see if there is an option to cache the new memory area which is currently switched off. This is apparently most common on a '486. Sometimes the RAM has to be in certain sockets to be cached. Sometimes you have to set jumpers to enable caching. Some motherboards don't cache all of the RAM if you have more RAM per amount of cache than the hardware expects. Usually a full 256K cache will solve this problem. If in doubt, check the manual. If you still can't fix it because the documentation is inadequate, you might like to post a message to news: comp.os.linux.hardware giving all of the details make, model number, date code, etc., so other Linux users can avoid it. Q: Why Won't Some Programs (e.g., xdm) Allow Logins? A: You are probably using non-shadow password programs and are using shadow passwords. If so, you have to get or compile a shadow password version of the programs in question. The shadow password suite can be found at ftp://tsx-11.mit.edu/ pub/linux/sources/usr.bin/shadow/. This is the source code. The binaries are probably in linux/binaries/usr.bin/. Q: Why Do Some Programs Allow Logins with No Password? A: You probably have the same problem as in Why Won't Some Programs (e.g., xdm) Allow Logins?, with an added wrinkle. If you are using shadow passwords, you should put a letter x or an asterisk in the password field of /etc/passwd for each account, so that if a program doesn't know about the shadow passwords it won't think it's a passwordless account and let anyone in. Q: Why Does the Machine Run Very Slowly with GCC / X / ...? A: You may have too little real memory. If you have less RAM than all the programs you're running at once, Linux will swap to your hard disk instead and thrash horribly. The solution in this case is to not run so many things at once or buy more memory. You can also reclaim some memory by compiling and using a kernel with fewer options configured. See How To Upgrade/Recompile a Kernel. You can tell how much memory and swap you're using with the free command, or by typing: $ cat /proc/meminfo If your kernel is configured with a RAM disk, this is probably wasted space and will cause things to go slowly. Use LILO or rdev to tell the kernel not to allocate a RAM disk (see the LILO documentation or type man rdev). Q: Why Does My System Only Allow Root Logins? A: You probably have some permission problems, or you have a file /etc/ nologin. In the latter case, put rm -f /etc/nologin in your /etc/rc.local or /etc/rc.d /* scripts. Otherwise, check the permissions on your shell, and any file names that appear in error messages, and also the directories that contain these files, up to and including the root directory. Q: Why Is the Screen Is All Full of Weird Characters Instead of Letters? A: You probably sent some binary data to your screen by mistake. Type echo 'c' to fix it. Many Linux distributions have a command, reset, that does this. If that doesn't help, try a direct screen escape command: echo 'Ctrl-V Ctrl-O '. This resets the default font of a Linux console. Remember to hold down the Control key and type the letter, instead of, for example, Ctrl, then V. The sequence Ctrl-V Esc C. causes a full screen reset. If there's data left on the shell command line after typing a binary file, press Ctrl-C a few times to restore the shell command line. Another possible command is an alias, sane, that can work with generic terminals: $ alias sane='echo -e " c";tput is2; > stty sane line 1 rows $LINES columns $COLUMNS' The alias is enclosed with open quotes (backticks), not single quotes. The line break is included here for clarity, and is not required. Make sure that $LINES and $COLUMNS are defined in the environment with a command similar to this in ~/.cshrc or ~/.bashrc, $ LINES=25; export $LINES; $COLUMNS=80; export $COLUMNS using the correct numbers of $LINES and $COLUMNS for the terminal. Finally, the output of stty -g can be used to create a shell script that will reset the terminal: 1. Save the output of stty -g to a file. In this example, the file is named termset: $ stty -g >termset The output of stty -g (the contents of termset) will look something like: 500:5:bd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:73 2. Edit termset to become a shell script; adding an interpreter and stty command: #!/bin/bash stty 500:5:bd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:73 3. Add executable permissions to termset and use as a shell script: $ chmod +x termset $ ./termset [Floyd L. Davidson, Bernhard Gabler] Q: If I Screwed Up the System and Can't Log In, How Can I Fix It? A: You did create an emergency floppy (or floppies), right? Reboot from an emergency floppy or floppy pair. For example, the Slackware boot and root disk pair in the install subdirectory of the Slackware distribution. A: There are also two, do-it-yourself rescue disk creation packages in ftp:// metalab.unc.edu/pub/Linux/system/recovery/. These are better because they have your own kernel on them, so you don't run the risk of missing devices and file systems. Get to a shell prompt and mount your hard disk with something like $ mount -t ext2 /dev/hda1 /mnt Then your file system is available under the directory /mnt and you can fix the problem. Remember to unmount your hard disk before rebooting (cd somewhere else first, or it will say it's busy). Q: What if I Forget the root Password? A: Warning Incorrectly editing any of the files in the /etc/directory can severely screw up a system. Please keep a spare copy of any files in case you make a mistake. If your Linux distribution permits, try booting into single-user mode by typing single at the BOOT lilo: prompt. With more recent distributions, you can boot into single-user mode when prompted by typing linux 1, linux single, or init=/bin/bash. If the above doesn't work for you, boot from the installation or rescue floppy, and switch to another virtual console with Alt-F1 -- Alt-F8, and then mount the root file system on /mnt. Then proceed with the steps below to determine if your system has standard or shadow passwords, and how to remove the password. Using your favorite text editor, edit the root entry of the /etc/passwd file to remove the password, which is located between the first and second colons. '''Do this only if the password field does not contain an x, in which case see below.''' root:Yhgew13xs:0:0: ... Change that to: root::0:0: ... If the password field contains an x, then you must remove the password from the /etc/shadow file, which is in a similar format. Refer to the manual pages: man passwd, and man 5 shadow. [Paul Colquhuon, Robert Kiesling, Tom Plunket] Q: What's This Huge Security Hole in rm!?!?! A: No there isn't. You are obviously new to unices and need to read a good book to find out how things work. Clue: the ability to delete files depends on permission to write in that directory. Q: Why Don't lpr and/or lpd Work? A: First make sure that your /dev/lp* port is correctly configured. Its IRQ (if any) and port address need to match the settings on the printer card. You should be able to dump a file directly to the printer: $ cat the_file >/dev/lp1 If lpr gives you a message like myname@host: host not found" it may mean that the TCP/IP loopback interface, lo, isn't working properly. Loopback support is compiled into most distribution kernels. Check that the interface is configured with the ifconfig command. By Internet convention, the network number is 127.0.0.0, and the local host address is 127.0.0.1. If everything is configured correctly, you should be able to telnet to your own machine and get a login prompt. Make sure that /etc/hosts.lpd contains the machine's host name. If your machine has a network-aware lpd, like the one that comes with LPRng, make sure that /etc/lpd.perms is configured correctly. Also look at the Printing HOWTO. "Where can I get the HOWTO's and other documentation? ". Q: Why Are the Timestamps on Files on MS-DOS Partitions Set Incorrectly? A: There is a bug in the program clock (often found in /sbin). It miscounts a time zone offset, confusing seconds with minutes or something like that. Get a recent version. Q: Why is My Root File System Read-Only? A: To understand how you got into this state, see EXT2-fs: warning: mounting unchecked file system. Remount it. If /etc/fstab is correct, you can simply type: mount -n -o remount / If /etc/fstab is wrong, you must give the device name and possibly the type, too: e.g. mount -n -o remount -t ext2 /dev/hda2 / Q: What Is /proc/kcore? A: None of the files in /proc are really therethey're all, "pretend," files made up by the kernel, to give you information about the system and don't take up any hard disk space. /proc/kcore is like an "alias" for the memory in your computer. Its size is the same as the amount of RAM you have, and if you read it as a file, the kernel does memory reads. Q: Why Does fdformat Require Superuser Privileges? A: The system call to format a floppy can only be done as root, regardless of the permissions of /dev/fd0*. If you want any user to be able to format a floppy, try getting the fdformat2 program. This works around the problems by being setuid to root. Q: Why Doesn't My PCMCIA Card Work after Upgrading the Kernel? A: The PCMCIA Card Services modules, which are located in /lib/modules/ version/pcmcia, where version is the version number of the kernel, use configuration information that is specific to that kernel image only. The PCMCIA modules on your system will not work with a different kernel image. You need to upgrade the PCMCIA card modules when you upgrade the kernel. When upgrading from older kernels, make sure that you have the most recent version of the run-time libraries, the modutils package, and so on. Refer to the file Documentation/Changes in the kernel source tree for details. Important: If you use the PCMCIA Card Services, do not enable the Network device support/Pocket and portable adapters option of the kernel configuration menu, as this conflicts with the modules in Card Services. Knowing the PCMCIA module dependencies of the old kernel is useful. You need to keep track of them. For example, if your PCMCIA card depends on the serial port character device being installed as a module for the old kernel, then you need to ensure that the serial module is available for the new kernel and PCMCIA modules as well. The procedure described here is somewhat kludgey, but it is much easier than re-calculating module dependencies from scratch, and making sure the upgrade modules get loaded so that both the non-PCMCIA and PCMCIA are happy. Recent kernel releases contain a myriad of module options, too many to keep track of easily. These steps use the existing module dependencies as much as possible, instead of requiring you to calculate new ones. However, this procedure does not take into account instances where module dependencies are incompatible from one kernel version to another. In these cases, you'll need to load the modules yourself with insmod, or adjust the module dependencies in the /etc/conf.modules file. The Documentation/ modules.txt file in the kernel source tree contains a good description of how to use the kernel loadable modules and the module utilities like insmod, modprobe, and depmod. Modules.txt also contains a recommended procedure for determining which features to include in a resident kernel, and which to build as modules. Essentially, you need to follow these steps when you install a new kernel.   * Before building the new kernel, make a record with the lsmod command of the module dependencies that your system currently uses. For example, part of the lsmod output might look like this: Module Pages Used by memory_cs 2 0 ds 2 [memory_cs] 3 i82365 4 2 pcmcia_core 8 [memory_cs ds i82365] 3 sg 1 0 bsd_comp 1 0 ppp 5 [bsd_comp] 0 slhc 2 [ppp] 0 serial 8 0 psaux 1 0 lp 2 0 This tells you for example that the memory_cs module needs the ds and pcmcia_core modules loaded first. What it doesn't say is that, in order to avoid recalculating the module dependencies, you may also need to have the serial, lp, psaux, and other standard modules available to prevent errors when installing the pcmcia routines at boot time with insmod. A glance at the /etc/modules file will tell you what modules the system currently loads, and in what order. Save a copy of this file for future reference, until you have successfully installed the new kernel's modules. Also save the lsmod output to a file, for example, with the command: lsmod >lsmod.old-kernel.output.   * Build the new kernel, and install the boot image, either zImage or bzImage, to a floppy diskette. To do this, change to the arch/i386/boot directory (substitute the correct architecture directory if you don't have an Intel machine), and, with a floppy in the diskette drive, execute the command: $ dd if=bzImage of=/dev/fd0 bs=512 if you built the kernel with the make bzImage command, and if your floppy drive is /dev/fd0. This results in a bootable kernel image being written to the floppy, and allows you to try out the new kernel without replacing the existing one that LILO boots on the hard drive.   * Boot the new kernel from the floppy to make sure that it works.   * With the system running the new kernel, compile and install a current version of the PCMCIA Card Services package, available from metalab.unc.edu as well as other Linux archives. Before installing the Card Services utilities, change the names of /sbin/cardmgr and /sbin/ cardctl to /sbin/cardmgr.old and /sbin/cardctl.old. The old versions of these utilities are not compatible with the replacement utilities that Card Services installs. In case something goes awry with the installation, the old utilities won't be overwritten, and you can revert to the older versions if necessary. When configuring Card Services with the make config command, make sure that the build scripts know where to locate the kernel configuration, either by using information from the running kernel, or telling the build process where the source tree of the new kernel is. The make config step should complete without errors. Installing the modules from the Card Services package places them in the directory /lib/modules/version/pcmcia, where version is the version number of the new kernel.   * Reboot the system, and note which, if any, of the PCMCIA devices work. Also make sure that the non-PCMCIA hardware devices are working. It's likely that some or all of them won't work. Use lsmod to determine which modules the kernel loaded at boot time, and compare it with the module listing that the old kernel loaded, which you saved from the first step of the procedure. (If you didn't save a listing of the lsmod output, go back and reboot the old kernel, and make the listing now.)   * When all modules are properly loaded, you can replace the old kernel image on the hard drive. This will most likely be the file pointed to by the /vmlinuz symlink. Remember to update the boot sector by running the lilo command after installing the new kernel image on the hard drive.   * Also look at the questions, How do I upgrade/recompile my kernel? and Modprobe can't locate module, "XXX," and similar messages. ----------------------------------------------------------------------------- 13. Software Development Q: How Do I Compile Programs? Q: How Do I Port XXX to Linux? Q: Can I Use Code or a Compiler Compiled for a 486 on a 386? Q: What Does gcc -O6 Do? Q: What Do I Do About Errors Trying to Compile the Kernel? Q: How Do I Make a Shared Library? Q: Why Are My Programs So Large? Q: How To Prevent Errors when Linking Programs with Math Functions Q: How To Program XYZ Under Linux Q: How To Upgrade/Recompile a Kernel Q: What Is a .gz File? And a .tgz? And .bz2? And... ? Q: Where Are linux/*.h and asm/*.h? Q: Configuring Emacs' Default Settings Q: How Do I Compile Programs? A: Most Linux software is written in C and compiled with the GNU C compiler. GCC is a part of every Linux distribution. The latest compiler version, documentation, and patches are on ftp://ftp.gnu.org/pub/gnu/. Programs that are written in C++ must be compiled with the GNU G++ compiler, which is also included in Linux distributions and available from the same place as GCC. To build version 2.0.x kernels, you will need GCC version 2.7.2.x, approximately. Trying to build an early Linux kernel with a different compiler, like GCC 2.8.x, EGCS, or PGCC, may cause problems because of GCC related code dependencies. Kernel versions 2.2, 2.4, and the 2.5 development kernels should compile correctly with more recent compilers. Information on the EGCS compiler is at http://www.gnu.org/software/gcc/ gcc.html. Note that at this time, the kernel developers are not answering bug requests for earlier kernels, but instead are concentrating on developing 2.5.x version kernels and maintaining 2.2.x and 2.4.x version kernels. [J.H.M. Dassen, Axel Boldt] Q: How Do I Port XXX to Linux? A: In general, *nix programs need very little porting. Simply follow the installation instructions. If you don't know and don't know how to find out the answers to some of the questions asked during the installation procedure, you can guess, but this tends to produce buggy programs. In this case, you're probably better off asking someone else to do the port. If you have a BSD-ish program, you should try using -I/usr/include/bsd and -lbsd on the appropriate parts of the compilation lines. Q: Can I Use Code or a Compiler Compiled for a 486 on a 386? A: Yes, unless it's the kernel. The -m486 option to GCC, which is used to compile binaries for x486 machines, merely changes certain optimizations. This makes for slightly larger binaries that run somewhat faster on a 486. They still work fine on a 386, though, with a small performance hit. However, from version 1.3.35 the kernel uses 486 or Pentium-specific instructions if configured for a 486 or Pentium, thus making it unusable on a 38