Linux-Misc Digest #827, Volume #23 Sun, 12 Mar 00 14:13:03 EST
Contents:
Linux Frequently Asked Questions with Answers (Part 5 of 6)
([EMAIL PROTECTED])
----------------------------------------------------------------------------
Crossposted-To: news.answers,comp.answers
Subject: Linux Frequently Asked Questions with Answers (Part 5 of 6)
From: [EMAIL PROTECTED]
Reply-to: [EMAIL PROTECTED]
Date: Sun, 12 Mar 2000 19:08:06 GMT
Most Linux documentation also has additional instructions for
configuring PPP connections. Refer to "Where can I get Linux
material by FTP? " and "Where can I get the HOWTO's and other
documentation? ""Where can I get the HOWTO's and other
documentation? "
8.7 What version of Linux and what machine name am I using?
Type:
uname -a
8.8 How can I enable or disable core dumps?
By using the ulimit command in bash, the limit command in tcsh, or the
rlimit command in ksh. See the appropriate manual page for details.
This setting affects all programs run from the shell (directly or
indirectly), not the whole system.
If you wish to enable or disable core dumping for all processes by
default, you can change the default setting in linux/sched.h--see the
definition of INIT_TASK, and look also in linux/resource.h.
8.9 How do I upgrade/recompile my kernel?
See the Kernel HOWTO or the README files which come with the kernel
release on ftp.cs.helsinki.fi, in /pub/Software/Linux/Kernel/ and
mirrors. (See "Where can I get Linux material by FTP? ") You
may already have a version of the kernel source code installed on your
system, but if it is part of a standard distribution it is likely to
be somewhat out of date (this is not a problem if you only want a
custom configured kernel, but it probably is if you need to upgrade.)
With newer kernels you can (and should) make all of the following
targets. Don't forget that you can specify multiple targets with one
command.
make clean dep install modules modules_install
Also remember to update the module dependencies.
depmod -a
This command can be run automatically at boot time. On Debian/GNU
Linux systems, the command is part of the /etc/init.d/modutils script,
and can be linked appropriately in the /etc/rc(x).d/ directories. For
more information on depmod, see the manual page.
Make sure you are using the most recent version of the modutils
utilities, as well as all other supporting packages. Refer to the file
Documentation/Changes in the kernel source tree for specifics, and be
sure to consult the README file in the modutils package.
Remember that to make the new kernel boot you must run the "lilo"
command after copying the kernel into your root partition--the
Makefile in some kernels have a special zlilo target for this; try:
make zlilo
On current systems, however, you can simply copy the zImage or bzImage
file (in arch/i386/boot/ to the /boot/ directory on the root file
system, or to a floppy using the dd command. Refer also to the
question, How do I get LILO to boot the kernel image?
Kernel version numbers with an odd minor version (ie, 1.1.x, 1.3.x)
are the testing releases; stable production kernels have even minor
versions (1.0.x, 1.2.x). If you want to try the testing kernels you
should probably subscribe to the linux-kernel mailing list. (See "
What mailing lists are there? .")
The Web site http://www.kernelnotes.org/ has lots of information
and links to other sites that provide information about Linux kernel
updates..
Also refer to the questions, I upgraded the kernel and now my
PCMCIA card doesn't work. , and How do I get LILO to boot the
kernel image?
8.10 Can I have more than 3 serial ports by sharing interrupts?
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.
8.11 How do I update (for example) the system's perl documentation?
Because program source and documentation files accumulate on machines
that have been in operation for a long time (like McGee's closet),
it's a good idea to get acquainted with the "*nix way of doing
things" (really no sarcasm intended) to make sure that you know
what's on your system. In short, let the computer do it for you in the
background.
The following bash shell script uses the programs find, egrep, and sed
to search directory hierarchies for the text string "=head1," which
signals the start of a Perl POD (Plain Old Documentation) module. It
then constructs and executes a shell script to generate the formatted
documentation from those files.
The programs that do the actual formatting are pod2man and pod2text.
They are Perl scripts that call Perl library modules. The programs
pod2latex and pod2html can also be added to the script, if they're
present on the system. Place the shell script below in a file called
"makepods," and then make the file executable with the shell
command:
chmod +x makepods
Then you should be able to execute it in the current directory with
the command:
./makepods
snip here
...................................................................
#!/bin/sh
rm -f /tmp/find.tmp
#
# makepods (C) 1999 by Robert Kiesling
# This program is free software; it is distributed under the
# terms of the GNU General Public License, available at
# http://www.gnu.org/. This software comes with no warranty,
# and the author disclaims any responsibility for its (mis)use
# on your system.
#
# WARNING:
# This program can overwrite Perl library files if you are not
# careful! You have been warned!
#
# End of legal.
# Now back to the program:
#
# List of the top-level directories that you want to search,
# separated by spaces:
#
directories='/usr /var'
#
# Extension that the formatted output files should have.
ext="txt"
#
# Program that does the actual formatting. Possible values are
# "pod2man" and "pod2text." Your system may have others...
#
converter="pod2text"
#
# Generate a list of files in the 'directories' hierarchy(s)
# that contain the POD format string '=head1'.
#
for i in $directories ; do
find $i -type f -exec grep -l '=head1' {} \; >/tmp/find.tmp
done
#
# Remove from the list the files we're not interested in;
# e.g., man pages, html pages, vim and Emacs scripts....
#
egrep -v -E '*\.([1-9]|html|vim|el?)' /tmp/find.tmp >/tmp/eg1.tmp
#
# Generate a shell script from the commands, so that stdout is in
# the current directory. In this example, pod2man and pod2text are
# the commands used to format each input file from the list generated
# above, and the output files are given the extension defined by the
# variable "ext."
#
if [ $converter = "pod2man" ] ; then
sed -e "s/^/$converter --section=$ext /g" \
-e "s^\(/.*\)^\1 >\1^g" \
-e "s^>/.*/\([^\.]*\).*$^>\1.$ext^g" </tmp/eg1.tmp >/tmp/sed1.tmp
fi
if [ $converter = "pod2text" ] ; then
sed -e "s/^/$converter /g" \
-e "s^\(/.*\)^\1 >\1^g" \
-e "s^>/.*/\([^\.]*\).*$^>\1.$ext^g" </tmp/eg1.tmp >/tmp/sed1.tmp
fi
# Run the script that we've constructed.
sh /tmp/sed1.tmp
#
# Now we're done. Clean up after ourselves.
#
rm /tmp/find.tmp /tmp/eg1.tmp /tmp/sed1.tmp
# End of makepods script
....................................................................
Because the shell script searches entire directory hierarchies, it may
take a while to run.
If you're the system administrator, the shell script can be made part
of a cron job to be run weekly, monthly, or at some other interval,
and inform you by e-mail of any errors that occurred. If the makepods
script is in /usr/local/sbin/, for example, and you want the formatted
documentation to be saved in a subdirectory of /usr/local/doc/, then
the following shell script can be called by cron if you save it (on
this system) in /etc/cron.d/Weekly/:
#!/bin/sh
cd /usr/local/doc/perl/formatted-pods
/usr/local/sbin/makepods 2>/tmp/mpds.err
mail -s 'Error output of makepod ' root </tmp/mpds.err
rm -f /tmp/mpds.err
Remember to run chmod +x to make this shell script executable as well.
This is an example only; it is not the only way that cron jobs can be
configured. Please consult your local documentation, YMMV (your
mileage may vary), the author assumes no responsibility for its use,
misuse, or abuse, etc.
8.12 How do I configure Emacs to start with my default settings?
Create a file in your home directory named .emacs with the Emacs Lisp
commands that you want to run every time Emacs starts up. You won't
see the file in the directory listing (the leading '.' tells ls not to
display it, unless you use the -a command line switch with ls.
Any kind of Emacs Lisp statement will work in tne .emacs file,
including entire defuns. For example, to enable word wrapping whenever
you edit a file that ends with .txt, add the following statement:
(setq auto-mode-alist
(cons
'("\\.txt$" . (auto-fill-mode 1))
auto-mode-alist))
This adds a statement that associates the extension .txt. with the
built-in function auto-fill-mode to the beginning of auto-mode-alist.
Emacs uses lisp variables and statements extensively.
If you want to turn off the menu bar at the top of each Emacs frame,
add this statement:
(menu-bar-mode -1)
And if you want to include an Emacs Lisp program that someone has
written, like msb.el (an enhanced, pop-up buffer menu), make sure the
lisp file is in a directory where Emacs can find it (usually it will
be named Site-lisp, and add these statements in the .emacs file:
(require 'msb)
(msb-mode 1)
Most tasks have several possible solutions in Emacs Lisp. Any task
that can be programmed in Emacs Lisp is valid in the .emacs file. For
more information, consult the Texinfo documentation. (Type ESC-x info
or F1 i. ) There is also a FAQ list for Emacs (refer to What
other FAQ's are there for Linux? ).
8.13 How do I make a bootable floppy?
Make a file system on it with bin, etc, lib and dev
directories--everything 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.
8.14 How do I remap my keyboard to UK, French, etc.?
For recent kernels, get /pub/Linux/system/Keyboards/kbd-0.90.tar.gz
from metalab.unc.edu. Make sure you get the appropriate version; you
have to use the right keyboard mapping package for your kernel
version.
For older kernels you have to edit the top-level kernel Makefile, in
/usr/src/linux.
You may find more helpful information in The Linux Keyboard and
Console HOWTO, by Andries Brouwer, at
metalab.unc.edu/pub/Linux/docs/HOWTO.
8.15 How do I get NUM LOCK to default to on?
Use the setleds program, for example (in /etc/rc.local or one of the
/etc/rc.d/* files):
for t in 1 2 3 4 5 6 7 8
do
setleds +num < /dev/tty$t > /dev/null
done
Setleds is part of the kbd package ("How do I remap my keyboard
to UK, French, etc.? ").
Alternatively, patch your kernel. You need to arrange for KBD_DEFLEDS
to be defined to (1 << VC_NUMLOCK) when compiling
drivers/char/keyboard.c.
8.16 How do I set (or reset) my initial terminal colors?
The following shell script should work for VGA consoles:
for n in 1 2 4 5 6 7 8; do
setterm -fore yellow -bold on -back blue -store > /dev/tty$n
done
Substitute your favorite colors, and use /dev/ttyS$n for serial
terminals.
To make sure they are reset when people log out (if they've been
changed):
Replace the references to "getty" (or "mingetty" or "uugetty" or
whatever) in /etc/inittab with references to "/sbin/mygetty."
#!/bin/sh
setterm -fore yellow -bold on -back blue -store > $1
exec /sbin/mingetty $@
[Jim Dennis]
8.17 How can I have more than 128Mb of swap?
Use several swap partitions or swap files--Linux supports up to 16
swap areas, each of up to 128Mb.
Very old kernels only supported swap partition sizes up to 16Mb.
Linux on machines with 8KB paging, like Alpha and Sparc64, support a
swap partition up to 512MB. The 128MB limitation comes from
PAGE_SIZE*BITSPERBYTE on machines with 4KB paging, but is 512KB on
machines with 8KB paging. The limit is due to the use of a single page
allocation map.
The file mm/swapfile.c has all of the gory details.
[Peter Moulder, Gordon Weast]
contents
9. Miscellaneous information and questions answered.
9.1 How do I program XYZ under Linux?
Read the manuals, or a good book on Unix. Manual pages (type "man
man") are usually a good source of reference information on exactly
how to use a particular command or function.
There is also a lot of GNU Info documentation, which is often more
useful as a tutorial. Run Emacs and type C-h i, or type info info if
you don't have or don't like Emacs. Note that the Emacs libc node may
not exactly describe the latest Linux libc, or GNU glibc2. But the GNU
project and LDP are always looking for volunteers to upgrade their
library documentation.
Anyway, between the existing Texinfo documentation, and the manual
pages in sections 2 and 3, should provide enough information to get
started.
As with all free software, the best tutorial is the source code
itself.
The latest release of the Linux manual pages, a collection of useful
GNU Info documentation, and various other information related to
programming Linux, can be found on metalab.unc.edu in
/pub/Linux/docs/man-pages.
9.2 What's all this about ELF?
See the ELF HOWTO by Daniel Barlow--note, 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 tsx-11.mit.edu in /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.
9.3 What is a .gz file ? And a .tgz ? And .bz2 ? And ... ?
.gz (and .z) files are compressed using GNU gzip. You need to use
gunzip (which is a symlink to the gzip command which comes with most
Linux installations) to unpack the file.
.taz, .tar.Z, and .tz are tar files (made with tar) compressed using
compress.
.tgz (or .tpz) is a tar file compressed with gzip.
.bz2 is a file compressed by the more recently introduced (and
efficient) bzip2.
.lsm is a Linux Software Map entry, in the form of a short text file.
Details about the LSM and the LSM itself are available in the docs
subdirectory on metalab.unc.edu.
.deb is a Debian Binary Package - the binary package format used by
the Debian GNU/Linux distribution. It is manipulated using dpkg and
dpkg-deb (available on Debian systems and from ftp.debian.org).
.rpm is a Red Hat RPM package, which is used in the Red Hat
distribution. They can be found on ftp.redhat.com.
.bz2 is a file compressed by the more recent bzip program.
The "file" command can often tell you what a file is.
If you find that gzip complains when you try to uncompress a gzip'ed
file you probably downloaded it in ASCII mode by mistake. You must
download most things in binary mode--remember to type binary as a
command in FTP before using, "get," to get the file.
9.4 What does VFS stand for?
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
9.5 What is devfs and what does it do?
The devfs implements a new way of naming block devices (disks) in late
2.1.x and 2.2.x kernels. Instead of limiting device names to the block
device files in the /dev directory, devfs allows block devices to be
named and accessed by virtual names, by non-root users, and from more
than one mount point.
The devfs home page and FAQ are located at
http://www.atnf.csiro.au/~rgooch/linux/kernel-patches.html.
9.6 What is a BogoMip?
"BogoMips" is a contraction of "Bogus MIPS." MIPS stands for
(depending who you listen to) 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:
System 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 "When I add more memory, the system slows to a
crawl. .")
For values people have seen with other, rarer, chips, or to calculate
your own BogoMips rating, please refer to the BogoMips Mini-HOWTO, on
metalab.unc.edu. ("Where can I get the HOWTO's and other
documentation? ."
[Wim van Dorst]
9.7 What online/free periodicals exist for Linux?
There are a number of recent additions to the list of periodicals
devoted to Linux and free software:
* geek news. http://geeknews.cjb.net/. Headlines for articles
about Linux, like the comp.os.linux.announce and Techweb postings,
and general interest, like Associated Press stories.
* Linux Gazette. http://www.linuxgazette.com. This is the
longest-running of the on-line periodicals, and the only one that
publishes source code.
* Linux Today. http://www.linuxtoday.com. I like them. They
published an essay of mine. News and opinion releated to the Linux
community, updated daily.
* Linux Weekly News. http://www.lwn.net. News about the Linux
community, updated weekly.
* Slashdot. http://www.slashdot.org. News about the free
software community and culture.
* Freshmeat. http://www.freshmeat.net. Notices of new and
updated software for Linux and other free OS's.
[Jim Dennis, Robert Kiesling]
9.8 How many people use Linux?
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 news groups are
some of the most heavily read on Usenet. Accurate numbers are hard to
come by, but the number is likely in the millions.
However, people can register as Linux users at the Linux Counter
project, which has been in existence since 1993. In August, 1998, the
project counted more than 70,000 users.
Visit the Web site at http://counter.li.org and fill in the
registration form. If you don't want to use the Web, send e-mail to
[EMAIL PROTECTED] with the subject line, "I use LInux at home,"
or "I use LInux at work."
The current count is posted monthly to comp.os.linux.misc, and is
always available from the Web site.
[Harald Tveit Alvestrand]
9.9 How many people use Linux? (Redux.)
International Data Corporation recently 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 [EMAIL PROTECTED] Their Web site
is http://www.itresearch.com.
9.10 How should I pronounce Linux?
This is a matter of religious debate, of course!
If you want to hear Linus himself say how he pronounces it, download
english.au or swedish.au from ftp.funet.fi (in
/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).
9.11 Where is the Linux food page?
It's at http://members.xoom.com/gnulix_guy/geek-gourmet. It
contains recipes for dishes like Fusili Chicken Marinara, Speedy
Guacamole, and Idiot-proof pilaf, as well as hints for cooking things
in a hurry. No recipes yet for penguin, though.
9.12 Where can I find out about free software projects?
The Free Software Bazaar lists current openings to do work on free
software projects, and tells how to sponsore free software projects
and how to make money writing free software. Its URL is
http://www.csustan.edu/bazaar/.
contents
10. Frequently encountered error messages.
10.1 Modprobe can't locate module, "XXX," and similar messages.
These types of messages mostly occur at boot time or shutdown. If
modprobe, insmod, or rmmod complain about not being able to find a
module, add the following to the /etc/modules.conf or
/etc/modutils/aliases file, whichever is present on your system.
alias <module-name> off
And use the name of the module that appears in the error message.
[J.H.M. Dassen]
10.2 Unknown terminal type linux and similar.
In early kernels the default console terminal type has changed from
"console" to "linux." You must edit /etc/termcap to change the
line reading:
console|con80x25:\
to
linux|console|con80x25:\
(there may be an additional dumb in there--if so it should be
removed.)
To get the editor to work you may need say
TERM=console
(for bash and ksh), or
setenv TERM console
for csh or tcsh.
Some programs use /usr/lib/terminfo instead of /etc/termcap. For these
programs you should upgrade your terminfo, which is part of ncurses.
10.3 lp1 on fire
This is a joke/traditional error message indicating that some sort of
error is being reported by your printer, but that the error status
isn't a valid one. It may be that you have some kind of I/O or IRQ
conflict-- check your cards' settings. Some people report that they
get this message when their printer is switched off. Hopefully it
isn't really on fire ...
In newer kernels, this message reads, "lp1 reported invalid error
status (on fire, eh?)"
10.4 INET: Warning: old style ioctl... called!
You are trying to use the old network configuration utilities. The new
ones can be found on ftp.linux.org.uk in
/pub/linux/Networking/PROGRAMS/NetTools/ (source only, I'm afraid).
Note that they cannot be used just like the old-style programs. See
the NET-2 HOWTO for instructions on how to set up the old-style
networking programs correctly. Even better, see the NET-3 HOWTO and
upgrade your networking software.
10.5 ld: unrecognized option '-m486'
You have an old version of ld. Install a newer binutils package--this
will contain an updated ld. Look on tsx-11.mit.edu in
/pub/linux/packages/GCC/ for binutils-2.6.0.2.bin.tar.gz.
10.6 GCC says Internal compiler error.
If the fault is repeatable (i.e., it always happens at the same place
in the same file--even after rebooting and trying again, using a
stable kernel) you have discovered a bug in GCC. See the GCC Info
documentation (type Control-h i in Emacs, and select GCC from the
menu) for details on how to report the error--make sure you have the
latest version, though.
Note that this is probably not a Linux-specific problem. Unless you
are compiling a program many other Linux users also compile, you
should not post your bug report to any of the comp.os.linux groups.
If the problem is not repeatable, you may be experiencing memory
corruption--see make says Error 139 .
10.7 make says Error 139
Your compiler driver (gcc) dumped core. You probably have a corrupted,
buggy, or old version of GCC--get the latest release. Alternatively,
you may be running out of swap space--see My machine runs very
slowly when I run GCC / X / ... .
If this doesn't fix the problem, you are probably having problems with
memory or disk corruption. Check that the clock rate, wait states, and
refresh timing for your SIMMS and cache are correct (hardware manuals
are sometimes wrong, too). If so, you may have some marginal SIMMS, or
a faulty motherboard or hard disk or controller.
Linux is a very good memory tester--much better than MS-DOS based
memory test programs.
--
<a href="coffee://localhost/cream/">stop</a> http://www.mainmatter.com/
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.misc) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Misc Digest
******************************