home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / linux / faq / part3 < prev    next >
Encoding:
Internet Message Format  |  2004-05-12  |  30.8 KB

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <linux/faq/part3_1084272547@rtfm.mit.edu>
  3. Supersedes: <linux/faq/part3_1083581613@rtfm.mit.edu>
  4. Expires: 1 Jun 2004 10:49:07 GMT
  5. X-Last-Updated: 2001/12/04
  6. Organization: none
  7. Newsgroups: comp.os.linux.misc,news.answers,comp.answers
  8. Subject: Linux Frequently Asked Questions with Answers (Part 3 of 6)
  9. Followup-To: poster
  10. From: rkiesling@mainmatter.com
  11. Approved: news-answers-request@MIT.EDU
  12. X-Disclaimer: Approval for *.answers is based on form, not content.
  13. Originator: faqserv@penguin-lust.MIT.EDU
  14. Date: 11 May 2004 10:51:30 GMT
  15. Lines: 762
  16. NNTP-Posting-Host: penguin-lust.mit.edu
  17. X-Trace: 1084272690 senator-bedfellow.mit.edu 574 18.181.0.29
  18. Xref: senator-bedfellow.mit.edu comp.os.linux.misc:604743 news.answers:271170 comp.answers:57131
  19.  
  20. Archive-Name: linux/faq/part3
  21. URL: http://www.mainmatter.com/
  22. Reply-to: rkiesling@mainmatter.com
  23. Posting-Frequency: weekly
  24. Last-modified: 12/04/2001
  25.  
  26. It's recommend that you create at least one Linux partition entirely
  27. under the 1024 logical cylinder limit, and boot from that. The other
  28. partitions will then be okay.
  29.  
  30. Also there seems to be a bit of trouble with the newer Ultra-DMA
  31. drives. I haven't gotten the straight scoop on them--but they are
  32. becoming a very common problem at the SVLUG installfests. When you can
  33. get 8 to 12 Gig drives for $200 to $300 it's no wonder.
  34.  
  35. [Jim Dennis]
  36.  
  37. 4.2. How To Undelete Files.
  38.  
  39. In general, this is very hard to do on unices because of their
  40. multitasking nature. Undelete functionality for the ext2fs file system
  41. is being worked on, but don't hold your breath.
  42.  
  43. There are a number of packages available which instead provide new
  44. commands for deleting and copying which move deleted files into a
  45. `wastebasket' directory. The files can be recovered until cleaned out
  46. automatically by background processing.
  47.  
  48. The Midnight Commander file manager provides an undelete facility that
  49. uses Ext2 file system library functions and an undelete directory for
  50. each file system. Commercial distribution packages of MC may or may
  51. not have this feature enabled, so be sure to look in the source code
  52. distribution for instructions on how to enable the undelete feature.
  53.  
  54. Alternatively, you can search the raw disk device which holds the file
  55. system in question. This is hard work, and you will need to be logged
  56. in as root to do this. But it can be done. Run grep on the raw device;
  57. e.g.:
  58.  
  59.    grep -b 'bookmarks' /dev/hda
  60.  
  61. If the data has not been overwritten, you should be able to recover it
  62. with a text editor.
  63.  
  64. [Dave Cinege, Daniel Novotny]
  65.  
  66. 4.3. How To Make Backups.
  67.  
  68. You can back up a directory hierarchy or complete file system to any
  69. media using GNU tar or cpio, the standard *nix tools for this purpose.
  70. tar seems to be the more commonly used program currently, and includes
  71. command line options to make compressed, incremental, and multi-volume
  72. backups. Complete information is contained in the documentation, which
  73. is in GNU Texinfo format.
  74.  
  75. The free program, Amanda, receives a lot of mentions on Usenet. Its
  76. home page is http://www.amanda.org/.
  77.  
  78. Several commercial backup utilities also exist. They are often
  79. included in commercial distributions.
  80.  
  81. 4.4. How To Resize a Partition (Non-Destructively).
  82.  
  83. Use the FIPS.EXE program, included with most Linux distributions,under
  84. MS-DOS.
  85.  
  86. GNU parted, a partition editor, is stable enough for non-guru,
  87. mere-mortal use with relative confidence. Source code for the latest
  88. version is at: ftp://ftp.gnu.org/pub/gnu/parted/. There's also a boot
  89. disk image for resizing root partitions and for running parted on
  90. non-Linux machines. The disk image may be easier for beginners.
  91. Building from source could require some extra configuration.
  92.  
  93. Parted also has tutorial-style, plain-text documentation for Linux and
  94. FAT (MS-DOS) file systems.
  95.  
  96. Also, some commercial distributions come with their own partitioning
  97. software, like Partition Magic.
  98.  
  99. 4.5. Is There a Defragmenter for Ext2fs?
  100.  
  101. Yes. There is defrag, a Linux file system defragmenter for ext2,
  102. Minix, and old-style ext file systems. It is available at
  103. ftp://metalab.unc.edu/pub/Linux/system/filesystems/defrag-0.70.tar.gz.
  104.  
  105. Users of the ext2 file system can probably do without defrag, because
  106. ext2 contains extra code to keep fragmentation reduced even in very
  107. full file systems.
  108.  
  109. 4.6. How To Create a File System on a Floppy.
  110.  
  111. To format a 3.5-inch, high density floppy:
  112.  
  113. $ fdformat /dev/fd0H1440
  114. $ mkfs -t ext2 -m 0 /dev/fd0H1440 1440
  115.  
  116. For a 5.25 inch floppy, use fd0h1200 and 1200 as appropriate. For the
  117. B: drive use fd1 instead of fd0.
  118.  
  119. The -m 0 option tells mkfs.ext2 not to reserve any space on the disk
  120. for the superuser--usually the last 10% is reserved for root.
  121.  
  122. The first command performs a low-level format. The second creates an
  123. empty file system. You can mount the floppy like a hard disk partition
  124. and simply cp and mv files, etc.
  125.  
  126. Device naming conventions generally are the same as for other unices.
  127. They can be found in Matt Welsh's Installation and Getting Started
  128. guide. Refer to ("Where Is the Documentation?") A more detailed and
  129. technical description is Linux Allocated Devices by H. Peter Anvin,
  130. hpa@zytor.com, which is included in LaTeX and ASCII form in the kernel
  131. source distribution (probably in /usr/src/kernel/Documentation/), as
  132. devices.tex and devices.txt.
  133.  
  134. 4.7. Does Linux Support Virtualized File Systems Like RAID?
  135.  
  136. The most recent Linux kernels support software RAID, and they will
  137. work with RAID disk controllers.
  138.  
  139. An automounter for NFS partitions is part of most Linux distributions.
  140.  
  141. In addition, several virtual file system projects exist. One of them,
  142. the Linux Logical Volume Manager, is located at
  143. http://linux.msede.com/lvm/.
  144.  
  145. 4.8. Does Linux Support File System Encryption?
  146.  
  147. Yes. One file system, ppdd, is archived at
  148. http://pweb.de.uu.net/flexsys.mtk/.
  149.  
  150. 4.9. Linux Prints Nasty Messages about Inodes, Blocks, and the Like.
  151.  
  152. You may have a corrupted file system, probably caused by not shutting
  153. Linux down properly before turning off the power or resetting. You
  154. need to use a recent shutdown program to do this--for example, the one
  155. included in the util-linux package, available on sunsite and tsx-11.
  156.  
  157. If you're lucky, the program fsck (or e2fsck or xfsck as appropriate
  158. if you don't have the automatic fsck front-end) will be able to repair
  159. your file system. If you're unlucky, the file system is trashed, and
  160. you'll have to re-initialize it with mkfs (or mke2fs, mkxfs, etc.),
  161. and restore from a backup.
  162.  
  163. NB: don't try to check a file system that's mounted read/write--this
  164. includes the root partition, if you don't see
  165.  
  166.    VFS: mounted root ... read-only
  167.  
  168. at boot time.
  169.  
  170. 4.10. The Swap Area Isn't Working.
  171.  
  172. When you boot (or enable swapping manually) you should see
  173.  
  174.    Adding Swap: NNNNk swap-space
  175.  
  176. If you don't see any messages at all you are probably missing
  177.  
  178.    swapon -av
  179.  
  180. (the command to enable swapping) in your /etc/rc.local or /etc/rc.d/*
  181. (the system startup scripts), or have forgotten to make the right
  182. entry in /etc/fstab:
  183.  
  184.    /dev/hda2       none       swap       sw
  185.  
  186. for example.
  187.  
  188. If you see:
  189.  
  190.    Unable to find swap-space signature
  191.  
  192. you have forgotten to run mkswap. See the manual page for details; it
  193. works much like mkfs.
  194.  
  195. Running, free in addition to showing free memory, should display:
  196.  
  197.           total       used       free
  198. Swap:        10188       2960       7228
  199.  
  200. If typing "cat /proc/swaps" reveals only file or partition names, but
  201. no swap space information, then the swap file or partition needs
  202. re-initialization.
  203.  
  204. Use fdisk (as root) to determine which partition on a hard drive has
  205. been designated as the swap partition. The partition still needs to be
  206. initialized with mkswap before enabling it with swapon.
  207.  
  208. [Andy Jefferson, Steve Withers]
  209.  
  210. 4.11. How To Add Temporary Swap Space.
  211.  
  212. In addition to a swap partition, Linux can also use a swap file. Some
  213. programs, like g++, can use huge amounts of virtual memory, requiring
  214. the temporary creation of extra space. To install an extra 64 MB of
  215. swap space, for example, use the following shell commands:
  216.  
  217. # dd if=/dev/zero of=/swap bs=1024 count=65535
  218. # mkswap /swap
  219. # swapon /swap
  220.  
  221. The count= argument to dd determines how big the swap file will be. In
  222. this example the swap file's name is /swap, but the name and location
  223. are, generally, arbitrary, depending only on the file system's
  224. available space and your having write permissions in the directory.
  225.  
  226. When you don't need the swap space any more, remove it with the
  227. following statements:
  228.  
  229. # swapoff /swap
  230. # rm /swap
  231.  
  232. Take a look also at the Installation HOWTO and Installation & Getting
  233. Started for detailed instructions.
  234.  
  235. If that still doesn't provide enough swap space, refer to ("How To
  236. Have More Than 128Mb of Swap.")
  237.  
  238. 4.12. How To Remove LILO So the System Boots DOS Again?
  239.  
  240. The lilo program (not the complete LILO package), uses the command
  241. line option -u to uninstall the LILO boot loader. You have to supply
  242. the device name of the device you installed LILO on, for example:
  243.  
  244.    lilo -u /dev/hda
  245.  
  246. This rewrites the original, pre-LILO master boot record back to the
  247. first hard drive, from the boot record saved in /boot/boot.0300. If
  248. you installed LILO to a partition as a secondary boot loader, for
  249. example, /dev/hda1, lilo re-installs the original boot sector from the
  250. save file /boot/boot.0301. Refer to the lilo manual page for details.
  251. Thanks to Villy Kruse for reminding me to update this answer.
  252.  
  253. If you have an earlier version of LILO, you will have to use the DOS
  254. (MS-DOS 5.0 or later, or OS/2) FDISK /MBR (which is not documented).
  255. This will restore a standard MS-DOS Master Boot Record. If you have
  256. DR-DOS 6.0, go into FDISK.EXE in the normal way and then select the
  257. Re-write Master Boot Record option.
  258.  
  259. If you create a boot floppy during the Windows installation process,
  260. make sure that it contains the programs FDISK.EXE, FORMAT.COM, and
  261. SYS.COM, and use that to re-install MS-DOS on the hard disk.
  262.  
  263. If you don't have MS-DOS or DR-DOS, you need to have the boot sector
  264. that LILO saved when you first installed it. You did keep that file,
  265. didn't you? It's probably called boot.0301 or some such. Type:
  266.  
  267.    dd if=boot.0301 of=/dev/hda bs=445 count=1
  268.  
  269. (or /dev/sda if you're using a SCSI disk). This may also wipe out your
  270. partition table, so beware! If you're desperate, you could use
  271.  
  272.    dd if=/dev/zero of=/dev/hda bs=512 count=1
  273.  
  274. This will erase your partition table and boot sector completely: you
  275. can then reformat the disk using your favorite software. But this will
  276. render the contents of your disk inaccessible--you'll lose it all
  277. unless you're an expert.
  278.  
  279. Note that the DOS MBR boots whichever (single!) partition is flagged
  280. as "active." You may need to use fdisk to set and clear the active
  281. flags on partitions appropriately.
  282.  
  283. 4.13. Why Does fdformat Require Superuser Privileges?
  284.  
  285. The system call to format a floppy can only be done as root,
  286. regardless of the permissions of /dev/fd0*. If you want any user to be
  287. able to format a floppy, try getting the fdformat2 program. This works
  288. around the problems by being setuid to root.
  289.  
  290. 4.14. The System Checks the Ext2fs Partitions Each Reboot.
  291.  
  292. Refer to ("EXT2-fs: warning: mounting unchecked file system.)
  293.  
  294. 4.15. Root File System Is Read-Only.
  295.  
  296. Remount it. If /etc/fstab is correct, you can simply type:
  297.  
  298.    mount -n -o remount /
  299.  
  300. If /etc/fstab is wrong, you must give the device name and possibly the
  301. type, too: e.g.
  302.  
  303.    mount -n -o remount -t ext2 /dev/hda2 /
  304.  
  305. To understand how you got into this state, see, ("EXT2-fs: warning:
  306. mounting unchecked file system.")
  307.  
  308. 4.16. What Is /proc/kcore?
  309.  
  310. None of the files in /proc are really there--they're all, "pretend,"
  311. files made up by the kernel, to give you information about the system
  312. and don't take up any hard disk space.
  313.  
  314. /proc/kcore is like an "alias" for the memory in your computer. Its
  315. size is the same as the amount of RAM you have, and if you read it as
  316. a file, the kernel does memory reads.
  317.  
  318. 4.17. The AHA1542C Doesn't Work with Linux.
  319.  
  320. The option to allow disks with more than 1024 cylinders, which the
  321. AHA1542C card can recognize, is only required as a workaround for a
  322. PC-compatible BIOS misfeature and should be turned `off' under Linux.
  323. For older Linux kernels you need to turn off most of the `advanced
  324. BIOS' options--all but the one about scanning the bus for bootable
  325. devices.
  326.  
  327. 4.18. Where Is the Journalling File System on the Net?
  328.  
  329. The journalling file system, named Reiserfs has just been released
  330. from testing. It is said to make Linux even faster than Linux with the
  331. Ext2 file system installed. Complete information is available at
  332. http://devlinux.org/namesys/.
  333.  
  334. 5. Porting, Compiling and Obtaining Programs
  335.  
  336. 5.1. How To Compile Programs.
  337.  
  338. Most Linux software is written in C and compiled with the GNU C
  339. compiler. GCC is a part of every Linux distribution. The latest
  340. compiler version, documentation, and patches are on
  341. ftp://ftp.gnu.org/pub/gnu/.
  342.  
  343. Programs that are written in C++ must be compiled with the GNU G++
  344. compiler, which is also included in Linux distributions and available
  345. from the same place as GCC.
  346.  
  347. To build version 2.0.x kernels, you will need GCC version 2.7.2.x,
  348. approximately. Trying to build an early Linux kernel with a different
  349. compiler, like GCC 2.8.x, EGCS, or PGCC, may cause problems because of
  350. GCC related code dependencies. Kernel versions 2.3 and 2.4 should
  351. compile correctly with more recent compilers.
  352.  
  353. Information on the EGCS compiler is at
  354. http://www.gnu.org/software/gcc/gcc.html.
  355.  
  356. Note that at this time, the kernel developers are not answering bug
  357. requests for earlier kernels, but instead are concentrating on
  358. developing 2.4.x version kernels and maintaining 2.2.x version
  359. kernels.
  360.  
  361. [J.H.M. Dassen, Axel Boldt]
  362.  
  363. 5.2. How To Install GNU Software.
  364.  
  365. On a correctly configured system, installing a GNU software package
  366. requires four steps:
  367.  
  368.   * With the source.tar.gz archive in the /usr/src/ directory, or
  369.     wherever you maintain your source files, untar and decompress the
  370.     package with the command:
  371.     
  372. tar zxvf package-name.tar.gz
  373.  
  374.   * Run the ./configure script in the untarred source archive's
  375.     top-level directory with whatever command line arguments you need.
  376.     The options that configure recognizes are usually contained in a
  377.     file called INSTALL or README.
  378.   * Run make. This will build the source code into an executable
  379.     program (or programs) and may take a few minutes or a few hours,
  380.     depending on the speed of the computer and the size of the
  381.     package.
  382.   * Run make install. This will install the compiled binaries,
  383.     configuration files, and any libraries in the appropriate
  384.     directories.
  385.  
  386. 5.3. Where To Get Java.
  387.  
  388. The Sun Microsystems Java runtime environments and developer's kits
  389. are at http://java.sun.com/java/.
  390.  
  391. You can also get the source code, which is licensed by Sun
  392. Microsystems.
  393.  
  394. The home page of IBM's Jikes Java compiler is
  395. http://www10.software.ibm.com/developerworks/opensource/jikes.
  396.  
  397. There is a version of Sun's HotJava browser for Linux at:
  398. http://www.java.sun.com/products/hotjava/.
  399.  
  400. Kaffee, a free Java clone, is available from: http://www.kaffe.org/.
  401.  
  402. There is a resource page of free and commercial Java packages at:
  403. http://www.blackdown.org/java-linux.html.
  404.  
  405. Netscape Communicator comes with its own version of the Java Runtime
  406. Environment, so if you need Java only to view Web graphics, you may
  407. already have the runtime version of the Java Virtual Machine and
  408. libraries that you need installed on your system. You can download
  409. Communicator from http://www.netscape.com/.
  410.  
  411. 5.4. How To Port XXX to Linux.
  412.  
  413. In general, *nix programs need very little porting. Simply follow the
  414. installation instructions. If you don't know--and don't know how to
  415. find out--the answers to some of the questions asked during the
  416. installation procedure, you can guess, but this tends to produce buggy
  417. programs. In this case, you're probably better off asking someone else
  418. to do the port. If you have a BSD-ish program, you should try using
  419. -I/usr/include/bsd and -lbsd on the appropriate parts of the
  420. compilation lines.
  421.  
  422. 5.5. What Is ld.so and How To Get It?
  423.  
  424. ld.so is the dynamic library loader. Each binary using shared
  425. libraries used to have about 3K of start-up code to find and load the
  426. shared libraries. Now that code has been put in a special shared
  427. library, /lib/ld.so, where all binaries can look for it, so that it
  428. wastes less disk space, and can be upgraded more easily. ld.so can be
  429. obtained from http://tsx-11.mit.edu/pub/linux/packages/GCC/ and mirror
  430. sites. The latest version at the time of writing is
  431. ld.so.1.9.5.tar.gz. /lib/ld-linux.so.1 is the same thing for ELF
  432. ("What's all this about ELF? ") and comes in the same package as the
  433. a.out loader.
  434.  
  435. 5.6. How To Upgrade the Libraries without Trashing the System.
  436.  
  437. Warning
  438.  
  439. Note: You should always have a rescue disk set ready when you perform
  440. this procedure, in the likely event that something goes wrong!
  441.  
  442. This procedure is especially difficult if you're upgrading very old
  443. libraries like libc4. But you should be able to keep libc4 on the same
  444. system with libc5 libraries for the programs that still need them. The
  445. same holds true for upgrading from libc5 to the newer-yet glibc2
  446. libraries.
  447.  
  448. The problem with upgrading dynamic libraries is that, the moment you
  449. remove the old libraries, the utilities that you need to upgrade to
  450. the new version of the libraries don't work. There are ways around
  451. around this. One is to temporarily place a spare copy of the run time
  452. libraries, which are in /lib/, in /usr/lib/, or /usr/local/lib/, or
  453. another directory that is listed in the /etc/ld.so.conf file.
  454.  
  455. For example, when upgrading libc5 libraries, the files in /lib/ might
  456. look something like:
  457.  
  458. libc.so.5
  459. libc.so.5.4.33
  460. libm.so.5
  461. libm.so.5.0.9
  462.  
  463. These are the C libraries and the math libraries. Copy them to another
  464. directory that is listed in /etc/ld.so.conf, like /usr/lib/:
  465.  
  466. $ cp -df /lib/libc.so.5* /usr/lib/
  467. $ cp -df /lib/libm.so.5* /usr/lib/
  468. $ ldconfig
  469.  
  470. Be sure to run ldconfig to upgrade the library configuration.
  471.  
  472. The files libc.so.5 and libm.so.5 are symbolic links to the actual
  473. library files. When you upgrade, the new links will not be created if
  474. the old links are still there, unless you use the -f flag with cp. The
  475. -d flag to cp will copy the symbolic link itself, and not the file it
  476. points to.
  477.  
  478. If you need to overwrite the link to the library directly, use the -f
  479. flag with ln.
  480.  
  481. For example, to copy new libraries over the old ones, try this. Make a
  482. symbolic link to the new libraries first, then copy both the libraries
  483. and the links to /lib/, with the following commands.
  484.  
  485. $ ln -sf ./libm.so.5.0.48 libm.so.5
  486. $ ln -sf ./libc.so.5.0.48 libc.so.5
  487. $ cp -df libm.so.5* /lib
  488. $ cp -df libc.so.5* /lib
  489.  
  490. Again, remember to run ldconfig after you copy the libraries.
  491.  
  492. If you are satisfied that everything is working correctly, you can
  493. remove the temporary copies of the old libraries from /usr/lib/ or
  494. wherever you copied them.
  495.  
  496. 5.7. How To Use Code or a Compiler Compiled for a 486 on a 386.
  497.  
  498. Yes, unless it's the kernel.
  499.  
  500. The -m486 option to GCC, which is used to compile binaries for x486
  501. machines, merely changes certain optimizations. This makes for
  502. slightly larger binaries that run somewhat faster on a 486. They still
  503. work fine on a 386, though, with a small performance hit.
  504.  
  505. However, from version 1.3.35 the kernel uses 486 or Pentium-specific
  506. instructions if configured for a 486 or Pentium, thus making it
  507. unusable on a 386.
  508.  
  509. GCC can be configured for a 386 or 486; the only difference is that
  510. configuring it for a 386 makes -m386 the default and configuring for a
  511. 486 makes -m486 the default. In either case, these can be overridden
  512. on a per-compilation basis or by editing /usr/lib/gcc-lib/i*-linux/
  513. n.n.n/specs.
  514.  
  515. There is an alpha version of GCC that knows how to do optimization
  516. well for the 586, but it is quite unreliable, especially at high
  517. optimization settings. The Pentium GCC can be found on
  518. ftp://tsx-11.mit.edu/pub/linux/ALPHA/pentium-gcc/. The ordinary 486
  519. GCC supposedly produces better code for the Pentium using the -m386,
  520. or at least slightly smaller.
  521.  
  522. 5.8. What Does "gcc -O6" Do?
  523.  
  524. Currently, the same as -O2 (GCC 2.5) or -O3 (GCC 2.6, 2.7). Any number
  525. greater than that does the same thing. The Makefiles of newer kernels
  526. use -O2, and you should probably do the same.
  527.  
  528. 5.9. Where Are linux/*.h and asm/*.h?
  529.  
  530. The files /usr/include/linux/ and /usr/include/asm/ are often soft
  531. links to the directories where the kernel headers are. They are
  532. usually under /usr/src/kernel*/.
  533.  
  534. If you don't have the kernel sources, download them. Refer to the
  535. answer: ("How To Upgrade/Recompile a Kernel.")
  536.  
  537. Then, use rm to remove any garbage, and ln to create the links:
  538.  
  539. $ rm -rf /usr/include/linux /usr/include/asm
  540. $ ln -sf /usr/src/linux/include/linux /usr/include/linux
  541. $ ln -sf /usr/src/linux/include/asm-<architecture> /usr/include/asm
  542.  
  543. The assembly language files reside in architecture-specific
  544. directories, so you need to link /usr/src/include/asm to
  545. /usr/src/linux/include/asm-i386 on PC compatible systems, to
  546. /usr/src/linux/include/asm-sparc on Sun Sparc systems, to
  547. /usr/src/linux/include/asm-ppc on PPC systems, and so on.
  548.  
  549. You'll also find that you may need to do `make config' as in a
  550. newly-unpacked kernel source tree, to create linux/autoconf.h.
  551.  
  552. 5.10. What To Do about Errors Trying to Compile the Kernel.
  553.  
  554. See the previous question regarding the header files.
  555.  
  556. Remember that when you apply a patch to the kernel, you must use the
  557. "-p0" or "-p1" option: otherwise, the patch may be misapplied. See the
  558. patch manual page for details.
  559.  
  560. "ld: unrecognized option `-qmagic'" means that you should get a newer
  561. linker, from ftp://tsx-11.mit.edu/pub/linux/packages/GCC/, in the file
  562. binutils-2.8.1.0.1.bin.tar.gz.
  563.  
  564. 5.11. How To Make a Shared Library.
  565.  
  566. For ELF,
  567.  
  568. $ gcc -fPIC -c *.c
  569. $ gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 *.o
  570.  
  571. For a.out, get tools-n.nn.tar.gz from
  572. tsx-11.mit.edu/pub/linux/packages/GCC/src/. It comes with
  573. documentation that will tell you what to do. Note that a.out shared
  574. libraries are a very tricky business. Consider upgrading your
  575. libraries to ELF shared libraries. See the ELF HOWTO, at
  576. ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/
  577.  
  578. 5.12. Programs Are Very Large.
  579.  
  580. With an ELF compiler ("What's All This about ELF? glibc?"), the most
  581. common cause of large executables is the lack of an appropriate .so
  582. library link for one of the libraries you're using. There should be a
  583. link like libc.so for every library like libc.so.5.2.18.
  584.  
  585. With an a.out compiler the most common cause of large executables is
  586. the -g linker (compiler) flag. This produces (as well as debugging
  587. information in the output file) a program which is statically
  588. linked--one which includes a copy of the C library instead of a
  589. dynamically linked copy.
  590.  
  591. Other things worth investigating are -O and -O2, which enable
  592. optimization (check the GCC documentation), and -s (or the strip
  593. command) which strip the symbol information from the resulting binary
  594. (making debugging totally impossible).
  595.  
  596. You may wish to use -N on very small executables (less than 8K with
  597. the -N), but you shouldn't do this unless you understand its
  598. performance implications, and definitely never with daemons.
  599.  
  600. 5.13. Does Linux Support Threads or Lightweight Processes?
  601.  
  602. As well as the Unix multiprocessing model involving heavyweight
  603. processes, which is of course part of the standard Linux kernel, there
  604. are several implementations of lightweight processes or threads.
  605. Recent kernels implement a thread model, kthreads. In addition, there
  606. are the following packages available for Linux.
  607.  
  608.   * GNU glibc2 for Linux has optional support for threads. The archive
  609.     is available from the same place as glibc2,
  610.     ftp://ftp.gnu.org/pub/gnu/
  611.   * In sipb.mit.edu:/pub/pthread/ or
  612.     ftp.ibp.fr:/pub/unix/threads/pthreads. Documentation isn't in the
  613.     package, but is available on the World Wide Web at
  614.     http://www.mit.edu:8001/people/proven/home_page.html. Newer Linux
  615.     libc's contain the pthreads source. The GNU Ada compiler on
  616.     ftp://metalab.unc.edu/pub/Linux/devel/lang/ada/gnat-3.01-linux+elf
  617.     .tar.gz contains binaries made from that source code.
  618.   * In ftp://ftp.cs.washington.edu:/pub/qt-001.tar.Z is QuickThreads.
  619.     More information can be found in the technical report, available
  620.     on the same site is /tr/1993/05/UW-CSE-93-05-06.PS.Z.
  621.   * In gummo.doc.ic.ac.uk/rex/ is lwp, a very minimal implementation.
  622.   * In ftp://ftp.cs.fsu.edu:/pub/PART/, an Ada implementation. This is
  623.     useful mainly because it has a lot of Postscript papers that
  624.     you'll find useful in learning more about threads. This is not
  625.     directly usable under Linux.
  626.     
  627. Please contact the authors of the packages in question for details.
  628.  
  629. 5.14. Where To Find lint for Linux.
  630.  
  631. Roughly equivalent functionality is built into GCC. Use the -Wall
  632. option to turn on most of the useful extra warnings. See the GCC
  633. manual for more details (type F1-i in Emacs and select the entry for
  634. GCC).
  635.  
  636. There is a freely available program called lclint that does much the
  637. same thing as traditional lint. The announcement and source code are
  638. available at on ftp://larch.lcs.mit.edu/pub/Larch/lclint/; on the
  639. World Wide Web, look at http://lclint.cs.virginia.edu/.
  640.  
  641. 5.15. Where To Find Kermit for Linux.
  642.  
  643. Kermit is distributed under a non-GPL copyright that makes its terms
  644. of distribution somewhat different. The sources and some binaries are
  645. available on ftp://kermit.columbia.edu.
  646.  
  647. The WWW Home Page of the Columbia University Kermit project is
  648. http://www.columbia.edu/kermit/.
  649.  
  650. 5.16. How To Use Linux with a Cable Modem.
  651.  
  652. The www.CablemodemInfo.com and xDSL Web page at
  653. http://www.cablemodeminfo.com/ has a section devoted to Linux.
  654.  
  655. 5.17. Is There an ICQ Program That Runs under Linux?
  656.  
  657. Several ICQ clients are available on metalab.unc.edu. (Refer to:
  658. "Where Are the Linux FTP Archives?") ICQ itself does not have a Linux
  659. client, but there is a Java client at
  660. http://www.mirabilis.com/download/.
  661.  
  662. 6. Solutions to Common Miscellaneous Problems
  663.  
  664. 6.1. FTP Transfers Seem to Hang.
  665.  
  666. FTP transfers that die suddenly are due, apparently, to some form of
  667. overrunning buffer. It occurs both with Linux and Microsoft servers.
  668. On Linux systems, The problem seems to occur most commonly with the
  669. distribution's server software.
  670.  
  671. If you receive ftp: connection refused errors, then the problem is
  672. likely due to a lack of authentication. Refer to "FTP or Telnet Server
  673. Won't Allow Logins.."
  674.  
  675. One remedy is to be replacing the distribution FTP server with the
  676. Linux port of the OpenBSD FTP server. The home page is:
  677. http://www.eleves.ens.fr:8080/home/madore/programs/
  678.  
  679. To install the BSD server, follow the installation instructions, and
  680. refer to the manual pages for inetd and inetd.conf. (If you have the
  681. newer xinetd, see below.) Be sure to tell inetd to run the BSD daemon
  682. alone, not as a subprocess of, for example, tcpd. Comment out the line
  683. that begins "ftp" in the /etc/inetd.conf file and replace it with a
  684. line similar to (if you install the new ftpd in /usr/local/sbin/):
  685.  
  686. # Original entry, commented out.
  687. #ftp    stream  tcp     nowait  root    /usr/sbin/tcpd /usr/sbin/in.ftpd
  688.  
  689. # Replacement entry:
  690. ftp     stream  tcp     nowait  root    /usr/local/sbin/ftpd -l
  691.  
  692. The replacement daemon will become effective after rebooting or
  693. sending (as root) a SIGHUP to inetd, e.g.:
  694.  
  695. # kill -HUP inetd
  696.  
  697. To configure xinetd, create an entry in /etc/xinetd.d per the
  698. instructions in the xinetd.conf manual page. Make sure, again, that
  699. the command-line arguments for ftpd are correct, and that you have
  700. installed the /etc/ftpusers and /etc/pam.d/ftp files. Then restart
  701. xinetd with the command: /etc/rc.d/init.d/xinetd restart. The command
  702. should report "OK," and the restart will be noted in the system
  703. message log.
  704.  
  705. 6.2. Free Dumps Core.
  706.  
  707. In Linux 1.3.57 and later, the format of /proc/meminfo was changed in
  708. a way that the implementation of free doesn't understand. Get the
  709. latest version, from metalab.unc.edu, in
  710. /pub/Linux/system/Status/ps/procps-0.99.tgz.
  711.  
  712. 6.3. Netscape Crashes Frequently.
  713.  
  714. Netscape shouldn't crash, if it and the network are properly
  715. configured. Some things to check:
  716.  
  717.   * Make sure that the MOZILLA_HOME environment variable is correctly
  718.     set. If you installed Netscape under /usr/local/netscape/, for
  719.     example, that should be the value of MOZILLA_HOME. Set it from the
  720.     command line (e.g, "export MOZILLA_HOME="/usr/local/netscape""
  721.     under bash or add it to one your personal or system initialization
  722.     files. Refer to the manual page for your shell for details.
  723.   * If you have a brand-new version of Netscape, try a previous
  724.     version, in case the run-time libraries are slightly incompatible.
  725.     For example, if Netscape version 4.75 is installed (type "netscape
  726.     --version" at the shell prompt), try installing version 4.7. All
  727.     versions are archived at ftp://ftp.netscape.com/.
  728.   * Netscape uses its own Motif and Java Runtime Environment
  729.     libraries. If a separate version of either is installed on your
  730.     system, ensure that they aren't interfering with Netscape's
  731.     libraries; e.g., by un-installing them.
  732.   * Make sure that Netscape can connect to its default name servers.
  733.     The program will appear to freeze and time out after several
  734.     minutes if it can't. This indicates a problem with the system's
  735.     Internet connection; likely, the system can't connect to other
  736.     sites, either.
  737.  
  738. 6.4. FTP or Telnet Server Won't Allow Logins.
  739.  
  740. This applies to server daemons that respond to clients, but don't
  741. allow logins. On new systems that have Pluggable Authentication
  742. Modules installed, look for a file named, "ftp," or "telnet," in the
  743. directory /etc/pam/ or /etc/pam.d/. If the corresponding
  744. authentication file doesn't exist, the instructions for configuring
  745. FTP and Telnet authentication and other PAM configuration, should be
  746. in /usr/doc/pam-<version>. Refer also to the answer for "FTP server
  747. says: "421 service not available, remote server has closed
  748. connection."."
  749.  
  750. If it's an FTP server on an older system, make sure that the account
  751. exists in /etc/passwd, especially "anonymous."
  752.  
  753. This type of problem may also be caused a failure to resolve the host
  754. addresses properly, especially if using Reverse Address Resolution
  755. Protocol (RARP). The simple answer to this is to list all relevant
  756. host names and IP addresses in the /etc/hosts files on each machine. (
  757. Refer to the example /etc/hosts and /etc/resolv.conf files in:
  758. "Sendmail Pauses for Up to a Minute at Each Command..") If the network
  759. has an internal DNS, make sure that each host can resolve network
  760. addresses using it.
  761.  
  762. If the host machine doesn't respond to FTP or Telnet clients at all,
  763. then the server daemon is not installed correctly, or at all. Refer to
  764. the manual pages: inetd and inetd.conf on older systems, or xinetd and
  765. xinetd.conf, as well as ftpd, and telnetd.
  766.  
  767. 6.5. How To Keep Track of Bookmarks in Netscape?
  768.  
  769. This probably applies to most other browsers, too. In the
  770. Preferences/Navigator menu, set your home page to Netscape's
  771. bookmarks.html file, which is located in the .netscape (with a leading
  772. period) subdirectory. For example, if your login name is "smith," set
  773. the home page to:
  774.  
  775.    file://home/smith/.netscape/bookmarks.html
  776.  
  777. Setting up your personal home page like this will present you with a
  778. nicely formatted (albeit possibly long) page of bookmarks when
  779. Netscape starts. And the file is automatically updated whenever you
  780. add, delete, or visit a bookmarked site.
  781.  
  782.