Archive-name: linux-faq/part2 Last-Modified: 93/06/11 Version: 1.19 ********************************************************* * * * Answers to Frequently asked questions about Linux * * * ********************************************************* This post contains Part 2 of the Linux FAQ (6 parts). It must be read *after* the first part. ================================8<=====8<============================== CONTENTS (of this part) III. INSTALLATION, and COMMON PROBLEMS (part2) IV. SOME CLASSICAL PROBLEMS (part2) V. LINUX and DOS (part2) ===================================8<====>8============================ III. INSTALLATION, SETUP, and COMMON PROBLEMS ============================================= *** Note: this FAQ section should be the most 'reliable' source for *** installation info. Please mail any corrections or changes to this *** section's coordinator, Matt Welsh (mdw@tc.cornell.edu). *** Last update April 93. III.A. WHERE TO START: What are the reliable sources of information III.B. LINUX PACKAGES: Where and how install a complete Linux package III.C. SOME COMMON PROBLEMS: Simple problems and simple solutions III.A. WHERE TO START ~~~~~~~~~~~~~~~~~~~~~ III.01) I want to install Linux on my machine. Where do I start? ANSWER: The first thing you should do is read through the various introductory files, and ESPECIALLY the FAQ (this file). Especially this section :). A lot of effort has been done on these intro files, but note that some of them conflict with each other and cover older versions of Linux. When in doubt consult this file. These files are all found on tsx-11.mit.edu:/pub/linux/docs... FAQ The Linux Frequently Asked Questions list It's sitting in your hands now. This section is probably the best place to start to get the most up-to-date Linux installation information. INFO-SHEET Linux Information Sheet, by J. Winstead/L. Wirzenius/M. Welsh/M. Johnson This is a collection of general info about Linux. It's a good place to start if you've never heard of the package before. README.kernel Kernel compilation README file, by L. Wirzenius This is the README notes for recompiling the Linux kernel from the sources. You don't need it unless you're planning to upgrade your kernel by compiling it yourself. Others Every "release" of Linux (such as SLS, boot/root, HLU's disks, etc., see below) has its own up-to-date README files and docs that explain how to install that release. This FAQ section summarizes, but for more info on how to install Linux, read the READMEs and docs for the release that you choose. Old docs There are a number of obsolete, old docs lying around. Most of these tell how to install Linux from the old boot/root disk combo. I DO NOT SUGGEST that you use these docs unless you know what you're doing-- the best thing for beginners to do is read this FAQ and install the SLS release (using the docs and READMEs for the SLS release). These old docs are things like "install.txt", "guide.txt", "RELNOTES", "CHANGES", and so on, and are all geared towards old versions of the boot/rootdisk. They are *NOT* relevant to current versions of Linux. III.02) Is there some kind of limit on how large my Linux partitions and/or filesystems can be? ANSWER: There's no limit on partition size (just the size of your drive), or filesystem size. The Minix filesystem type has a limit of 64 megs per filesystem. However, most folks use the Extended 2 filesystem or the Xia filesystem, which have limits of 4 terabytes per partition (virtually infinite). See section III.C below on creating partitions and filesystems for more info. III.B. LINUX PACKAGES ~~~~~~~~~~~~~~~~~~~~~ This section contains information about *SOME* of the current Linux packages available. III.03) Does there exist a way to get all (or nearly all) of the Linux stuff? ANSWER: Yes. To install Linux, you're going to want to choose one of the "releases" of Linux, all of which have a different method of installation and set up. Each release also has its own README and installation docs, which you'll want to read first. But I'll summarize here. The major releases are: * The "Softlanding Linux System Release" Also known as the "SLS" release, consists of about 23 disks for Linux and 9 for X11. The nice thing about this release is that you can pick and choose which disks and packages you want to install. The first disk ("a1") must be "rawritten" (using rawrite.exe) on floppies, and the rest of the images are put onto DOS format floppies using the DOS "copy" command. Contains all of the softs you'll ever need, and is easy to install for newcomers. This is the release that I suggest everyone new to Linux should install. It's the most complete and up-to-date package. HLU's disks, below, are good for upgrading, and (unfortunately), the MCC-interim is quite dated at this point. If you install SLS you'll save yourself a lot of trouble. * The "TAMU" (Texas A&M University) Linux Release This release is supposedly like the SLS release, but has some different softs and a different installation procedure. From Dave Safford, "The installation procedure is the main difference from SLS. A single boot diskette is used, and it boots directly into an automated installation program." This installation program asks a few questions about the desired configuration, and sets up everything, including your filesystems, booting from the hard drive with LILO (see section III.C below), and a simplified X-Windows configuration. This humble author has never installed the TAMU release but I've heard good things about it. * H.J. Lu's "bootable rootdisk" This is a release of the Linux kernel and basic binaries on a single floppy. It, along with HLU's 'gccdisk', 'libdisk', and so on, are good for upgrading or installing basic Linux system by hand. It's not reccommended for newcomers, because there's no real install script, it's mostly meant as an upgrade of the basic system software. Beginners should install SLS or MCC-interim (see below) instead. * The Manchester Computing Centre Interim Release This is the fabled "MCC-Interim" Linux release, which was originally the de facto standard Linux distribution. After 0.97.2, it was dropped in favor of SLS, but as of 0.99.8 a new MCC-Interim has been released. Like SLS and TAMU, it has an easy-to-install, complete set of Linux software, including networking and X11. * Others but OUTDATED There are other releases and distributions of the Linux software, "MJ" release. There is also an older "boot/root" disk combo (0.98.1) which is like HLU's bootable rootdisk, above, but it's no longer supported (as far as I know). The "MJ" release, according to Martin Junius, is no longer maintained. The last version was 0.97.1. III.04) Where can I get these releases of Linux? ANSWER: The SLS release is at tsx-11.mit.edu:/pub/linux/packages/SLS and sunsite.unc.edu:/pub/Linux/SLS. H.J. Lu's "bootable rootdisk" release is found at tsx-11.mit.edu: /pub/linux/packages/GCC, as well as the mirror sites. TAMU.99p4 is available from sc.tamu.edu in pub/free_unix/TAMU.99p4. III.05) What files do I need to get for the SLS release? ANSWER: Basically all of the releases are alike. You need to get the DOS program 'rawrite.exe' (or 'rawrite2.exe'). This program takes a binary file and writes it, block by block, to a blank formatted floppy. This is the way to take a Linux floppy image and put it onto a disk from DOS. Rawrite can be found in tsx-11.mit.edu:/pub/linux/dos_utils. For the SLS release, you need to get the files: * SLS.README and SLS.FAQ. These files contain further information on the current release of SLS. You should read them in addition to this FAQ. * a1.3 or a1.5, depending on what type of floppy you boot from on your system. a1.3 is for high-density 3.5" floppies, and a1.5 for high-density 5.25" floppies. This file is the image of the SLS "a1" disk. You must use rawrite.exe (above) to rawrite the file to a high-density *formatted* MS-DOS floppy. (Once the file is rawritten, the floppy will no longer be recognized by DOS). * The files in the a2, a3, and a4 directories. These files must be copied to MS-DOS formatted floppies (using the MS-DOS 'copy' command). For example, the files in the a2 directory are copied to a floppy labeled 'a2', and so on. These files make up the "a" disk set. They are required. The rest of the files below are optional. * The files under the directories b1-bN, c1-cN, x1-xN, t1-tN, and so on. These files are copied to MS-DOS floppies just like a2-a4 above. (e.g. the files in the b2 directory are copied to a floppy labeled 'b2'). These floppies contain optional software for SLS: b1-bN: base system extras, such as emacs and man pages c1-cN: compilers such as gcc, g++, f2c, etc. x1-xN: the X Windows system i1-iN: Interviews (doc and idraw) t1-tN: TeX, LaTex, etc. (document processing system) s1-sN: sources for some of these utilities I suggest getting at least the a, b, and c disk series. If you want to run Xwindows, get the x series as well. When you're making these floppies, a2-a4 and so on must all be the same kind of floppy (i.e. either 3.5" or 5.25"). The a1 disk must be the floppy type that you boot from. The rest of the disks don't have to be the same type as the a1 disk. III.06) Now that I have the files, how do I install SLS? ANSWER: Before installing SLS you may need to resize your partitions for MS-DOS, etc. to make space for Linux on your hard drive. For this you generally use MS-DOS's "fdisk" and resize your partitions by first deleting them and then re-creating them with smaller sizes. Note that this procedure deletes everything on the affected partitions: you'll need to make backups first and restore from them later. See section III.C for more info on this. To install the system: First boot the a1 disk. You should see the prompt "LILO". Press or to get a list of instructions: at this point you'll be able to choose how you want to boot the a1 disk (i.e. choose the option "floppy" to boot without the ramdisk enabled, "ramdisk" to boot normally, and so on). If you just press you'll boot with the ramdisk enabled (recommended, but may not be possible for systems with less than 4 megs of RAM). Once the system boots up login as "root" (no password). You can now use 'fdisk' to create partitions for Linux, and reboot (from the a1 disk again). Again, login as "root" and use 'mke2fs', 'mkswap', and so on to create filesystems and swap space. See section III.C below for information on making partitions and filesystems. To install the software, use the command doinstall where is the location of your root filesystem that you just created. For example, if your Linux root filesystem is on /dev/hda2, use the command doinstall /dev/hda2 If you have more than one Linux filesystem (for example, a filesystem on /dev/hda3 for /usr), then use something like doinstall /dev/hda2 /dev/hda3 /usr Those with previous UNIX experience will know what this means. See section III.C below. Next, the system will ask how you want to install the system (from floppy, hard disk, tape, CD-ROM, or over the network). If you're installing from floppy, choose "floppy". (For info on installing from the hard drive, etc. see the file SLS.FAQ). For floppy installations you'll also be asked what drive to install from and how much software you're going to install. It's very self-explanatory. You must have a formatted high-density floppy on hand before you go on. It must be the type of floppy that you boot from (i.e. same type as the a1 disk). It will be used to make a boot disk at the end of the installation procedure. >From here on it's pretty automatic-- you simply flip disks while it installs the software. III.07) Any other information about SLS? ANSWER: This comes from the file SLS.FAQ, by Peter MacDonald. Please get the most recent version and read it: sunsite.unc.edu: /pub/Linux/SLS/SLS.FAQ. SLS (Softlanding Linux System) Copyright 1992, Softlanding Software. which is NOT just an image dump of someones Unix system. Also note that in the interest of preventing ftp storms, the version of SLS that appears on the internet, is not quite the same as the version distributed by Softlanding. Softlanding regularly gets a whole new version which has the changes integrated. But the updates to the Internet version are tailored to minimize the amount that has to be downloaded to become current. That is why bugs manage to creep in on me. I am not installing and testing the Internet version, although, functionally, it should be quite close to the Softlanding one. The purposes of the SLS are the following: 0) provide an initial installation program (for the queasy). 1) utilities compiled to use minimal disk space. 2) provide a reasonably complete/integrated U*ix system. 3) provide a means to install and uninstall packages. 4) permit partial installations for small disk configs. 5) add a menu driven, extensible system administration. 6) take the hassle out of collecting and setting up a system. 7) give non internet users access to Linux. 8) provide a distribution that can be easily updated. Highlights of the base are: gcc/g++, emacs, kermit, elm/mail/uucp, gdb, sc (spreadsheet), man pages, groff, elvis, zip/zoo/lh and menu. Highlights of X are: X, programmers libs, 75 dpi fonts, games (spider, tetris, xvier, chess, othello, xeyes, etc) and utilities like xmag, xmenu, xcolormap and ghostscript. Approximate usage is as follows: Tiny base system: 9 Meg (Series 'a') Main base system: 25 Meg (Series 'a', 'b' and 'c') Main base system + X11: 45 Meg (Series 'a', 'b', 'c' and 'x') Please read the file COPYING which outlines the GNU copying restrictions. The linux kernel is copywrite Linux B. Torvalds. Various other copywrites apply, but the upshot is that you may do whatever you like with SLS, except restrict others in any way from doing likewise, and you must leave all copywrites intact, and you can not misrepresent or take credit for others work. SLS is also available via mail from the address: Softlanding Software 910 Lodge Ave. Victoria, B.C., Canada V8X-3A8 (604) 360-0188 More details about SLS can be asked to pmacdona@sanjuan.uvic.ca. III.08) How do I get and install H.J. Lu's "bootable rootdisk" release? ANSWER: It's much like SLS release. Just get the bootroot disk image and use rawrite to transfer it to a floppy, and then boot it. You'll probably want to get the 'gccdisk' and 'libdisk', etc. images and rawrite them to floppies as well. Note that this release doesn't have a user-friendly installation script, it's meant mostly to upgrade or install the system by hand. Unless you're familiar with Linux this may prove difficult. :) This release is VERY USEFUL as a recovery disk in case you trash your Linux system. Everyone should have a copy of the newest bootroot disk for emergencies. It contains a full Linux system on one floppy. III.C. SOME COMMON PROBLEMS ~~~~~~~~~~~~~~~~~~~~~~~~~~~ III.09) What filetype is the extension ".z"? What about ".taz", ".tpz", and ".tgz"? I see these files on the archives but I don't know how to unpack them. ANSWER: Here's a list of common filename extensions on the archives. Extension Used by --------- ---------------------------------------------------------- .Z compress/uncompress. Use "uncompress foo.Z" to uncompress the file. .z gzip. Gzip is now used by many archive sites instead of compress; if you don't have gzip on your system, get it! To uncompress one of these files use "gzip -d foo.z". .tar Tar file. Use "tar xvf foo.tar" to unpack it. Or, you can fo "tar tvf foo.tar" to get an index listing of the tarfile. .taz Compressed tar file. You can do something like "zcat foo.taz | tar xvf -" or "tar xvfz foo.taz" to unpack it (some versions of tar don't have the z option). .tpz, .tgz Gzipped tar file. If you have gzip, zcat is linked to it, so you can do "zcat foo.tpz | tar xvf -" to unpack it. .tpz is the old extension; all gzipped tar files should now end in .tgz instead. The SLS distribution uses gzipped tar files (.tgz). III.10) How do I make partitions and/or filesystems for Linux? ANSWER: For most Linux installations (such as SLS) you'll need at least two partitions: one for swap space (used as virtual memory) and another for your "root filesystem" (that is, the actual Linux software itself). You can also make separate partitions for your /usr filesystem... if you have UNIX experience, you'll be able to figure out how to divide software between multiple partitions. For most installations simply having one root filesystem and one swap partition is the best way to go. The first thing you need to do is resize the existing partitions on your drive (if any) to make space for Linux; for example, if you have a DOS partition taking up all of your drive, you need to use FDISK under MS-DOS to delete it and recreate it with a smaller size. Of course, in so doing you'll lose everything on that DOS partition-- just back it up first and reinstall after you've recreated and reformatted the partition. That's life! :) Now you can boot up Linux (say, from SLS, or from the boot/root disks). >From there you use the command 'fdisk' to create partitions for Linux: fdisk where is the name of the drive which you're installing Linux on. Valid drive names are: /dev/hda: first IDE drive /dev/hdb: second IDE drive /dev/sda: first SCSI drive /dev/sdb: second SCSI drive For example, to run fdisk on the first SCSI drive in your system, use the command fdisk /dev/sda If you don't specify a drive name for fdisk, it will assume /dev/hda. The fdisk command "m" prints a menu. The "n" command is used to create a new partition. "w" writes the partition table and exits fdisk; "q" quits without saving changes. The "p" command displays the current partition table. When creating partitions with fdisk, you may get an error message to the effect of "Warning: Linux cannot currently use xxxxx blocks of this partition." This simply means that the Minix filesystem type (which is the default) is limited to filesystems which are 64 megs in size. You can ignore this warning, because when creating your filesystems, you can use one of the other filesystem types (ext, ext2, or xia) which have a size limit of 4 terabytes. Just keep in mind that if you create a partition larger than 64 megabytes then you cannot use the Minix filesystem type ('mkfs') when creating the filesystem (see below). You must use the ext, ext2, or xia filesystem type instead. NOTE: An "extended partition" DOES NOT equal "extended filesystem". An "extended partition" acts as a container for logical partitions. This allows you to have more than 4 partitions on a hard drive. Extended partitions cannot hold data on their own. You must create logical partitions on the extended partition to hold data. On the other hand, an "extended filesystem" is a Linux filesystem which uses the "extended filesystem type" (as opposed to the Xia filesystem, the Minix filesystem, and so on). Extended partitions and extended filesystems have nothing to do with each other. The TYPE of the partition (in the rightmost field when you use the fdisk "p" command) does not matter to Linux. However, it does matter to other systems such as OS/2. Just make sure that your Linux partitions have a type such as "Linux/MINIX" to distinguish it from other systems. (i.e. It doesn't matter if you set the type of the swap partition to "Linux swap". All of your Linux partitions can use the default type "Linux/MINIX" which is fine). WARNING: DO NOT use Linux fdisk to manipulate partitions for operating systems other than Linux. This means don't use Linux fdisk to delete or create MS-DOS partitions, for example. Use MS-DOS fdisk for this instead. Linux fdisk doesn't properly know how to create partitions for MS-DOS and other operating systems. When creating partitions, write down the names and sizes of the partitions you create. You need this information later on. Use the fdisk "p" command to display this information. Once you have your partitions created, reboot the system (with the SLS disk, reboot with the a1 disk again). You can now create filesystems on those partitions (which is similar to "formatting" a partition under MS-DOS). For the swap partition, use the command mkswap then swapon For example, for a swap partition on /dev/hda2, with a size of 8208 blocks, you'd use the commands mkswap /dev/hda2 8208 swapon /dev/hda2 This will make the swap space and enable it. Swap space is used as virtual memory... if you have 4 megs of RAM in your machine, and a 16 meg swap partition, you have a total of 4 + 16 = 20 megs of RAM available for Linux. To make your filesystems, use the correct version of the 'mkfs' program, depending on the type of filesystem you wish to use: Filesystem type Command to create filesystem --------------- ---------------------------- Minix mkfs -c Extended (old) mkefs -c Second Extended mke2fs -c Xia filesystem mkxfs -c The Minix and Extended filesystem types are older, and while more robust, are slower and may eventually be phased out. The most popular filesystem type used right now is the Second Extended fs type ('mke2fs'). The Minix filesystem type is limited to 64 megs (and 14-character-long filenames). It's suggested that you use either mke2fs or mkxfs. For example, to create a 61000-block Second Extended filesystem on /dev/hda3, use the command mke2fs -c /dev/hda3 61000 The "-c" option checks for bad blocks on the filesystem. Apparently mkfs and mkefs do not actually use the bad block information correctly (see Q/A below). Now you're ready to install the software. For SLS this means just using the 'doinstall' command (see section III.B above). For other installations you may need to 'mount' the filesystems first. Just see the relevant READMEs for information. III.11) Why does fdisk say "Linux cannot currently use XXXX sectors of this partition"? ANSWER: See the previous Q/A. Fdisk is an older program which expected all filesystems to be Minix fs, which limited filesystems to 64 megs. You can ignore this warning because the extfs, xiafs, and ext2fs don't have this limit. III.12) What does the message "MINIX-fs: Magic match failed" on bootup mean? ANSWER: Basically, this means that you're trying to mount a non-Minix filesystem as a Minix filesystem, and mount is croaking on it because the type is wrong. If you use a filesystem type other than Minix fs (i.e. if you use the extfs, ext2fs, or xiafs) you'll probably see this message: the kernel tries to mount root as Minix, then extfs, then ext2fs, and so on... every time it fails for one type it tries the next type. In most situations, this can be ignored, if the kernel is able to mount your root partition as any one of its known types. However, if you have recompiled the kernel yourself and set the root device to the wrong partition, then the kernel should hang at this point and you'll have to use "rdev" to set it correctly. III.13) Linux mkfs doesn't accept the size I give the device, although I double-checked with fdisk, and it's correct. ANSWER: Be sure you give the size in Linux BLOCKS (1024 bytes), not sectors. Also make sure that you have the right partition: partitions are numbered "/dev/hda1", "/dev/hda2", and so on (and "/dev/hdb1", "/dev/hdb2" for the second hard drive)... DON'T use "/dev/hda" or "/dev/hdb" as they correspond to the entire disk, not just single partitions. Also remember that SCSI drives use /dev/sda1, /dev/sda2... and /dev/sdb1, /dev/sdb2, and so on for their partitions. III.14) How can I get mkfs/mkefs to check for bad blocks? ANSWER: Unfortunately the -c option on mk(e)fs does not work; it cannot detect bad blocks on the drive, and thus if you create a filesystem over a part of your hard drive with bad blocks, things will eventually go wrong. So you need to generate a bad block list (in a file) and use the -l option on mk(e)fs so it will flag those blocks when making a filesystem. mke2fs and mkxfs correctly flag bad blocks, so this only applies to mkfs and mkefs. This is also only needed for older RLL and MFM drives. SCSI and IDE drives have bad block logic on-board. How to generate a bad block list? Since this is only needed for older drives and older filesystem types (i.e. Minix and extfs), just mail mdw@tc.cornell.edu or kircher@neuro.tuwien.ac.at if you need instructions on this procedure. Your best bet is to use mke2fs or mkxfs anyway. III.15) How can I boot Linux off of my hard drive? ANSWER: You need to install the "LILO" program which changes the boot sector of your hard drive to allow you to choose between a DOS or a Linux partition to boot from. These programs are provided with most major releases, or you can get them seperately from one of the FTP sites. As of LILO version 8 there is a "quick install" script available which should make LILO installation quick and easy. See Section VII for LILO information. You can also see the "LILO QUICKSTART GUIDE" by Matt Welsh which should be available on sunsite.unc.edu:/pub/Linux/docs. III.16) I tried to install LILO, but screwed up somehow, and now can't boot anything from the hard drive. How can I fix this? ANSWER: Simple. First you need an MS-DOS 5.0 (or OS/2) bootable floppy with FDISK.EXE on it. Boot it and run the command FDISK /MBR which will (hopefully) restore your hard drive's master boot record to a standard MS-DOS (resp. OS/2) boot record. Now you can go back and reinstall LILO. :) III.17) When installing SLS, I get the error "You may have inserted the wrong disk" when putting in the next disk in a series. What's going on? ANSWER: Each disk has a small file on it which contains the name of the disk. For example, the SLS a3 disk has a file on it called "diska3". If it doesn't exist, or is named something else (like "diska3.z"), then just create it/rename it. If you copied the files to the SLS floppies using "copy *.* ..." then you probably missed the "diska3" file because it doesn't have an extension in the filename! Also, the last disk in a series (i.e. the a4 disk, b5 disk, etc.) has a file on it called "install.end". You need this file as well. These files are used by the SLS doinstall program to keep track of where it is. III.18) When installing SLS, the installation script creates a "boot floppy" for me to boot Linux with. How can I make these myself (or fix problems with them?) ANSWER: The SLS install scripts just copy the kernel image to a blank floppy for you to boot Linux with. When SLS is installed, a copy of the kernel is stored in the file /Image on your hard drive: since you use the kernel on your boot floppy to boot, this file isn't used during the bootup process (unless you install LILO). To make a boot floppy yourself, you must do two things: 1) Run 'rdev' (a.k.a. 'rootdev') on the kernel in the file /Image to set the root partition it uses. For example, if your root partition is /dev/hda3, run the command rdev /Image /dev/hda3 2) Copy the kernel to a new floppy. You may need to DOS format the floppy first(*). Then run the command cp /Image /dev/fd0 if the floppy is in /dev/fd0 (the first floppy drive). You can use a command like dd if=/Image of=/dev/fd0 bs=16k as well; they should accomplish the same thing. (*) (From: "Michael L. Kaufman" kaufman@delta.eecs.nwu.edu) Formating the floppy lays down the track/sector information. If you have a completely unformated floppy, dd can fail in interesting ways. Many folks have problems with their SLS boot disks made in this manner because they forgot to run 'rdev' on the kernel image before copying it to the floppy. III.19) How can I set the default video mode used by Linux? Do I have to recompile the kernel to do this? ANSWER: No, you don't have to recompile the kernel. Just use "rdev" with the "-v" switch to set the video mode in the kernel (either on your hard drive (if booting from LILO) or on your boot floppy). For example, to change the kernel in /Image to prompt for the videomode on bootup, do rdev -v /Image -3 to change the kernel on your boot floppy do, rdev -v /dev/fd0 {video-mode} III.20) How else can I use rdev? ANSWER: rdev is very handy and also is used to set the root and swap partitions, ramdisk size, and more, in a compiled kernel. It means you don't have to recompile the kernel to make these changes. Use "rdev -?" for a list of options. III.21) When I login as non-root, I get tons of errors about "shell-init: permission denied". Also, some things work as root but not as a normal user. What's the deal? ANSWER: This is a really common problem which comes from not having permissions set right and a misunderstanding of some UNIX terms. Some installations won' t have the file permissions set correctly on the various directories that normal users (i.e. non-root) will use. For example, if your user directories are in /home, then /home must be of mode rwxr-xr-x, or 'chmod 755 /home'. Also, a home directory must be owned by the user who it belongs to (i.e. /home/mdw must be owned by 'mdw'... just 'chown mdw /home/mdw', for example). Also, the permissions must be set correctly for / (the root directory). Here's a list of permissions that should work (although you can use other permissions, these are just suggestions that shouldn't cause trouble): permissions (chmod) owner file ----------- ------- ----- --------------------------------------------- rwxr-xr-x (755) root / rwxr-xr-x (755) root /home rwxr-xr-x (755) mdw /home/mdw rwxr--r-- (744) mdw /home/mdw/.profile (or other startup files) rwxr--r-- (744) mdw /home/mdw/foo (normal files) In most cases the group of the file doesn't matter, but in general most files are set to group 'root' (except for binaries which are group bin, and so on) and user files are set to group 'user' (or whatever group users are in). In general you want directories that everyone can access to be rwxr-xr-x (chmod 755). Files that everyone can read are rwxr--r-- (chmod 744), and programs that everyone can run are rwxr-xr-x (chmod 755). Thus /bin, /usr, /usr/bin, /etc, and so on, should all be rwxr-xr-x. All binaries should be rwxr-xr-x (unless, of course, they're setuid programs). For UNIX newbies, setuid programs run under the user id of the owner, thus programs owned by root which have a permission of rwsr-xr-x (note the 's') run as root, with root's priveleges. So before changing permissions on a program check to see if it's setuid first. To make a program setuid prepend a '4' to the permissions you give to chmod, i.e. rwsr-xr-x is 'chmod 4755'. Here's a list of common uses for permissions: permission effect on files effect on directories ---------- ----------------------- --------------------------------- read lets you look lets you see what's in the directory at a file, lets you with ls run a shell script write lets you edit a file or lets you create or delete a file from copy over it the directory (*) execute lets you run a binary or lets you cd into the directory shell script (*) Note that you can delete a file from a directory even if you DON'T have write access to the file itself! Write access to the DIRECTORY that the file is in will let you delete any file in that directory. The permissions of the file itself have nothing to do with being able to delete a file. This is standard across all UNIX systems, nothing new with Linux. If any of this is confusing, please go buy a good book on using UNIX and read it. All of the above is standard UNIX fare. It's included here because many Linux newcomers don't take the time to learn UNIX before they dive in. :) III.22) I have the previous version of the Linux kernel, how can I upgrade it? ANSWER: If you've never done this before, get the kernel sources from your nearest FTP site (in a file named something like linux-*.tar.z) and unpack them into /usr/src/linux. As of Linux-0.99 there is a script to autoconfigure your kernel, and you need at least GCC version 2.3.3. You unpack these sources in /usr/src/linux. Make sure you have the logical links for /usr/include/linux and /usr/include/asm as described below. First run 'make config' and answer the various questions. Then edit /usr/src/linux/Makefile to set the root partition, keyboard, etc. Finally, do a 'make dep' (to set dependencies: VERY important!) and finally 'make'. Assuming you have GCC installed correctly, the kernel should compile and you'll be left with a new "Image" which is your new kernel: if you boot from harddrive, copy the Image to wherever you told LILO to look for it, or if you boot from floppy dd the Image to a new floppy. Make sure that you run "rdev" on the Image to make it look for the correct partition for your root filesystem (if you specified this correctly in the Makefile you don't need to do this). ** Make sure you read /usr/src/linux/README, which explains in detail ** what to do when recompiling the kernel. If you HAVE done this before, you can just apply the source patches to your old sources and then recompile (i.e. you don't have to get the entire kernel sources all over again). Use the "patch" program to do this. Before you recompile the kernel do a 'make dep' to set dependencies and a 'make clean'. III.23) Where is /usr/include/linux and /usr/include/asm, or, Why won't the kernel compile correctly? ANSWER: The files /usr/include/linux and /usr/include/asm are symbolic links to /usr/src/linux/include/linux and /usr/src/linux/include/asm, respectively. In other words, all of the Linux include files are actually under /usr/src/linux/include, but to access them you need two symbolic links in /usr/include: /usr/include/linux -> /usr/src/linux/include/linux /usr/include/asm -> /usr/src/linux/include/asm To make these, run the commands ln -sf /usr/src/linux/include/linux /usr/include/linux ln -sf /usr/src/linux/include/asm /usr/include/asm NOT the other way around. :) If you dont have these links then many compilations will surely fail. III.24) How can I upgrade to the newest version of GCC and/or libraries? ANSWER: See section IX on GCC for more information, but essentially all you need to do is FTP to sunsite.unc.edu (or one of the other Linux FTP sites) and look in /pub/Linux/GCC. You'll see a number of .tar.z files there (often abbreviated .tpz). The names change from time to time: you need to get the compiler (often in a file such as 'gcc233.tpz'), header files, and library files. At this point, the compiler lives in /usr/bin, the compiler's setup files are under /usr/lib/gcc-lib/i386-linux, and the libraries (shared, jump table, and static) are all in /usr/lib. It's all very straightforward once you actually unpack the tar files and everything falls into place. III.25) What's the deal with these things called "jump tables"? ANSWER: There's more information in section X and VII, but to be brief: There are two kinds of libraries for Linux. As of gcc v2.3.3 they all live in /usr/lib. The files are... /usr/lib/*.a static (non-shared) libraries (use gcc -static ...) /usr/lib/*.sa jump table shared lib stubs (use gcc -jump ...) There is an older form of the shared libraries which is no longer widely used. Nonetheless, you may run across it from time to time. /usr/lib/*.ca classic shared lib stubs When you compile a program, depending on the options you give gcc (-jump is the default) it will link it against one set of these libraries. The static libs contain all of the code and thus make your executable very big; no shared code is used. The classic shared libs were actually 'stubs' which reference the shared code in /lib/libc.so.VERSION (where VERSION is a number like '4.2'). /lib/libc.so.VERSION is a file which contains the actual code of the library, which is accessed at runtime by your executable. The jump-table library stubs are also shared libs, but they are built in such a way that you can upgrade the /lib/libc.so.VERSION file without having to recompile the programs that use it. So when we say "uses Jump Tables version 4.2" we mean it uses the actual library itself, /lib/libc.so.4.2. To compile programs that use jump tables version 4.2 you need the right version of /usr/lib/*.sa installed, but you don't need them to RUN programs that use jump tables. However programs that are compiled to use, for example, jump table version 4.2 (in the file /lib/libc.so.4.2) won't work if you only have libc.so.4.1 installed. They're only backwards-compatible. If you get errors about 'can't find /lib/libc.so.4.1' then the executable you're using is looking at runtime for a jump table version that you don't have. Basically you're safe if you have the most recent version of the /lib/libc.so.VERSION file installed (which is found on sunsite.unc.edu:/pub/Linux/GCC and comes with the GCC stuff). You should always have a symbolic link with the major version number of the library in /lib, because that's what's actually read. For instance, if you have /lib/libc.so.4.2 installed, then you need the symbolic link /lib/libc.so.4 -> /lib/libc.so.4.2 Make this with the command ln -s /lib/libc.so.4.2 /lib/libc.so.4 III.26) How to upgrade jump tables? (Without hanging my system) ANSWER: Be careful! If you upgrade your /lib/libc.so.VERSION file and either remove the symlink or delete the old libc.so.VERSION file before the new one is in place (and the link points to it), then more than likely all of your binaries like "cp", "mv", "ls" and "ln" use the library, so they'll all stop working once you kill the link or the library file. So to upgrade the file, copy the new version to /lib and switch the link in one step with a command such as ln -sf /lib/libc.so.NEW_VERSION /lib/libc.so.4 where NEW_VERSION is the new version of the library you're installing. This will switch the link in one step and everything should work. You just can't copy over the old file because the old version is in use by 'cp', 'mv', and so on. BTW you get new versions of GCC, jump tables, libraries, include files, etc. from tsx-11.mit.edu:/pub/linux/GCC. III.27) How can I be sure I won't be writing over anything important when installing Linux? I have to use DOS on my machine, and I don't want to lose any files. ANSWER: Back up everything. Just in case. As long as your DOS and Linux partitions don't overlap you should be okay. III.28) I just rebooted my machine, and now Linux dies with a "panic: trying to free unused inode". What's going on? ANSWER: You probably forgot to "sync" before rebooting, which stores on the disk physically the contents of the kernel buffers. You can either run "fsck" on the partition to TRY to correct the problem (it might fail), or re-mkfs and re-install the software on that partition. For the extended filesystem use "efsck" instead. The best way to shutdown your system is the "shutdown" command. To shutdown and reboot the system, use shutdown -r now or substitute a number of minutes in place of "now". Leave off the "-r" switch if you just want to shutdown and not reboot. III.29) Can I use both OS/2 and Linux on my machine?? ANSWER: Yes! See the following two Q/A's about getting your OS/2 Boot Manager to work. But, be warned: IF YOU USE OS/2, DO NOT USE LINUX's FDISK TO CREATE LINUX PARTITIONS!! The problem is with a bug/feature in OS/2's fdisk that tries to correct 'errors' in partitions that it doesn't like... Linux partitions included. The solution: make your Linux partitions with OS/2's fdisk, then use Linux's fdisk to change the partition ID's to the right values (this is self-explanatory with Linux's fdisk). If you made your Linux partitions with Linux's fdisk, and OS/2 sees them, it will think they have errors and end up trashing them. III.30) I use OS/2's Boot Manager on my hard drive. How can I get it to recognize Linux? ANSWER: To do this, install LILO on your Linux root partition, NOT on your hard drive's master boot record. The lilo command for this would be (if /dev/hda3 is your Linux root partition, and your Linux kernel is in /Image): /etc/lilo/lilo -c -b /dev/hda3 -v -s /Image Then use OS/2's fdisk to add it to the Boot Manager. Thanks to Thomas Brodt . III.31) When I run Linux's fdisk it says "OPUS" for OS/2's Boot Manager partition. Is this right? What's OPUS? ANSWER: It's correct. OPUS is BBS software that used partition type 0x0A long before OS/2. IV. SOME CLASSICAL PROBLEMS =========================== IV.01) While running du I get "Kernel panic: free_inode: bit already cleared". Also, du produces a ENOENT error for all the files in certain of my directories. What's going on? ANSWER: These are both consistent with a bad file-system. That's relatively easy to produce by not syncing before rebooting, as linux usually has 1.5MB of buffer space held in memory (unless you have <=4M RAM, in which case the buffers are only about 0.5MB). Also linux doesn't do anything special about the bit-map blocks, and as they are used often, those are the thing most likely to be in memory. If you reboot, and they haven't been written to disk ... Just do an fsck on the device, the -a flag might repair it otherwise, the only thing to do is to reinstall the filesystem from the Images. A sync is done only every 30 seconds normally (standard unix practice), so do one by hand (some people think you should do 3 syncs after each other, but that's superstition, you just have to give time to the first sync to finish), or by logging out from the startup-shell, which automatically syncs the system. Unmounting a filesystem also syncs it (but of course you can never unmount root). Another (sad) possibility is that you have bad blocks on your disk. Not very probable, as they would have to be in the inode-tables, just a couple of blocks in size. Again there aren't programs available to read a disk for bad sectors and put them in some kind of "bad-sector-file". On IDE drives this is no problem (bad sectors are automatically mapped away). IV.02) How can I partition my hard-drive to use Linux? ANSWER: See section III of the FAQ on installation. IV.03) I heard something about repartition a hard disk without deleting everything on it, any clue? ANSWER: It's not a program but a partition procedure which requires a) a partitionning program b) a sector editor The procedure itself can be found (at least) in digest#132 Vol2. IV.04) What must I do to mkfs a floppy? ANSWER: blocks are of size 1K so 1.44 floppy is 1440 blocks. The floppy has to be formatted before this will work (e.g., fdformat can do this from within Linux). IV.05) I have some trouble with tar/untar; any clue ? ANSWER: The tar provided on .96 and later is Pax (don't know for CURRENT_VERSION) which does not accept the z flag. You can download the GNU tar at tsx-11 in /pub/linux/binaries/usr.bin IV.06) I can do this as root but not as non-root, is it a bug? ANSWER: Except for an early make utility, the problem is caused by an incorrect permission flag. The most common problems are about /tmp which should be 1777 and /dev/ttys? which might be 766. So as root do chmod 1777 /tmp ; chmod 766 /dev/ttys? IV.07) "du" reports twice the size showed with "ls -l", is it a bug? ANSWER: No it is not, the report is 512 bytes multiple (due to POSIX requirement), for KB you just add the -k flag. You can add a du function in your .profile which does this automatically, something like du(){ /usr/bin/du -k $* } IV.08) Sometimes, I get "mount can't open lock file"; what does this means? ANSWER: This can happened for two reasons: A) You try to mount something as non-root. In that case you can either retry as root, or set the setuid bit to mount as follows: - be sure that mount belongs to root, if not do 'chown root /bin/mount' - set the setuid bit with 'chmod u+s /bin/mount' BTW you have to do the same with umount (in order to be able to unmount) Remark that it is NOT safe to allow anyone to perform mount/umount. B) You are root. mount wants to open /etc/mtab and /etc/mtab~ - the first one for reading, the second as lock file. If there is already a mtab~ remove it. This can happen if you used once gnuemacs on mtab. To forbid that case, just add the following entry in your /etc/rc file: rm -f /etc/mtab~ IV.09) When I try "mount /dev/hd?? /user", I get error 2. ANSWER: Be sure, that your mount point /user does exist; if not perform a "mkdir /user". BTW the error numbering is explained in /usr/include/errno.h IV.10) Since I have upgrade my Linux kernel, ps won't work anymore, why? ANSWER: Each time you upgrade (or re-compile the kernel), you should perform a 'ps -U' (-U is for update the /etc/psdatabase). Every time you boot a new kernel you have to do a 'ps -U' to update the psdatabase, after doing this you can remove the system file or even have to patch the ps-suite. BTW: sometimes a patch makes recompiling ps necessary. Sometimes you do a make clean. NOTE: As of 0.99 there is now a ps package which uses the "/proc filesystem". This is a meta-filesystem which has an entry for each process that's running... create the directory /proc and do a 'mount -t proc /proc /proc' to see it, or else add the following entry in your /etc/fstab: none /proc proc You can get the "procps" package from tsx-11.mit.edu in /pub/linux/BETA/procps. The nice thing about this is: you don't have to upgrade it for every kernel version (and thus ps -U is meaningless if you use procps). MKJ wrote in c.o.l.a: tsx-11.mit.edu:/pub/linux/BETA/procps/procps.tar.Z is the latest version of procps. Most of the reported bugs (i.e. all I can remember at the moment ;-) have been fixed, a man page for ps has been added, and several new programs have been added and/or fixed. A list of the stuff provided: ps free (a real one, from Linus) uptime (this needs work to be good, mine is a hack) tload (a hack, but who cares?) xload (from drew) fuser (perl script prototype, hopefully the real thing in a later release) IV.11) Since Linux 0.96b I have a lot of core file all over my disk. How can I sweep them away ? ANSWER: Use the following command find / -name core -exec rm {} \; BTW: think twice before using this command, there might be a John Core user on your system; this command will erase his mail :) If you never want to see another core file, put this line into your /etc/rc file: for a bash user ulimit -c 0 for a csh or tcsh user limit coredumpsize 0 IV.12) I can only log-in as "root", is it normal ? ANSWER: No, add "rm -f /etc/nologin" in your /etc/rc.local file IV.13) Sometimes my Linux virtual console get messed up when I cat a binary file. The characters shown are above ascii 127, any clue ? ANSWER: (J. Stuckey stuckey@mrcnext.cso.uiuc.edu) It's a vt-100 thing I think. echo "^V^O" should fix it. Control-V is the literal-next character that stty reports for me, and Control-O is the "magic" character that returns you to livability. V. LINUX and DOS ================= *** This section is co-written by Mark Komarinski, A. V. Le Blanc and *** MM. Corsini. The official maintainer is Mark, if you have *any* *** questions, mail him at komarimf@craft.camp.clarkson.edu *** Last Update 03.08.93 V.01) Is is possible to access DOS from Linux? ANSWER: Yes. (1) The mtools package allows you to access DOS files; it emulates the DOS commands CD, COPY, DEL, DIR, TYPE, and others. (2) Since approximately version 0.97 of the kernel, you can mount DOS file systems as part of your Linux directory tree, providing you have an appropriate mount command. (3) A DOS emulator is in alpha test, which will allow some DOS programs and utilities to run under Linux. V.02) Why use mtools if you can just mount a drive? ANSWER: Mtools is good if you want to do something quickly. For example, if you want to get directories on a bunch of floppies. The mount procedure requires you to mount the drive, get a directory, then umount it. Mtools lets you get the directory with one command. (Dirk Hohndel:) Mtools is really fast when copying disks. I mount the SLS directory of my SUN to my linux box and use mcopy to get the files on the disks. 3 times faster than using xcopy under DOS V.03) How do I get the mtools package set up correctly? ANSWER: The mtools package is available in source form on most Linux ftp sites. The most recent version (As of Sept 1992) is mtools.n2, and there are linked binaries and library (.a) files available as well (for example, as part of MCC interim releases of Linux). In the n2 release of mtools, there is only one executable binary which works differently depending on its name: you can create hard or symbolic links to it named mcopy, mdel, mdir, mtype, etc; this is how the Makefile in version n2 of mtools does it, and it saves several hundred kilobytes of disk space. Finally, you need the correct information in the file /etc/mtools, which is described below. Mtools also comes with the SLS release of linux. V.04) What is the format of the file /etc/mtools? ANSWER: A complete entry in the file /etc/mtools contains the following fields: drive, device, fat, cylinders, heads, sectors, offset. Two examples of entries from /etc/mtools are A /dev/fd0 12 80 2 15 C /dev/hda1 16 0 0 0 which defines the DOS disk A: as accessible through the device /dev/fd0, having a 12-bit FAT, 80 cylinders, 2 heads, and 15 sectors per track; DOS disk C: is accessible through the device /dev/hda1, has a 16-bit FAT, and its geometry is simply that of the hard disk where it lives. The last three numbers can be 0 if you wish; this allows mtools to try to figure out the disk's geometry itself, and perhaps to fail. A 12-bit FAT is common for floppies, but may occur in small hard disk partitions. A 16-bit FAT is common for hard disks. This is an extract of my /etc/mtools file: A /dev/fd0 12 0 0 0 # 3.5 1.4 Meg (autodetect) B /dev/fd1 12 0 0 0 # 5.25 1.2 Meg (autodetect) C /dev/hda1 16 0 0 0 # 1st partition of my Disk V.05) Where can I find out more about mtools? ANSWER: There are two detailed README files in the mtools.n2 distribu- tion. These files treat compiling and using mtools. There is a file README.mtools which treats only using mtools, which is a part of the MCC interim version of Linux. V.06) How do I use the DOS file system? ANSWER: The DOS file system is part of the kernel. If you have a kernel of level .97.1 or above, and an appropriate mount command, type mount -t msdos [-o conv=text] /dev/hda1 /dos to mount the partition /dev/hda1 as an MS/DOS file system on the directory /dos. You'll need a recent mount command, from at least release 97 or later of the root disk. Recent mount commands also accept the options conv=binary|text|auto (default is binary) to specify that text end-of-lines in DOS files are to be converted to UNIX end-of-lines (by omitting carriage return characters) in no cases (binary) or in all cases (text) or in cases that don't have 'well- known binary extensions' (e.g., .EXE or .COM) (auto). V.07) When I mount an MS-DOS disk, I get two lines of what seem to be error messages and the message: No bmap support. Is my disk bad? ANSWER: No. Since the dosfs is still in ALPHA mode, the two lines are used for displaying information about the disk that was mounted, just in case you have problems. The 'No bmap support' message means that you cannot run linux programs from that partition. This has been fixed in the latest release (alpha.9) V.08) I want to use the DOS file system with either conv=binary or conv=auto, but I want to convert text files from DOS to UNIX format, or from UNIX to DOS format. ANSWER: Use the utility todos/fromdos which comes as part of the dosfs package, currently (Sept 92) in released in version 8, or use the flip utility by Rahul Dhesi. V.09) Where can I find out more about the DOS file system? ANSWER: There is a README file included in dosfs.XX.tar.Z (the current value of XX is 10) V.10) This sounds me like a chicken and eggs problem, how can I install the mtools package at the very beginning. ANSWER: You have to use rawrite or the mount procedure. V.11) Could someone explain how to use rawrite? ANSWER: Rawrite is a DOS util which write sequential sectors of a formatted disk/floppy. When a floppy has been rawritten, you can (under Linux) untar it (use x, v, z and f flags). As an example: a) under Dos use rawrite rawrite source: kermit.z destination: a b) boot under Linux, and perform a tar tar zxvf /dev/fd0 tar zxvp < /dev/fd0 You DO NOT NEED TO MOUNT a rawritten disk V.12) What is as86.tar.Z ? ANSWER: It's the port of Bruce Evans' minix assembler, you need it to be able to recompile Linux at your convenience. In fact this is ONLY used for boot/setup.S and boot/bootsect.S they create 80x86 REAL mode code. V.13) Turbo (Microsoft) Assembler won't compile the Linux boot code. In fact, some of the opcodes in these files look completely unfamiliar. Why? ANSWER: The Linux boot codes are written in Bruce Evans' minix assembler, which has the same opcodes as the original minix assembler ported to linux get as86.tar.Z There are a few differences between these and normal DOS assemblers. V.14) What about the dos emulator (dosemu)? ANSWER: Dosemu is in alpha testing now, so it is very unstable and crashes easily. Some programs (such as earlier versions of Turbo Pascal; TP 5.5 too) seem to work fine, but other programs such as dir /p will crash the emulator. Look in your favorite FTP site for the dosemu kit. For a semi-complete list of programs that do and do not work under the emulator, get the file /pub/Linux/docs/emusucc.txt at sunsite.unc.edu or tsx-11.mit.edu. V.15) I have a Stacker volume on my hard drive. Can I access that? ANSWER: Yes, but you will have to do that through the dosemu program. For more information on it, check out the file /pub/Linux/docs/stacker.doc at sunsite.unc.edu V.16) How about OS/2 HPFS partitions, or MacIntosh/Amiga floppies? Can I mount any of them? ANSWER: There is no support for any of those filesystems yet. ===================8<==========>8================ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # LaBRI | # # 351 cours de la Liberation | e-mail: corsini@geocub.greco-prog.fr # # 33405 Talence Cedex | e-mail: corsini@labri.u-bordeaux.fr # # | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- There will be a sig when our local net is reliable. For now, I would rather stay anonymous.