From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1103af,4c9efbf0fcdb7981,start X-Google-Attributes: gid1103af,public X-Google-Thread: 10d4db,4c9efbf0fcdb7981,start X-Google-Attributes: gid10d4db,public X-Google-Thread: 100062,4c9efbf0fcdb7981,start X-Google-Attributes: gid100062,public X-Google-Thread: f7ded,4c9efbf0fcdb7981,start X-Google-Attributes: gidf7ded,public From: kiesling@terracom.net Subject: Linux Frequently Asked Questions with Answers (Part 2 of 3) Date: 1998/05/19 Message-ID: <6jqo37$589$1@news12.ispnews.com> X-Deja-AN: 354484915 Followup-To: poster NNTP-Posting-Date: 19 May 1998 01:43:03 GMT Originator: kiesling@ X-Trace: news12.ispnews.com 895542183 5385 209.69.148.254 (19 May 1998 01:43:03 GMT) Organization: ISPNews http://ispnews.com Newsgroups: comp.os.linux.announce,comp.os.linux.misc,news.answers,comp.answers Archive-Name: linux/faq/part2 Posting-Frequency: monthly `wastebasket' directory. The files can be recovered until cleaned out automatically by background processing. Alternatively, you can search the raw disk device which holds the filesystem in question. This is hard work, and you will need to be root to do this. ---------------------------------------------------------------------- 4.3 Is there a defragmenter for ext2fs etc.? Yes. There is defrag, a Linux filesystem defragmenter for ext2, minix and old-style ext filesystems. It is available at sunsite.unc.edu/pub/Linux/system/filesystems/defrag-0.70.tar.gz. Users of the ext2 filesystem can probably do without defrag, because ext2 contains extra code to keep fragmentation reduced even in very full filesystems. ---------------------------------------------------------------------- 4.4 How do I format and create a filesystem on a floppy? To format a 3.5-inch, high density floppy: $ fdformat /dev/fd0H1440 $ mkfs -t ext2 -m 0 /dev/fd0H1440 1440 For a 5.25 inch floppy, use fd0h1200 and 1200 as appropriate. For the `B' drive use fd1 instead of fd0. The -m 0 option tells mkfs.ext2 not to reserve any space on the disk for the superuser--usually the last 10% is reserved for root. The first command performs a low-level format. The second creates an empty filesystem. 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. (See (`` Where can I get the HOWTOs and other 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. ---------------------------------------------------------------------- 4.5 I get nasty messages about inodes, blocks, and the suchlike. You probably have a corrupted filesystem, 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 filesystem; if you're unlucky the filesystem is trashed and you'll have to reinitialise it with mkfs (or mke2fs, mkxfs, etc.) and restore from a backup. NB: don't try to check a filesystem that's mounted read-write - this includes the root partition if you don't see VFS: mounted root ... read-only at boot time. ---------------------------------------------------------------------- 4.6 My swap area isn't working. 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 manpage for details; it works much like mkfs. Check the Installation HOWTO for detailed instructions of how to set up a swap area. ---------------------------------------------------------------------- 4.7 How do I remove LILO so my system boots DOS again? Using DOS (MS-DOS 5.0 or later, or OS/2), type FDISK /MBR (which is not documented). This will restore a standard MS-DOS Master Boot Record. If you have DR-DOS 6.0, go into FDISK in the normal way and then select the `Re-write Master Boot Record' option. If you don't have DOS 5 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 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. ---------------------------------------------------------------------- 4.8 Why can't I use fdformat except as root? The system call to format a floppy may 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. ---------------------------------------------------------------------- 4.9 Is there something like Stacker or Doublespace for Linux? Currently none of the Linux filesystems can do compression in the filesystem. There is a program called Zlibc which allows existing applications to read compressed (GNU zipped) files as if they were not compressed. After installing it, you can compress files using gzip, and programs will still find them, without having to change the programs. Look on sunsite.unc.edu in /pub/Linux/libs. The author is < Alain.Knaff@imag.fr>. There is a compressing block device driver that can provide filesystem-independent, on-the-fly disk compression in the kernel. It is called `DouBle'. There is a source-only distribution on sunsite.unc.edu in /pub/Linux/kernel/patches/diskdrives; the author is Jean-Marc Verbavatz < jmv@receptor.mgh.harvard.edu>. Note that since this compresses inodes (administrative information) and directories as well as file contents any corruption is quite likely to be serious. There is also a package available called tcx (Transparently Compressed Executables) which allows you to keep infrequently used executables compressed and only uncompress them temporarily while you use them. You'll find it at sunsite.unc.edu/pub/Linux/utils/compress Note: this is not the same as gzexe, which is an inferior implementation of the same concept. ---------------------------------------------------------------------- 4.10 My ext2fs partitions are checked each time I reboot. See `` EXT2-fs: warning: mounting unchecked filesystem.''. ---------------------------------------------------------------------- 4.11 My root filesystem is read-only! Remount it. If /etc/fstab is correct, you can simply mount -n -o remount /. If /etc/fstab is wrong you must give the device name and posibly the type too: e.g. mount -n -o remount -t ext2 /dev/hda2 /. To understand how you got into this state, see `` EXT2-fs: warning: mounting unchecked filesystem.'' ---------------------------------------------------------------------- 4.12 I have a huge /proc/kcore! Can I delete it? None of the files in /proc are really there - they'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 ask to read it as a file the kernel does memory reads. ---------------------------------------------------------------------- 4.13 My AHA1542C doesn't work with Linux. The option to allow disks with more than 1024 cylinders is only required as a workaround for a DOS 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. ====================================================================== 5. Porting, compiling and obtaining programs ---------------------------------------------------------------------- 5.1 How do I port XXX to Linux? In general, Unix 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. ---------------------------------------------------------------------- 5.2 What is ld.so and where do I get it? 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 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. ---------------------------------------------------------------------- 5.3 Has anyone ported / compiled / written XXX for Linux? First, look in the Linux Software Map--it's at sunsite.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/. Check the FTP sites `` Where can I get Linux material by FTP?'' first--search the ls-lR or INDEX files for appropriate strings. Also look at the Linux Projects Map, ftp.ix.de/pub/ix/Linux/docs/Projects-Map.gz. If you don't find anything, you could either download the sources to the program yourself and compile them. See `` How do I port XXX to Linux?'' If it's a large package which may require some porting, post a message to comp.os.linux.development.apps. If you compile a large-ish program, please upload it to one or more of the FTP sites, and post a message to 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 verson. The comp.sources.wanted FAQ has instructions for finding the source code. ---------------------------------------------------------------------- 5.4 Can I use code or a compiler compiled for a 486 on my 386? Yes, unless it's the kernel. The -m486 option to GCC, which is used to compile binaries for x486 machines, merely changes certain optimisations. This makes for slightly larger binaries which 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 will use 486- or Pentium-specific instructions if configured for a 486 or Pentium, thus making it unusable on a 386. GCC can be configured for a 386 or 486; the only difference is that configuring it for a 386 makes -m386 the default and configuring for a 486 makes -m486 the default; in either case these can be overriden on a per-compilation basis or by editing /usr/lib/gcc-lib/i*-linux/n.n.n/specs. There is an Alpha version of GCC which knows how to do optimisation well for the 586, but it is quite unreliable, especially at high optimisation settings. The Pentium GCC can be found on tsx-11.mit.edu in /pub/linux/ALPHA/pentium-gcc. I'd recommend using the ordinary 486 GCC instead; word has it that using -m386 produces code that's better for the Pentium, or at least slightly smaller. ---------------------------------------------------------------------- 5.5 What does gcc -O6 do? Currently the same as -O2 (GCC 2.5) or -O3 (GCC 2.6, 2.7); any number greater than that currently does the same thing. The Makefiles of newer kernels use -O2, and you should probably do the same. ---------------------------------------------------------------------- 5.6 Where are linux/*.h and asm/*.h? These are in the directories /usr/include/linux and /usr/include/asm. However, they should be symbolic links to your kernel sources in /usr/src/linux, not actual directories. If you don't have the kernel sources, download them--see, ``ref id="How do I upgrade/recompile my kernel?">'' Then, use rm to remove any garbage, and ln to create the links: rm -rf /usr/include/linux /usr/include/asm ln -sf /usr/src/linux/include/linux /usr/include/linux ln -sf /usr/src/linux/include/asm /usr/include/asm /usr/src/linux/include/asm is a symbolic link to an architecture-specific asm- directory--if you have a freshly unpacked kernel source tree you must use make symlinks. You'll also find that you may need to do make config in a newly-unpacked kernel source tree, to create . ---------------------------------------------------------------------- 5.7 I get errors when I try to compile the kernel. See the previous question regarding the header files. Remember that when you apply a patch to the kernel, you must use the -p0 or -p1 option: otherwise the patch may be misapplied. See the patch manual page for details. If you're patching to a kernel more recent than 1.1.44, you should find that there are new directories /usr/src/linux/include/asm-i386. The directory asm there should be removed. The symlinks Makefile target will make these be symbolic links to asm-i386 and arch/i386/boot, respectively. The easiest way to make sure all this gets done is not to try to patch 1.1.44 to make 1.1.45, but to download linux-1.1.45.tar.gz instead. ld: unrecognised option `-qmagic' means that you should get a newer linker, from ftp://tsx-11.mit.edu/pub/linux/packages/GCC, in the file binutils-2.8.1.0.1.bin.tar.gz. ---------------------------------------------------------------------- 5.8 How do I make a shared library? For ELF, gcc -fPIC -c *.c gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 *.o For a.out, get tools-n.nn.tar.gz from tsx-11.mit.edu, in /pub/linux/packages/GCC/src. It comes with documentation that will tell you what to do. Note that a.out shared libraries are a very tricky business. Consider upgrading your libraries to ELF shared libraries. See the ELF HOWTO, at sunsite.unc.edu/pub/Linux/docs/HOWTO/ ---------------------------------------------------------------------- 5.9 My executables are (very) large. With an ELF compiler (see Q8.2 `What's all this about ELF ?') the most common cause of large executables is the lack of an appropriate .so library link for one of the libraries you're using. There should be a link like libc.so for every library like libc.so.5.2.18. With an a.out compiler (see, `` What's all this about ELF?'') the most common cause of large executables is the -g linker (compiler) flag. This produces (as well as debugging information in the output file) a program which is statically linked, i.e. one which includes a copy of the C library instead of using a dynamically linked copy. Other things worth investigating are -O and -O2 which enable optimisation (check the GCC documentation) and -s (or the strip command) which strip the symbol information from the resulting binary (making debugging totally impossible). You may wish to use -N on very small executables (less than 8K with the -N), but you shouldn't do this unless you understand its performance implications, and definitely never with daemons. ---------------------------------------------------------------------- 5.10 Does Linux support threads or lightweight processes? 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, most of which are generic packages for any Unix: * In sipb.mit.edu:/pub/pthread or 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 libcs contain the pthreads source; the GNU Ada compiler on sunsite.unc.edu in /pub/Linux/devel/lang/ada/gnat-3.01-linux+elf.tar.gz contains binaries made from that source code. * In 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 as /tr/1993/05/UW-CSE-93-05-06.PS.Z. * In gummo.doc.ic.ac.uk:/rex is lwp, a very minimal implementation. * In 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. Kernel version 1.3.35 contains some support for kernel threads, but this code has not been well-tested. ---------------------------------------------------------------------- 5.11 Where can I get `lint' for Linux? Roughly equivalent functionality is built into the GNU C compiler (gcc) which is used by Linux systems. Use the -Wall option to turn on most of the useful extra warnings. Check the GCC manual for more details (type control-h followed by 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 on larch.lcs.mit.edu in /pub/Larch/lclint; on the World Wide Web look at http://larch-www.lcs.mit.edu:8001/larch/lclint.html. ---------------------------------------------------------------------- 5.12 Where can I find `kermit' for Linux? Kermit is distributed under a non-GPL copyright that makes its terms of distribution somewhat different. The sources and some binaries are available on kermit.columbia.edu as kermit/archives/ckermit-6.0.192-7.i386.rpm # RedHat kermit/archives/ckermit-6.0.192-7.sparc.rpm kermit/archives/ckermit-6.0.192-7.alpha.rpm kermit/archives/ckermit-6.0.192-7.src.rpm kermit/archives/cku192.debian.tar # Debian kermit/archives/cku192.slackware-i386.tgz # Slackware Other Linux binaries are available in kermit/bin/ckuker.linux-2.0-alpha kermit/bin/ckuker.linux-2.0.27-sparc kermit/bin/ckuker.linux-2.0.28-mklinux-mach3.0-ppc kermit/bin/ckuker.linux-1.2.13-i386-elf kermit/bin/ckuker.linux-2.1.13-i386-elf The files /kermit/READ.ME and /kermit/c-kermit/READ.ME have further details. The WWW Home Page of the Columbia University Kermit project is http://www.columbia.edu/kermit ====================================================================== 6. Solutions to common miscellaneous problems. ---------------------------------------------------------------------- 6.1 free dumps core. 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 sunsite.unc.edu in /pub/Linux/system/Status/ps/procps-0.99.tgz. ---------------------------------------------------------------------- 6.2 My clock is very wrong. There are two clocks in your computer. The hardware (CMOS) clock runs even when the computer is off and is used to when the system starts up and by DOS (if you use it). 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 program - see man 8 clock. There are various other programs that can correct either or both clocks for systematic drift or transfer time across the network. Some of them may already be installed on your system. Try looking at or for adjtimex (corrects for drift), netdate and getdate (simply get the time from the network) or xntp (accurate fully-featured network time daemon). ---------------------------------------------------------------------- 6.3 Setuid scripts don't seem to work. That's right. This feature has been deliberately disabled in the Linux kernel because setuid scripts are almost always a security hole. If you want to know why read the FAQ for comp.unix.questions. ---------------------------------------------------------------------- 6.4 Free memory as reported by free keeps shrinking. The `free' figure printed by free doesn't include memory used as a disk buffer cache - shown 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 and the contents get cached. It will stabilise after a while. ---------------------------------------------------------------------- 6.5 When I add more memory it slows to a crawl. This is quite 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 RAMs have to be in certain sockets to be cached. Sometimes you have to set jumpers to enable the caching. Some motherboards don't cache all the RAM if you have more RAM per amount of cache than they expect. Usually a full 256K cache will solve this problem. If in doubt, check your motherboard manual. If you still can't fix it because the documentation is inadequate you might like to post a message to comp.os.linux.hardware giving *all* the details - make, model number, date code, etc. so that other Linux users can avoid it. ---------------------------------------------------------------------- 6.6 Some programs (e.g. xdm) won't let me log in. You are probably using non-shadow-password programs but are using shadow passwords. If so, you have to get or compile a shadow password version of the program(s) in question. The shadow password suite can be found in (amongst other places): tsx-11.mit.edu:/pub/linux/sources/usr.bin/shadow-* This is the source code; you will probably find the binaries in .../linux/binaries/usr.bin. ---------------------------------------------------------------------- 6.7 Some programs let me log in with no password. You probably have the same problem as in '' Some programs (e.g. xdm) won't let me log in.'', with an added wrinkle: If you are using shadow passords 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. ---------------------------------------------------------------------- 6.8 My machine runs very slowly when I run GCC / X / ... You may not have any swap enabled. You need to enable swapping to allow Linux to page out bits of data programs aren't using at the moment to disk to make more room for other programs and data. If you don't Linux has to keep data in memory and throw away in-memory copies of programs (which are paged straight from the filesystem) and so less and less program is in memory and everything runs very slowly. See the Installation HOWTO and the Installation and Getting Started Guide (See '' Where can I get the HOWTOs and other documentation?'') for details of how to set up a swap partition or swapfile; see also `` My swap area isn't working.''. Alternatively, you may have too little real memory. If you have less RAM than all the programs you're running at once, Linux will use your hard disk instead and thrash horribly. The solution in this case is to not run so many things at once or to buy more memory. You can also reclaim some memory by compiling and using a kernel with less options configured. See `` How do I upgrade/recompile my kernel?''. You can tell how much memory and/or swap you're using by using the free command, or by typing cat /proc/meminfo If your kernel is configured with a ramdisk this is probably wasted space and will cause things to go slowly. Use LILO or rdev to tell the kernel not to allocate a ramdisk (see the LILO documentation or type man rdev). ---------------------------------------------------------------------- 6.9 I can only log in as root. You probably have some permission problems, or you have a file /etc/nologin. If the latter, put rm -f /etc/nologin in your /etc/rc.local or /etc/rc.d/* scripts. Otherwise, check the permissions on your shell, and any filenames which appear in error messages, and also the directories containing these files all the way up the tree, up to and including the root directory. ---------------------------------------------------------------------- 6.10 My screen is all full of weird characters instead of letters. You probably sent some binary data to your screen by mistake. Type echo '\033c' to fix it. Many Linux distributions have a command reset that does this. ---------------------------------------------------------------------- 6.11 I have screwed up my system and can't log in to fix it. Reboot from an emergency floppy or floppy pair, for example the Slackware boot- and root-disk pair (in the install subdirectory of the Slackware mirrors) or the MCC installation boot floppy. There are also two do-it-yourself rescue disk creation packages in sunsite.unc.edu/pub/Linux/system/Recovery. These are better because as they have your own kernel on them, so that you don't run the risk of missing devices, filesystems, and so forth. Get to a shell prompt and mount your hard disk with something like > mount -t ext2 /dev/hda1 /mnt Then your filesystem is available under the directory /mnt and you can fix the problem. Remember to unmount your hard disk before rebooting (cd back down to / first, or it will say it's busy). ---------------------------------------------------------------------- 6.12 I've discovered a huge security hole in rm! No you haven't. You are obviously new to Unix and need to read a good book on it to find out how things work. Clue: ability to delete files under Unix depends on permission to write the directory they are in. ---------------------------------------------------------------------- 6.13 lpr(1) and/or lpd(8) don't work. 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 board. You should be able to dump a file directly to the printer; e.g.: $ 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. If your machine has a network-aware lpd, like the one that comes with LPRng, make sure that the lpd.perms file is configured correctly. Check also the Printing-HOWTO `` Where can I get the HOWTOs and other documentation?''. ---------------------------------------------------------------------- 6.14 Timestamps on files on msdos partitions are set incorrectly. There is a bug in the program clock(8) (often found in /sbin)--it miscounts a timezone offset, confusing seconds with minutes or some such. Get a new version of it. ---------------------------------------------------------------------- 6.15 How do I get LILO to boot the vmlinux file? In kernel versions 1.1.80 and later, the compressed kernel image, which is what LILO needs to find, has been moved to arch/i386/boot/zImage. The vmlinux file in the root directory is the uncompressed kernel, and you shouldn't try to boot it. This change has been made to make it easier to build the versions for several different processors from the same source tree. ====================================================================== 7. How do I do this or find out that ... ? ---------------------------------------------------------------------- 7.1 How can I get scrollback in text mode? With the default US keymap you can use Shift with the PageUp and PageDown keys (NB: these must be the grey ones, not the ones on the numeric keypad!). With other keymaps check the maps in /usr/lib/keytables; you can remap the ScrollUp and ScrollDown keys to be whatever you like--for example, in order to remap them to keys that exist on an 84-key AT keyboard. You can't increase the amount of scrollback, because of the way it is implemented using the video memory to store the scrollback text, though you may be able to get more scrollback in each virtual console by reducing the total number of VC's--see . ---------------------------------------------------------------------- 7.2 How do I switch virtual consoles? How do I enable them? In text mode, press Left Alt-F1 to Alt-F12 to select the consoles tty1 to tty12; Right Alt-F1 gives tty13 and so on. To switch out of X windows you must press Ctrl-Alt-F1, etc; Alt-F5 or whatever will switch back. If you want to use a VC for ordinary login you need to list it in /etc/inittab, which controls which terminals and virtual consoles have login prompts. NB: X needs at least one free VC in order to start. Kernels earlier than around 1.1.59 have a compiled-in limit on the number of consoles, for which the default is 8. See NR_CONSOLES in linux/include/linux/tty.h. Newer kernels allocate them dynamically, up to a maximum of 63. ---------------------------------------------------------------------- 7.3 How do I set the timezone? Change directory to /usr/lib/zoneinfo; get the timezone package if you don't have this directory. The source is available as sunsite.unc.edu/pub/Linux/system/admin/time/timesrc-1.2.tar.gz. Then make a symbolic link named localtime pointing to one of the files in this directory (or a subdirectory), and one called posixrules pointing to localtime. For example: ln -sf US/Mountain localtime ln -sf localtime posixrules This change will take effect immediately--try date(1). Don't try to use the TZ variable--leave it unset. You should also make sure that your Linux kernel clock is set to the correct GMT time--type date -u and check that the correct universal time is displayed. ---------------------------------------------------------------------- 7.4 What version of Linux and what machine name am I using? Type: uname -a ---------------------------------------------------------------------- 7.5 How can I enable or disable core dumps? Linux now has corefiles turned off by default for all processes. You can turn them on or off by using the ulimit(1) command in bash(1), the limit command in tcsh(1), or the rlimit command in ksh(1). See the appropriate manual page for details. This setting affects all programs run from that shell (directly or indirectly), not the whole system. If you wish to enable or disable coredumping for all processes by default, you can change the default setting in --see the definition of INIT_TASK, and look also in . Version 1.2.13 of the kernel will produce a.out core dumps `` What's all this about ELF?''. ---------------------------------------------------------------------- 7.6 How do I upgrade/recompile my kernel? See the Kernel HOWTO or the README which comes with the kernel release on ftp.cs.helsinki.fi, in /pub/Software/Linux/Kernel and mirrors thereof (Q2.5 `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 you got it as 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.) Remember that to make the new kernel boot you must run LILO after copying the kernel into your root partition--the Makefile in recent kernels has a special zlilo target for this; try make zlilo. 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 Q2.8 `What mailing lists are there ?'. ---------------------------------------------------------------------- 7.7 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 to and workarounds for this problem. ---------------------------------------------------------------------- 7.8 How do I make a bootable floppy? Make a filesystem 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 ramdisk the same size as the floppy the ramdisk will be loaded at boot-time and mounted as root in place of the floppy. See the Bootdisk HOWTO. ---------------------------------------------------------------------- 7.9 How do I remap my keyboard to UK, French, etc.? For recent kernels, get /pub/Linux/system/Keyboards/kbd-0.90.tar.gz from sunsite.unc.edu. Make sure you get the appropriate version; you have to use the right keyboard-mapping package to go with your kernel version. 0.90 should work with kernel versions from 1.0. 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 keystroke and console HOWTO, by Andries Brouwer, at sunsite.unc.edu/pub/Linux/docs/HOWTO ---------------------------------------------------------------------- 7.10 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 (see Q7.9 `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 ---------------------------------------------------------------------- 7.11 How can I have more than 128Mb of swap? Use several swap partitions or swapfiles--Linux supports up to 16 swap areas, each of up to 128Mb. Very old kernels only supported swap area sizes up to 16Mb. ====================================================================== 7.12 Miscellaneous information and questions answered. ---------------------------------------------------------------------- 7.13 How do I program XYZ under Linux? Read the manuals, or a good book on Unix. manpages (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 doesn't exactly describe the Linux libc (which is more like a traditional Unix libc, not having some of the GNU oddities), but it's close enough to make a fair tutorial in Unix C programming. The latest release of the Linux manpages and a collection of useful GNU Info documentation various other information related to programming Linux can be found on sunsite.unc.edu in /pub/Linux/docs/man-pages. ---------------------------------------------------------------------- 7.14 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'). This will have many 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 will have to be installed to do this. If you want to find out whether your system can run ELF binaries, look in /lib for a filename libc.so.5. If this exists it probably can. 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 coredumps, on 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 a patch at all. ---------------------------------------------------------------------- 7.15 What is a .gz file ? And a .tgz ? And ... ? .gz (and .z) files have been compressed using GNU gzip. You need to use gunzip (which is as a symlink to the gzip command which comes with most Linux installations) to unpack the file. .taz and .tz are tarfiles (made with Unix tar) compressed using standard Unix compress. .tgz (or .tpz) is a tarfile compressed with gzip. .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 sunsite.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. These can be found on ftp.redhat.com. The file command can often tell you what a file is. If you find that gzip complains when you try to uncompress a gzipped 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. ---------------------------------------------------------------------- 7.16 What does VFS stand for? Virtual File System. It's the abstraction layer between the user and real filesystems like ext2, minix and msdos. Amongst 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 ---------------------------------------------------------------------- 7.17 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. As a very rough guide the BogoMips will be approximately: 386SX clock * 0.14 386DX clock * 0.18 486Cyrix/IBM clock * 0.33 486SX/DX/DX2 clock * 0.50 586 clock * 0.39 If the number you're seeing is wildly lower than this you may have the Turbo button or CPU speed set incorrectly, or have some kind of caching problem (as described in Q6.5 `When I add more memory it slows to a crawl.'.) For values people have seen with other, rarer, chips, see the BogoMips Mini-HOWTO, on sunsite.unc.edu in /pub/Linux/docs/howto/mini/BogoMips. ---------------------------------------------------------------------- 7.18 What is the Linux Journal and where can I get it? Linux Journal is a monthly magazine (printed on paper) that is available on newsstands and via subscription worldwide. Email < linux@ssc.com> for details. Their URL is http://www.ssc.com/. ---------------------------------------------------------------------- 7.19 How many people use Linux?