* Linux Frequently Asked Questions 2/4 [monthly posted]
[not found] <PART1_729797776@geocub.greco-prog.fr>
@ 1993-02-15 17:36 ` corsini
0 siblings, 0 replies; 3+ messages in thread
From: corsini @ 1993-02-15 17:36 UTC (permalink / raw)
Archive-name: linux-faq/part2
Last-Modified: 93/02/11
Version: 1.16
*********************************************************
* *
* Answers to Frequently asked questions about Linux *
* *
*********************************************************
This post contains Part 2 of the Linux FAQ (4 parts).
It must be read *after* the first part.
================================8<=====8<==============================
CONTENTS (of this part)
IV. LINUX and DOS (part2)
V. SOME CLASSICAL PROBLEMS (part2)
VI. MISCELLANEOUS HINTS (part2)
VII. MORE HINTS (part2)
===================================8<====>8============================
IV. 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 02.02.93
QUESTION: 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.
QUESTION: 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
QUESTION: 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.
QUESTION: 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
QUESTION: 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.
QUESTION: 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).
QUESTION: 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 disk. This has been fixed in the
latest release (alpha.9)
QUESTION: 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.
QUESTION: 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 9), and an abbreviated version of this in the MCC
interim package.
QUESTION: 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 the rawrite stuff or the mount procedure.
QUESTION: Could someone explain how to use rawrite?
ANSWER: Well, rawrite is a DOS util, which write sequential sector 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
QUESTION: 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.
QUESTION: 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 Anyway there are a few differences
between these and normal DOS assemblers.
QUESTION: 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.
QUESTION: 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
QUESTION: 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.
V. SOME CLASSICAL PROBLEMS
==========================
QUESTION: 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), 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).
QUESTION: How can I partition my hard-drive to use Linux?
ANSWER: See section III of the FAQ on installation.
QUESTION: 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.
QUESTION: 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).
QUESTION: I have some trouble with tar/untar; any clue ?
ANSWER: The tar provided on .96 and latter is Pax (don't know for .98)
which do not accept the z flag. You can download the GNU tar at tsx-11
in /pub/linux/binaries/usr.bin
QUESTION: 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?
QUESTION: "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 $* }
QUESTION: 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
QUESTION: 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
QUESTION: 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)
QUESTION: 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
QUESTION: I can only log-in as "root", is it normal ?
ANSWER: No, add "rm -f /etc/nologin" in your /etc/rc.local file
VI. MISCELLANEOUS HINTS
=======================
*** This section is maintained by Matt Welsh (mdw@tc.cornell.edu). Please
*** mail me if you have any changes/updates/questions. Thanks -mdw
Special gcc information are located in section IX. A special section is
devoted to it since it's *the* compiler of Linux. I have subsectionned
this part in 3 subsections: Misc/Device Major-Minor/Serial Information.
VI.A. Misc information
~~~~~~~~~~~~~~~~~~~~~~
QUESTION: It seems that $#@! ported on linux don't run correctly, what
do I do about reporting bugs?
ANSWER: (Matt Welsh) It's possible that either the program itself has a bug
or that Linux has a problem that this program brings out. :) But first check
that the size of the file(s) corresponds that of the files(s) on the FTP
sites where it's available. If they're different, either you downloaded them
incorrectly (i.e. you forgot to turn on "bin") or whoever put them on the
FTP site uploaded them incorrectly.
If that's not the problem, then post to comp.os.linux asking about the
program, to verify that it is a bug. PLEASE: when posting possible "bug
reports" include all error and output information from running/compiling
the program. Just saying "it doesn't work" isn't very helpful. Also mention
your specific setup, Linux version, GCC version, etc. Some of these things
depend on running under certain versions and you may have missed that
information.
Note that my "ml-linux-bugs@dg-rtp.dg.com" bug reporting list has been
phased out. It turns out that Linux has so few bugs, most of which are
resolved on the newsgroup or through Linus before I can accumulate them
and post. :) In short: if there's a bug in Linux or in Linux-ported
software, it will usually be fixed in the next patchlevel or version.
QUESTION: Has $#@! been ported to Linux?
ANSWER: First check out the FTP sites and read the monthly INFO-SHEET,
as well as the new "Linux News" and the META-FAQ's (all of which are
either available on the FTP sites and/or posted to the newsgroup as they're
written). Also check out the "Linux Project Registry" (posted to the
newsgroup and on the FTP sites) which lists ongoing/current Linux projects.
Also look in the "old" Linux digests and mailing-list archives, kept on
tsx-11.mit.edu and nic.funet.fi. Also, see if there's a GNU(*) version
of the program you're looking for (which are available everywhere).
Since Linux uses GCC as its native compiler, most GNU software ports
directly to Linux without problems. If all else fails, ask on the
mailing list or newsgroup if the program is ported and where it's
available.
(*) GNU stands for GNU's Not Unix, which (besides being a recursive
acronym) is a project started by the Free Software Foundation (the FSF)
to write a freely distributable version of Unix. The GNU kernel is
named HURD, and is based on Mach. It is currently being written, and is
not yet done. Many of the GNU utilities, however, are completed and are
much more functional than the original Unix utilities. Since they are
freely available, Linux is using them as well.
QUESTION: I've ported $#@! to Linux, what should i do to add it in the
standard distribution?
ANSWER: (Matt Welsh) First read the previous Q/A, then talk to the
maintainers of the various releases (MCC interim, SLS, and so on)
about including your program with those releases. The best way to make
programs available to the rest of the world is to upload it to one of
the Linux FTP sites (such as tsx-11.mit.edu:/pub/incoming or
sunsite.unc.edu:/pub/Linux/Incoming).
BTW Whenever you submit binaries, please think that if you link them
with shared libraries, this might cause problems for those who (gasp!)
don't have the shared libraries installed. You can either link them
using -static, and if someone wants to build a shared version on their
own machine they can get the sources (which you should also make
available) and build it themself. Or else provide the shared lib.
QUESTION: I want to port $#@! to Linux, what are the flags?
ANSWER: Recall that Linux implements subset of SYSV and POSIX, so
-DUSG and -DPOSIX work in general.
NOTE1: SIGBUS is not there, and can be safely commented out in general.
NOTE2: see section related to GCC, in the third part of this FAQ, for
more details.
VI.B. Major/Minor device number
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** This section is maintained by Rick Miller, any comments,
*** suggestions, remarks should be mailed to him at <rick@ee.uwm.edu>
*** Last Update: 17 Nov 1992 16:00:20 GMT
QUESTION: What are the device minor/major numbers?
ANSWER: Here's a preliminary listing from Rick Miller <rick@ee.uwm.edu>:
The Linux Device List
published by rick@ee.uwm.edu (Rick Miller, Linux Device Registrar)
Many thanks to richard@stat.tamu.edu and Jim Winstead Jr.
Majors:
0. Unnamed . (unknown) .... for proc-fs, NFS clients, etc.
1. Memory .. (character) .. ram, mem, kmem, null, port, zero
2. Floppy .. (block) ...... fd[01][dhDH]{360,720,1200,1440} or fd[01]
3. Hard Disk (block) ...... hd[ab] or hd[ab][1-?] (Extended>4)
4. Tty ..... (character) .. tty{0,1-8,63,64-127,128-?} or ttys{0-3,1-4}
5. tty ..... (character) .. special tty: owner of its calling process.
6. Lp ...... (character) .. lp[0-2] or par[0-2]
7. Tape .... (block) ...... t[0-?] (reserved for Non-SCSI tape drives)
8. Scsi Disk (block) ...... sd[0-?] or sd[0-?][0-?]
9. Scsi Tape (character) .. st[0-?]
10. Bus Mouse (character) .. bm, psaux (mouse)
11. CD-ROM .. (block) ...... scd
Breakdown of minors by Majors:
------------------------------
0. Unnamed . (unknown) .... for proc-fs, NFS clients, etc.
Minors??? (Not yet implemented???)
1. Memory .. (character) .. ram, mem, kmem, null, port, zero
0. /dev/ram
1. (block): RAM-Disk (character): /dev/mem
2. /dev/kmem
3. /dev/null
4. /dev/port
5. /dev/zero
2. Floppy .. (block) ...... fd[01][dhDH]{360,720,1200,1440} or fd[01]
Minors are [drive + [4 * type]] where drive 0-3 == A:-D: (floppy)
and type is: 0: Autodetect 4: 720k in 3.5"
1: 360k in 5.25" 1.2M 5: 360k in 5.25" 1.2M
2: 1.2M in 5.25" 1.2M 6. 720k in 5.25" 1.2M
3: 360k in 3.5" 7. 1.44M in 3.5" 1.44
3. Hard Disk (block) ...... hd[ab] or hd[ab][1-?] (Extended>4)
0. First HD (/dev/hda), whole drive including Master Boot Record.
1-4. Partitions on the first HD.
5-8. Logical partitions within an extended partition on first HD.
64. Second HD (/dev/hdb), whole drive including Master Boot Record.
65-68. Partitions on the second HD.
69-72. Logical partitions within an extended partition on second HD.
Notes: BE *VERY* CAREFUL WITH /dev/hda AND /dev/hdb!! These two
devices signify the *entire* *drive*, not just one partition.
The only things that use /dev/hda or /dev/hdb are things that
need to read/change the partition table (like fdisk).
The names of the hard drives are not the same as under Minix.
Linux doesn't order anything. It perceives partitions in the
order in which they appear in the partition table. Thus,
/dev/hd?1 may be physically after /dev/hd?2.
4. Tty ..... (character) .. tty{0,1-8,63,64-127,128-?} or ttys{0-3,1-4}
0. /dev/tty0: This is the currently active Virtual Console.
1-63. /dev/tty#: Specific virtual consoles.
64-127. /dev/ttys*: Serial ports.
128-191. /dev/pty[??]: PTY Masters.
192-255. /dev/pty[??]: PTY Slaves.
Notes: There are several constants set in the kernel sources which
can be changed to compile a more customized kernel. They're
found in [/usr/src]/linux/include/linux/tty.h:
NR_CONSOLES The number of virtual consoles.
NR_SERIALS The number of serial lines.
NR_PTYS The number of pty's.
5. tty ..... (character) .. special tty: owner of its calling process.
0. /dev/tty: the tty that owns the process calling it.
6. Lp ...... (character) .. lp[0-2] or par[0-2]
1-3. Parallel (printer) ports. (Increasable in include/linux/lp.h)
Notes: The number of line printers is defined by LP_NO which is
found in [/usr/src]/linux/include/lp.h.
7. Tape .... (block) ...... t[0-?] (reserved for Non-SCSI tape drives)
This one's just getting started. No minor numbers are yet assigned.
It's not even in the source code.
8. Scsi Disk (block) ...... sd[0-?] or sd[0-?][0-?]
Minors numbers are [[16 * HostID] + partition]
Notes: The maximum number of SCSI drives is defined by MAX_SD
found in [/usr/src]/linux/kernel/blk_drv/scsi/sd.h.
Additional note (Eric Youngdale): In the new scsi drivers
there is no set maximum number of scsi disks, hence no need to fiddle
with sd.h Everything autoconfigures as the system boots.
9. Scsi Tape (character) .. st[0-?]
Quoting from the source-code:
void do_st_request(void)
{
panic("There is no st driver.\n\r");
}
Notes: For future reference, the maximum number of SCSI tapes
is defined by MAX_ST which is found in
[/usr/src]/linux/kernel/blk_drv/scsi/st.h.
(E. Youngdale) The same is true here. There is no longer any
need to set MAX_ST, and it would be a bad thing to actually try. Even
though there is a MAX_SR in the cdrom code in the 0.98.5 kernel, the
new scsi code effectively eliminates this as well.
10. Bus Mouse (character) .. bm, psaux (mouse)
(If I recall, X Windows requires that
/dev/mouse be linked to one of these...)
0. /dev/bm: (Logitec?) bus mouse
1. /dev/psaux: PS/2 mouse port
2. /dev/bm: MicroSoft bus mouse
3. /dev/bm: ATI XL bus mouse
11. CD-ROM .. (block) ...... scd
Minors?
From: eric@tantalus.nrl.navy.mil (Eric Youngdale)
Date: 17 Nov 92 16:25:40 GMT
> For the cdrom, the minors are just the devices
> themselves. If you have one cdrom drive, the minor is 0. If you
> have two, then the minors are 0 and 1. Not much more to it than that.
> For a SCSI tape, each physical device has two minor numbers
> that are associated with it. If you have two tape drives, then
> minors 0 and 1 will refer to the first and second drives and the
> tape will be rewound when the device is closed. Minor numbers 128
> and 129 (i.e. 128+n) also refer to the first and second physical
> drives, but the tape will not be rewound after closing the device.
> If you have one tape, you could create the devices with the
> following commands:
> mknod /dev/rmt0 c 9 0
> mknod /dev/nrmt0 c 9 128
NOTE: all the numbers given are in decimal form (the one you can see if
you perform ls -l on /dev).
QUESTION: Could some one give me indication about the meaning of the
IRQ's ?
ANSWER: (alawrenc@sobeco.com:)
Standard IRQ's :
IRQ 0 - Timer
IRQ 1 - Keyboard
IRQ 2 - Slave 8259 (AT)
IRQ 3 - COM 2 / COM 4
IRQ 4 - COM 1 / COM 3
IRQ 5 - (XT) Hard Disk, (AT) LPT2
IRQ 6 - Floppy Disk
IRQ 7 - LPT1
AT only IRQ 8 - Real Time Clock
IRQ 9 - Re-direct to IRQ 2
IRQ 10 - Not Defined
IRQ 11 - Not Defined
IRQ 12 - Not Defined
IRQ 13 - 80287
IRQ 14 - Hard Disk (AT)
IRQ 15 - Not Defined
QUESTION: (Chuck Boyer) Could some one clear up the devices meaning?
ANSWER: (Jim Winstead Jr)
>port
This allows programs to access the hardware ports directly. Not
something you generally mess around with much.
>ptyp0-3
>ptypa...tty
These are the pseudo-tty 'master' devices. Each pty connection uses
a slave-master set of tty devices.
>tty0...
tty[1-8] are the virtual consoles associated with Alt-F[1-8]. tty0 is
the current virtual console (so writing something to tty0 goes to the
current vc).
>tty64 I've figured out is the modem connection
Yes, that would correspond to COM1 under DOS. However, the tty64 name
is obsolete - ttys[1-4] should be used instead.
>ttyp0...
>ttypa...
These are the pseudo-tty 'slave' devices.
>ttys1...
These are the serial devices. ttys1 corresponds to COM1 under DOS,
ttys2 corresponds to COM2, etc.
VI.C Special Serial
~~~~~~~~~~~~~~~~~~~
*** This section is maintained by Jim Gifford
*** (jgifford@attmail,world.std}.com
*** Last update October 1992.
Douglas E. Quale:
This has come up a couple of times already (including the case of
serial mice as well), but for the record stty acts on stdin not
stdout. Old stty's (from V7 through BSD4.3) used stdout, but this is
suboptimal and doesn't conform to POSIX. The GNU stty you are likely
using on Linux uses stdin, as does the stty distributed with BSD
Networking Release 2. (Also, ``stty -a'' is more informative about
possible parameters, although it's pretty hard for me to remember what
90% of that stuff does without refering to the man page.)
Jim Gifford:
However, there are a few older (of mysterious origin) stty's that work
on stdout(I have one myself!)
QUESTION: Is there a list somewhere where I can get help with serial
communications under Linux?
ANSWER: (Jim Gifford -- jgifford@world.std.com)
There is a list for the discussion of serial communications under
Linux. It is for problems, drivers, new developments, etc... with
the Linux serial devices. The list is: linux-serial@stolaf.edu
To join, send mail to linux-serial-request@stolaf.edu
I hope that this list will prove beneficial to the improvement of
Linux. This list is maintained by Michael K. Johnson as
linux-serial-request@stolaf.edu
QUESTION: When I run kermit under Linux, I get "Warning, Read access
to lock directory denied". What am I doing wrong?
ANSWER: Nothing, you just need to create /usr/spool/uucp (kermit 4.6?)
or /usr/spool/locks (this is for the kermit5A), which is where kermit
like to lock files.
QUESTION: What are the major, minor numbers for the serial ports under linux?
ANSWER: Major 4, Minor :
64 /dev/ttys0 - com1
65 /dev/ttys1 - com2
66 /dev/ttys2 - com3
67 /dev/ttys3 - com4
QUESTION: can anyone give me a sample /etc/inittab entry for login
from a pc attached to serial line /dev/ttys2?
ANSWER: "Humberto speaking :), updated by Rick Miller"
First set up the modem to turn off echo and enable auto answer, I do
this in kermit by connecting to the modem and typing "ate0s0=1"
followed by enter (w/o quotes). Then setup inittab to spawn getty on
the modem
ttys2:vt100:/etc/getty -m 1200 ttys2
(Replace "vt100" with the name of the /etc/termcap entry for the
terminal type you will use, or use "dumb" if you don't have one.)
Then it should work. Some modems can be permanently set to disable
echo and set auto answer, see your manual.
Jim Weigand says:
disable all messages. This will prevent getty from hanging up
your modem.
Set For:
ATE0 No echo
ATQ1 No messages
ATS0=2 Answer 2nd ring
ATS7=60 1 minute to answer (shorter if 2400 baud)
You can use kermit to set these. Do an AT&W to save for power-up.
Michael K. Johnson says:
If you would rather not save these commands as defaults to come up
on power-up, perhaps because you want to use your current modem
settings under a DOS communications package, you can also shove
these command out ttys? from /etc/rc (or /etc/rc.local) using
the command:
echo "<modem_settings>" > /dev/ttys?
QUESTION: How do I set parameters like parity for serial login?
ANSWER: Use stty and redirect input from the serial line.
ex: stty parodd < /dev/ttys2 which gives ttys2 odd parity.
type stty -a to get an idea of possible parameters.
Or 'man stty' as well :)
VII. MORE HINTS
===============
This part try to keep track of the different information
that appeared in comp.os.linux and on the list since beginning of
March. I tried to update it for KERNEL_VERSION, so there might be some
mistakes. Moreover take care to use the correct library and include
stuff, and the ad-hoc gcc you use !!!
QUESTION: How can I backup my Hd under Linux ?
ANSWER: I know at least two ways. One possibility is tar and mtools,
another possibility is the diskbackup/diskrestore of Diamano Bolla
(digest37 vol. #2) which saves big hd to floppies using the
stdin/stdout. These utilities have been uploaded to the major sites in
file disksplit.tar.Z.
An example usage (Roger Binns) is:
tar cvf - bin dev usr etc .. | compress | diskbackup
and to restore:
diskrestore | uncompress | tar xvf -
BTW: if you are on Ethernet you could send your files via tar..|rsh (tar...)
or even via NFS to a host which is regularly backed up !
QUESTION: Where is 'which' ?
ANSWER: It depends on the sh you are running:
in bash 'type -path'
in tcsh it's a builtin
for rc you can try the following (untested by me) script from
Kevin Brown:
#!/bin/sh
for i in `echo $PATH | sed 's/:/ /g'` ; do
for j in ""$@" ; do
if test -x "$i/$j" ; then
echo "$i/$j"
fi
done
done
QUESTION: How to use setterm: for the novice?
ANSWER:The setterm utility provides access to most of Virtual Consoles
(VCs) functionality. You can set your screen up to blank at 10
minutes using:
setterm -blank 10
You can set colors, and clear the screen. For a full list of commands,
just type "setterm" with no arguments.
There are a few tricks with the screen dumper can really make VCs go a
long way. Here are a few of the common ones that I use:
setterm dump
Dumps the contents of the current VC to screen.dump (in the current dir).
setterm dump 4
Dumps the contents of VC 4 to screen.dump
setterm -file mydumpfile -dump 4
Dump the contents of VC 4 to the file mydumpfile
setterm -file /dev/tty0 -dump 4
Dumps the contents of VC 4 to the current VC.
setterm -file /dev/tty4 -dump
Dumps the contents of the current VC to VC 4.
setterm -file /dev/ttys1 -dump
Dumps the contents of the current VC to the serial port.
Handy if you are logged on and want to paste a screen full without
having to resort to doing a file transfer.
setterm -file mydumpfile -append 4
Appends to instead of overwriting the dump file. Useful if you
have several screens you wish to concatenate.
QUESTION: I've tried clear/reset which exist on most of unix but it
doesn't work, have I missed something?
ANSWER: setterm -clear or setterm -reset will solve your missing. For
clear, you can also write a small script (which use the cl: part of
/etc/termcap wrt your TERM), or use bash where ctrl-l will do it for
you.
QUESTION: I know there are VC, but where is the setterm stuff?
ANSWER: It's in the current distribution (i.e. on the images), the
source can be found in virtcons.tar.Z at nic.
QUESTION: I know there are shared libraries; does there exist an easy
way to check an executable for sharing ?
ANSWER: (Josh Yelon & HJ Lu)
(J.Y.) An executable which shares a library is linked with an
(ordinary, non-shared) "stub" version of the library. One of the first
thing this stub does (when the executable is run) is to ask the kernel
to load the (big) "shared version" of the library (which is usually
named /lib/lib.XX.XX) The upshot of this is that in the code for the
stub (part of the executable), is the string "/lib/lib.XX.XX"; which
can be searched by using 'strings' or 'grep'.
(HJ. L.) if you have gcc2.11a or later the shared image is changed to
/lib/libxxxx_vyy_zzz. And you should better use nm to find
"__shared_lib" (nm failed on stripped executable). You can also write
a function for "file", which can even check the version number ....
(Claude Morin:) There exists at tsx-11 ldd.tar.Z If you follow
the instructions, you will be able to type "ldd <executable>" to List
the Dynamic Dependencies of the executables. In other words 'ldd'
prints the name of the shared libraries needed by the executable,
nothing appears for static one.
QUESTION: What is the rdev program provided in the images?
ANSWER: It's a program from Werner Almesberger of ETH. With no
argument it prints the first line of /etc/mtab. With one argument, a
boot-image, it prints the device configured as the root device, and
with two arguments, a boot image and a device, it sets the device as
default root in the specified image.
QUESTION: How to start Linux from drive B?
ANSWER: There is a DOS utility called boot_b.exe (look at DOS ftp).
Another simple way is to open the box and invert the cables.
QUESTION: The program boot_b works fine /but/ once the first disk is
read the system go back to the first drive, any hints?
ANSWER: Yes, change the bootimage in just the same way that you change
it to boot on the hard drive, execept that the major/minor pair is
different. All these information are in the file INSTALL-0.10.
Remember that if you use a sun or other endian machine, you will need
to reverse the byte order when you run the filter program (also in the
same file).
QUESTION: How can I get Linux to boot directly from the harddisk?
ANSWER: (Rick) The best option right now is LILO version ALPHA.8. It
has been generally agreed that the days of using "shoelace" are at an
end. See Section III of this FAQ for LILO information.
QUESTION: I use shoelace, but I want to change my root partition, what
is the process to get rid of it?
ANSWER: With Norton utility you can put back a standard boot sector.
Another possibility is to restore the old boot sector (the one you
should have backup *before* installing shoelace).
QUESTION: Sometimes, when I want to remove a directory, I get an error
message, is it a (known) bug?
ANSWER: No, There is no bug at all, you probaly have another shell
on another VC whose working directory is either the one you try to
remove, either a subdirectory of it.
QUESTION: I'm looking for init, getty, login, passwd stuff, where
can I find them?
ANSWER: You should find it in shadow.tar.Z (only sources), at least
at tsx in the usr.bin directory. Many people have reported some troubles
with the *OLD* shadow-passwd (shadow-bin.tar.Z and shadow-src.tar.Z, so
do not use them anymore); an alternative might be the mcc-interim
which contains standard passwd binary. There is also the Peter Orbaek's
admutil-1.?.tar.Z and poeigl-1.?.tar.Z which contains source for
shutdown, su, chsh, passwd and a system V init compatible.
QUESTION: How can I setup a user account other than root ?
ANSWER: You can either use the adduser program, either do it manually.
In the later case, you have to:
a) edit /etc/passwd as root and add a line of the following format:
user:passwd:uid:gid:user name:home directory:login shell
user is the login name; uid is the numeric user id, it should be
unique; gid is the numeric group id, this number should correspond to
an entry in /etc/group. The passwd field should be left blank 'cause
it is stored in an encrypted form [to set this field just use the
passwd program].
example
faq::200:5:Marc-Michel:/home/faq:/bin/sh
b) Still as root, you shoud now create the home directory and set the
correct ownership.
mkdir /home/faq
chown faq /home/faq
chgrp 5 /home/faq
QUESTION: I've been trying to get Linux to run on my [3/4]86 box. It
can't even boot. Any suggestions?
ANSWER: The most common error/problem is writing the bootimage to a
low density disk. It fits, but the bootstrap code will only recognize
high density disk. So try to format explicitely disk as high density:
- for 3.5", 'format a: /n:18 /t:80 '
- for 5.25", 'format a: /n:15 /t:80 '
QUESTION: Does there exist games, languages (other than C), and
anything which make the system more friendly?
ANSWER: Yes, among other things there are rogue and yahtzee; TeX;
Prolog, Perl.. but in general, if you want some extra tool port it to
Linux this is also a good beta-testing exercice.
QUESTION: Whenever I use uemacs 3.1X on a symlink, the symlink does
not exist anymore, why?
ANSWER: (Tristram Mabbs) Since ue3.10, uemacs uses 'safe save' mode,
writing the file to a temporary and moving it OVER the original. In
the process, this deletes the original. To prevent this just add the
following in your emacs '.rc' file: set $ssave FALSE
QUESTION: Uemacs doesn't work anymore with 0.95a, whenever I want to
save a file; what can I do?
ANSWER: ^S and ^Q are used for flow control. One solution is ^X^W
followed by the filename, or M-X save-file, try also ^XS it could work
for some version (not mine). Another possibility,
if you have download the stty.tar.Z file, is to do stty -IXON
before you first use uemacs (this can be included in your .profile).
And the last is to recompile the Peter Orbaek init-1.2 package.
QUESTION: I have an SVGA, but Linux detect an EGAc/EGAm; is it normal?
ANSWER: (Jim Winstead) This is correct actually. You have an EGA+ card
(SVGA) with a Color/Mono monitor. The only four possibilties are EGAc,
EGAm, *MDA and *CGA (according to the code in
kernel/chr_drv/console.c).
The true test, if Linux detects your video card, is if you press
<RETURN> at the "Press <RETURN> to see SVGA- ..." boot-time message.
If you have a SVGA recognized card, it will ask you to choose a
screen size. If not detected, the default is 80x50 mode.
BTW if you have no SVGA, press the <space> and you are in 80x25 mode.
If you have dowloaded the kernel, you can automatically skip this
query at boot-time if you set the SVGA_MODE variable in the main
Makefile before compiling a new bootimage.
QUESTION: How can I change the keyboard repeat rate?
ANSWER: (Michael K Johnson) In boot/setup.S there are the lines:
! set the keyboard repeat rate to max
mov ax,#0x0305
mov bx,0x0000
int 0x16
If you don't want to change the repeat rate at all, just comment out
these lines. If you want something in the middle, change the
mov bx,0x000
by mov bx,0x??yy
where ??yy is determined by (Ralf Brown's interrupt list)
bh= delay value (0x00 = 250ms to 0x03= 1000ms (one sec))
this is the delay before the repeat is performed
bl= repeat rate (0x00 =30/sec to 0x1f=2/sec; 0x0c=10/sec [default])
QUESTION: I compiled fdformat.c and ran it on 1.44Mb and 1.2Mb, the
results are unreadable, any clue?
ANSWER: (M. Pereckas) fdformat only low-level formats the disk. to use
the fdformatted disk with DOS filesystem, run mformat on the disk.
Mformat writes DOS filesystem information but is unable to low-format
:). In order to put a Linux filesystem on a (low)formatted disk you
have to mkfs it.
QUESTION: Is it possible to disable the 3-fingers salute
(ctrl-alt-del) ?
ANSWER: Yes, in kernel/sys.c you can read the following:
/*
* this indicates wether you can reboot with ctrl-alt-del: the deault is yes
*/
static int C_A_D = 1;
there is also a small utility written by Linus in digest242 vol#2
QUESTION: Could some one explain the information provided at boot-time?
ANSWER: (Jim Winstead Jr)
> serial port at 0x03f8 is a 16450
> serial port at 0x02f8 is a 16450 (what's that the uart chip?)
Right, the last number should either be 8250, 16450, 16550, or 16550a,
and on the two 16550 models, it will report that FIFO's have been
disable (16550) or enabled (16550a).
> 8 virtual consoles (that's how many alt-F's I can get going?
> but only F1-4 actually work)
You can get sessions running on Alt-F[1-8], but the 'standard'
/etc/inittab only runs getty/login on Alt-F[1-4]. You can start
sessions on the other consoles by using 'doshell' or adding lines to
/etc/inittab.
> 4 pty's (are these the consoles F1-4?)
No, those are 'pseudo' ttys, which programs like MGR use to simulate
tty connections. That's probably a gross over-simplification, but it
gives you the general idea, I think. :)
> p_init: lp1 exists (0) (is that the (l)ine (p)rinter?)
Right.
QUESTION: What is the meaning of files ended by .T.Z (or .taz) ?
ANSWER: The suffix Z is for compressed files (to uncompress them use
the command `uncompress file.Z`).
The suffix T indicates a "tar file" the usual suffix is tar but, the
14 chars filename limit of the Minix filesystem makes it cumbersome to
use .tar.Z (to untar a file ended by .T, use the command
`tar options file.T` (see the man page for more details).
For the .taz file, change them as .T.Z and go-ahead.
QUESTION: I have upgraded the kernel from XX to YY (XX > YY), however the
login screen still says YY.
ANSWER: Just change the message in one of these files: /etc/issue and
/etc/motd. The former contains the message before the login, the later
is the one after you are logged in.
QUESTION: What is doshell good for ?
ANSWER: It's an old program provided in the early Linux version (0.12)
when the getty was not already there, it spawns a shell on any tty's.
(Mattew Gream): I do this quite often ( getty on tty1, 2, 3 and my
rc.local spawns a shell on tty4 as follows
'/usr/bin/doshell /dev/tty4 /bin/tcsh &'
QUESTION: I don't have the kernel sources, how can I change the keyboard
language?
ANSWER: You can use the fixkbd program written by Laurent JULLIARD
(Laurent_JULLIARD@grenoble.hp.com). Its purpose is to fix the keyboard
map used in your kernel image. It works more or less a la "rootdev"
(or rdev). It can be found on tsx-11.mit.edu in
/pub/linux/binaries/sbin/fixkbd.tar.Z.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# LaBRI | #
# 351 cours de la Liberation | e-mail: corsini@labri.greco-prog.fr #
# 33405 Talence Cedex | #
# | #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
There will be a sig when our local net is reliable.
For now, I would rather stay anonymous.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Linux Frequently Asked Questions 2/4 [monthly posted]
1993-02-18 17:41 Linux Frequently Asked Questions 1/4 " corsini
@ 1993-02-18 17:41 ` corsini
0 siblings, 0 replies; 3+ messages in thread
From: corsini @ 1993-02-18 17:41 UTC (permalink / raw)
Archive-name: linux-faq/part2
Last-Modified: 93/02/18
Version: 1.16.1
*********************************************************
* *
* Answers to Frequently asked questions about Linux *
* *
*********************************************************
This post contains Part 2 of the Linux FAQ (4 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 kept up-to-date, and 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 9 Feb 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
~~~~~~~~~~~~~~~~~~~~~
QUESTION: 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. Wizenius
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.
QUESTION: 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),
but Linux mainly uses the minix filesystem which limits filesystems to
64 megs each. You can also use the extended filesystem (which is still
in testing, but has been included with recent kernel versions) which has
a limit of 4 terabytes. Probably enough unless you have a disk array. :)
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.
QUESTION: 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 14 disks for Linux
and 8 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 2 disks must be "rawritten" (using rawrite.exe) on floppies,
and the rest of the images are put onto DOS format floppies.
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 images and docs are found at tsx-11.mit.edu:/pub/linux.
* Others but OUTDATED
There are other releases and distributions of the Linux software,
such as the "MCC-Interim" and "MJ" releases. 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 MCC-Interim release (the previous de facto Linux standard)
isn't going to be updated anymore, according to Owen LeBlanc. So
if you install it, be warned that you'll have to upgrade it all
in some other way (the last version of MCC-Interim was 0.97.2,
quite dated).
The "MJ" release, according to Martin Junius, is no longer
maintained. The last version was 0.97.1.
QUESTION: Where can I get these versions 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.
QUESTION: What should I do to install 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.
For the SLS release, you need to get the files in the a1, a2, a3, and
a4 directories at least. You also need the README's there. Basically,
you use rawrite to copy the a1 and a2 images onto floppies. Or, you
can use 'dd' on your UNIX system to transfer the files directly to
floppies (assuming you have a floppy drive on your UNIX system) in
place of rawrite.
The rest of the files all go onto DOS-formatted floppies, just using
DOS copy. The SLS release is nice because it reads the DOS floppies
during installation, so you don't have to rawrite all of those disks.
Once you have these 4 disks, you're ready to go. You can also get all
of the files in the b1-b7 directories (for extras, like man pages and
emacs), c1-c4 directories (for the GCC compiler and libraries), the
x1-x8 directories (for Xwindows), and so on, but they're all optional.
I suggest at least getting the files in the a, b, and c directories.
Remember that only the a1 and a2 images need to be rawritten, ALL of
the other files just do onto the floppies in DOS format.
First you boot the a1 disk. It will load up Linux, and will ask you to
put in the a2 disk at some point. You'll be left with a prompt... from
here you want to look at the SLS README file on-line (it tells you
how). Then you'll run 'fdisk' to create your Linux partition(s), and
then reboot the a1 disk again (putting in the a2 disk, again, when
asked). Then you'll run 'mkfs' and 'mkswap' to make your filesystems
and swap space. Then you're ready to install the software-- type
doinstall /dev/PART
where PART is the main Linux partition you created with fdisk, above.
>From here on it's pretty automatic-- you simply flip disks while it
installs the software. First it will ask you how much software you
plan to install-- just choose the correct option depending on which
sets of disks you got.
You will need to have a blank DOS-formatted floppy on hand. The
installation procedure makes a Linux kernel boot disk out of it.
QUESTION: What's about SLS ?
ANSWER: (this is part of the FAQ written for SLS 0.98p5 by Peter
MacDonald).
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.
So, why am I telling you this? After the next period of stability
(few changes to SLS), I will be uploading the Softlanding version of
SLS to tsx-11.mit.edu.
This distribution is freely available if you have internet
access, or an obliging friend with access to it.
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.
SLS is a binary mostly distribution (except for the kernel), and is
broken into multiple parts, or series, each of which is denoted by a
letter followed by the disk number as follows:
a1-aN: The minimal base system
b1-bN: Base system extras, like man pages, emacs etc.
c1-cN: The compiler(s), gcc/g++/p2c/f2c
x1-xN: The X-windows distribution
i1-iN: Interviews (doc and idraw)
t1-tN: TeX (document processing)
This scheme allows new disks to be added to the distribution without
changing the disk numbering. Also, the sysinstall program doesn't
have to be changed when new disks are added as the last disk is marked
by the presence of the file "install.end". And when interviews is
added, say as a new series "i", it can be installed with:
sysinstall -series i
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.
AVAILABILITY
SLS is available 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
QUESTION: What should I get to install the bootdisk/rootdisk combo
release?
ANSWER: Essentially it's a lot like the SLS installation, above. You
get the boot disk and root disk, and use rawrite to transfer them to
floppies. Then you boot the boot disk, and put in the root disk when
asked. At this point you login as 'install' to install the software.
QUESTION: How do I get and install H.J. Lu's "bootable rootdisk" release?
ANSWER: It's just like the boot/root disk and the 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. :)
QUESTION: What is the MCC interim version of Linux?
ANSWER: The MCC-Interim release of Linux was put together by Owen
LeBlanc of the Manchester Computing Centre. Unfortunately, it's quite
dated, and isn't going to be updated anymore. :(
III.C. SOME COMMON PROBLEMS
~~~~~~~~~~~~~~~~~~~~~~~~~~~
QUESTION: 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 seperate partitions for your /usr
filesystem, etc. (however, the SLS doinstall program, at this point,
mounts your root filesystem for you before installing, thus, you can't
have a seperate /usr filesystem to start out with).
But that's beside the point. 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 run 'fdisk' to create your partitions: it's very self-
explanatory. If you make a swap partition you need to change it's type
to "Linux swap" with the fdisk 't' command.
And, if you want a Linux partition larger than 64 megabytes, you'll
need to use the extended filesystem (as opposed to the default, the
Minix filesystem). The extended filesystem ("extfs" for short) has a
4 terabyte size limit (and lets you have filenames longer than 14
characters). If you want to use it just set the type of the partition
to "Linux extfs" with the fdisk 't' command.
NOTE: "Extended filesystem" does NOT equal "extended partition". An
extended partition acts as a "container" for logical partitions, which
is nice because you can have many logical partitions inside the
extended partition, and only use up one of your four available primary
partitions on the drive. (You can have only one extended partition
per drive). Extended partition can't hold data on their own: you need
to create logical partitions on top of it first. They are numbered
/dev/hda5, /dev/hda6, and so on.
The extended FILESYSTEM on the other hand has nothing to do with
extended partitions. It's just the name of another filesystem used by
Linux which lets you have larger filesystem sizes and other features.
Once you've got your partitions created, you need to reboot the system
so that changes to your partition table are picked up. Then you need
to 'format' the partitions (i.e. create filesystems on them). For your
swap partition, use the command 'mkswap <partition> <size>'. For
example, if you have a swap partition on /dev/hda2 with a size of 8208
blocks (about 8 megs), use the command
mkswap /dev/hda2 8208
If you have a partition set up for a Minix filesystem (the default
type) use the command 'mkfs <partition> <size>'. If however you're
going to use the extended filesystem (a must for partitions over 64
megs) use the command 'mkefs <partition> <size>'.
QUESTION: 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.
QUESTION: 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.
NOTE: This is only needed for older RLL and MFM drives. SCSI and IDE
drives have bad block logic on-board.
Generating a bad block list for mk(e)fs
=======================================
Nov 11, 1992 Gerhard Kircher (kircher@neuro.tuwien.ac.at)
Introduction
------------
First of all: the -c option (check bad
blocks) of mk(e)fs does not work (the code used cannot detect any bad
blocks). Fortunately there is another option -l <file> to tell
mk(e)fs where the bad blocks are. SCSI and IDE drive users do not
need any bad block management - the drive logic does it for them.
However, users of old MFM or RLL drives do need it.
1 Where are my bad blocks ?
---------------------------
Every MFM or RLL drive is tested by the manufacturer and the locations
of bad blocks are usually printed directly on the drive case. If you
cannot find any bad block information on your drive, you can use the
common disk test software (Norton,...) to check your drive and obtain
a defect list.
Locations of bad blocks are given in terms of cylinder and head
coordinates. Cylinder and head together specify a certain track. Some
manufacturers are more specific about the location of the bad spot
within the track but if you know how to use this information you
probably do not need to read this guide. So if we know the track
where the bad spot sits, we declare the entire track as bad (even
experts do this).
What we have now is a table of the form
CYLINDER HEAD
... ...
... ...
... ...
2 calculating all bad sectors
-----------------------------
Each sector on the drive can be addressed by three cordinates:
Cylinder = [0..CYLINDERS-1]
Head = [0..HEADS-1]
Sector = [0..SECTORS-1]
where
CYLINDERS ... total number of cylinders
HEADS ... total number of heads
SECTORS ... number of sectors per track
The absolute address of a sector on the disk is then calculated
according to the formula
Abssector = HEADS*SECTORS*Cylinder + SECTORS*Head + Sector.
We can now calculate the absolute addresses of all sectors
of every bad track on our disk according to
for each bad track given by Cylinder and Head do
begin
for Sector=0 to SECTORS-1 do
begin
Abssector = HEADS*SECTORS*Cylinder + SECTORS*Head + Sector
end
end
obtaining a list of all bad sectors.
3 Converting absolute sectors to partition relative sectors
-----------------------------------------------------------
Partitions are like separate disks, that means that sector counting
starts with 0 for each partition. So what we have to do next is to
generate a bad sector list for each partition we want to use for
linux. To do that, we must know where each partition starts and ends.
We can get this information from fdisk. When we start fdisk and type
'p' to view the partition table, the begin, start and end information
will be given in terms of cylinders. When we type 'u' to toggle the
units, an then again 'p' we get what we need: Start and End of each
partition in terms of absolute sectors. Here is what I see on my
system (I use my second disk for linux):
# fdisk /dev/hdb
Command (m for help): p
Disk /dev/hdb: 8 heads, 17 sectors, 1024 cylinders
Units = cylinders of 136 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hdb1 1 1 963 65483+ 81 Linux/MINIX
/dev/hdb2 964 964 1024 4148 82 Linux swap
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/hdb: 8 heads, 17 sectors, 1024 cylinders
Units = sectors of 1 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hdb1 1 1 130967 65483+ 81 Linux/MINIX
/dev/hdb2 130968 130968 139263 4148 82 Linux swap
Sector counting (as counting always should do :-) starts with 0.
The first partition begins with sector one, as sector 0 is
always the boot sector.
This is how we calculate the addresses for one partition:
a) From the list obtained in section 2, cancel all addresses
that are not in the range [Start..End] (including limits)
shown by fdisk.
b) Subtract Start from each remaining entry.
4 Converting to blocks
----------------------
A disk sector has a length of 512 bytes (this is the usual size
BIOS/DOS can handle). Linux groups two sectors to an entity called
block. A block therefore consists of two physical sectors and has a
size of 1024 bytes (I read somewhere that larger blocks will be
supported in the future). The mk(e)fs program wants to know the
addresses of bad blocks, not sectors. So we convert our partition
relatve sector addresses to partition relative block addresses by
dividing by two and taking the integer part. Doing that we certainly
get a lot of duplicate addresses which we have to get rid of, so we
simply delete redundant entries.
What we have now is a list of bad blocks for each partition. Mk(e)fs
likes to get this information from a file, one address per line, one
file for each partition.
5 Automating the process
------------------------
Doing all the calculations by hand is tedious and error prone.
So we may decide to automate the whole thing.
We can do everything in dos when we use the proper utilities
(see later)
5.1 The Input File
We need a single file containing the coordinates of all bad tracks of
one entire disk. Each line of the file consists of two fields, the
first of which is the cylinder number and the second is the head
number. These are the first few lines of the file for my second disk:
48 0
105 4
150 2
224 1
380 2
427 6
435 1
5.2 An AWK script for doing all the calculations
In the following we present an awk script that does all the work for
us. We just have to plug in the correct values of the partition and
drive parameters and off we go. I use gawk211.zip and sort03.arc
which I downloaded from a simtel20 mirror. Sort is used to remove the
duplicates.
#---the awk script starts here
# generates linux bad blocks file (starting count with 0)
# for partition ONE
# for micropolis drive 8 heads, 17 sectors
# input file: cyl[0.. ] head[0.. ]\n
# stdout: abs blocks of corresponding partition\n
BEGIN { start = 1;
end = 130967;
sectors = 17;
heads = 8;
}
{ sec=$1*sectors*heads+$2*sectors;
if (sec>=start && sec<=end)
for (i=0; i<sectors; i++) print int((sec-start+i)/2) | "sort -mu"
}
#---the awk script ends here
Suppose that our input file is named 'badtrack.lst' and that the awk
file is 'part1.awk', then we can generate a bad block list for mk(e)fs
by typing the command
gawk -f part1.awk badtrack.lst > badblk1.lst
This is the file we need.
5.3 Making the file system
What we must do now is to have this file accessible for linux during
installation. There are several ways to do this. You can either mount
your DOS partition and copy the file over to Linux, or use mtools (as
in 'mcopy c:badblk1.lst /user/badblocks').
Now we can make the file system. In this case the bad blocks file is
in /user/badblocks, and the partition we're making a filesystem on is
/dev/hdb1. We're making an extended filesystem with a size of 65483
blocks:
mkefs -l /user/badblocks /dev/hdb1 65483
Thats it!
Bugs
----
I only tried mkfs but I'm rather convinced that it works with
mkefs as well.
QUESTION: 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.
QUESTION: Cripes! 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 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 boot record. Now you can go back and reinstall LILO.
:)
QUESTION: 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.
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.
QUESTION: 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 (who knows why). 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.
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.
QUESTION: 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 delete a file from the
copy over it 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.
QUESTION: I have the previous Linux version, 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. 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'.
QUESTION: 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.
QUESTION: How can I upgrade to the newest version of GCC?
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 .TZ). The names change from time
to time: you need to get the compiler (often in a file such as
'gcc233.TZ'), 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.
QUESTION: What's the deal with these things called "jump tables"?
ANSWER: There's more information in section IX and VII, but to be
brief: There are three 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/*.ca classic shared lib stubs (use gcc -nojump ...)
/usr/lib/*.sa jump table shared lib stubs (use gcc -jump ...)
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
are 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
QUESTION: 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.
QUESTION: 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.
QUESTION: 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.
QUESTION: 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.
QUESTION: 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 -v /Image
Then use OS/2's fdisk to add it to the Boot Manager.
QUESTION: 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.
QUESTION: (Denise Tree)
Where is /usr/include/linux and /usr/include/asm?" or "Why
won't my new kernel source compile without errors?", etc.
ANSWER: These directories exist as symbolic links to the online linux
kernel source found (usually) in /usr/src/linux/include/linux/* and
/usr/src/linux/include/asm/*. Do:
ln -fs /usr/src/linux/include/linux /usr/include/linux
ln -fs /usr/src/linux/include/asm /usr/include/asm
to create the symlinks. OR ELSE! It's a good idea to keep kernel
source on your system because the header files are needed for
compilations other than the kernel.
IV. SOME CLASSICAL PROBLEMS
===========================
QUESTION: 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), 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).
QUESTION: How can I partition my hard-drive to use Linux?
ANSWER: See section III of the FAQ on installation.
QUESTION: 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.
QUESTION: 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).
QUESTION: I have some trouble with tar/untar; any clue ?
ANSWER: The tar provided on .96 and latter is Pax (don't know for .98)
which do not accept the z flag. You can download the GNU tar at tsx-11
in /pub/linux/binaries/usr.bin
QUESTION: 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?
QUESTION: "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 $* }
QUESTION: 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~
QUESTION: 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
QUESTION: 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)
QUESTION: 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
QUESTION: I can only log-in as "root", is it normal ?
ANSWER: No, add "rm -f /etc/nologin" in your /etc/rc.local file
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 02.02.93
QUESTION: 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.
QUESTION: 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
QUESTION: 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.
QUESTION: 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
QUESTION: 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.
QUESTION: 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).
QUESTION: 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 disk. This has been fixed in the
latest release (alpha.9)
QUESTION: 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.
QUESTION: 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 9), and an abbreviated version of this in the MCC
interim package.
QUESTION: 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 the rawrite stuff or the mount procedure.
QUESTION: Could someone explain how to use rawrite?
ANSWER: Well, rawrite is a DOS util, which write sequential sector 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
QUESTION: 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.
QUESTION: 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 Anyway there are a few differences
between these and normal DOS assemblers.
QUESTION: 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.
QUESTION: 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
QUESTION: 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@labri.greco-prog.fr #
# 33405 Talence Cedex | #
# | #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
There will be a sig when our local net is reliable.
For now, I would rather stay anonymous.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Linux Frequently Asked Questions 2/4 [monthly posted]
@ 1993-04-06 5:17 corsini
0 siblings, 0 replies; 3+ messages in thread
From: corsini @ 1993-04-06 5:17 UTC (permalink / raw)
Archive-name: linux-faq/part2
Last-Modified: 93/03/28
Version: 1.16.1
*********************************************************
* *
* Answers to Frequently asked questions about Linux *
* *
*********************************************************
This post contains Part 2 of the Linux FAQ (4 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 kept up-to-date, and 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 March 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. Wizenius
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),
but Linux mainly uses the minix filesystem which limits filesystems to
64 megs each. You can also use the extended filesystem (which is still
in testing, but has been included with recent kernel versions) which has
a limit of 4 terabytes. Probably enough unless you have a disk array. :)
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 14 disks for Linux
and 8 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 2 disks must be "rawritten" (using rawrite.exe) on floppies,
and the rest of the images are put onto DOS format floppies.
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 images and docs are found at tsx-11.mit.edu:/pub/linux.
* Others but OUTDATED
There are other releases and distributions of the Linux software,
such as the "MCC-Interim" and "MJ" releases. 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 MCC-Interim release (the previous de facto Linux standard)
isn't going to be updated anymore, according to Owen LeBlanc. So
if you install it, be warned that you'll have to upgrade it all
in some other way (the last version of MCC-Interim was 0.97.2,
quite dated).
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 versions 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 should I do to install 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.
For the SLS release, you need to get the files in the a1, a2, a3, and
a4 directories at least. You also need the README's there. Basically,
you use rawrite to copy the a1 and a2 images onto floppies. Or, you
can use 'dd' on your UNIX system to transfer the files directly to
floppies (assuming you have a floppy drive on your UNIX system) in
place of rawrite.
The rest of the files all go onto DOS-formatted floppies, just using
DOS copy. The SLS release is nice because it reads the DOS floppies
during installation, so you don't have to rawrite all of those disks.
Once you have these 4 disks, you're ready to go. You can also get all
of the files in the b1-b7 directories (for extras, like man pages and
emacs), c1-c4 directories (for the GCC compiler and libraries), the
x1-x8 directories (for Xwindows), and so on, but they're all optional.
I suggest at least getting the files in the a, b, and c directories.
Remember that only the a1 and a2 images need to be rawritten, ALL of
the other files just do onto the floppies in DOS format.
First you boot the a1 disk. It will load up Linux, and will ask you to
put in the a2 disk at some point. You'll be left with a prompt... from
here you want to look at the SLS README file on-line (it tells you
how). Then you'll run 'fdisk' to create your Linux partition(s), (see
section III.C, below, for info on making partitions), and
then reboot the a1 disk again (putting in the a2 disk, again, when
asked). Then you'll run 'mkfs' and 'mkswap' to make your filesystems
and swap space. Then you're ready to install the software-- type
doinstall /dev/PART
where PART is the main Linux partition you created with fdisk, above.
>From here on it's pretty automatic-- you simply flip disks while it
installs the software. First it will ask you how much software you
plan to install-- just choose the correct option depending on which
sets of disks you got.
You will need to have a blank DOS-formatted floppy on hand. The
installation procedure makes a Linux kernel boot disk out of it.
III.06) What's about SLS ?
ANSWER: (this is part of the FAQ written for SLS 0.98p5 by Peter
MacDonald).
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.
So, why am I telling you this? After the next period of stability
(few changes to SLS), I will be uploading the Softlanding version of
SLS to tsx-11.mit.edu.
This distribution is freely available if you have internet
access, or an obliging friend with access to it.
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.
SLS is a binary mostly distribution (except for the kernel), and is
broken into multiple parts, or series, each of which is denoted by a
letter followed by the disk number as follows:
a1-aN: The minimal base system
b1-bN: Base system extras, like man pages, emacs etc.
c1-cN: The compiler(s), gcc/g++/p2c/f2c
x1-xN: The X-windows distribution
i1-iN: Interviews (doc and idraw)
t1-tN: TeX (document processing)
This scheme allows new disks to be added to the distribution without
changing the disk numbering. Also, the sysinstall program doesn't
have to be changed when new disks are added as the last disk is marked
by the presence of the file "install.end". And when interviews is
added, say as a new series "i", it can be installed with:
sysinstall -series i
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.
AVAILABILITY
SLS is available 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.07) What should I get to install the bootdisk/rootdisk combo
release?
ANSWER: Essentially it's a lot like the SLS installation, above. You
get the boot disk and root disk, and use rawrite to transfer them to
floppies. Then you boot the boot disk, and put in the root disk when
asked. At this point you login as 'install' to install the software.
III.08) How do I get and install H.J. Lu's "bootable rootdisk" release?
ANSWER: It's just like the boot/root disk and the 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. :)
III.09) What is the MCC interim version of Linux?
ANSWER: The MCC-Interim release of Linux was put together by Owen
LeBlanc of the Manchester Computing Centre. Unfortunately, it's quite
dated, and isn't going to be updated anymore. :(
III.C. SOME COMMON PROBLEMS
~~~~~~~~~~~~~~~~~~~~~~~~~~~
III.10) 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.11) 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 seperate partitions for your /usr
filesystem, etc. (however, the SLS doinstall program, at this point,
mounts your root filesystem for you before installing, thus, you can't
have a seperate /usr filesystem to start out with).
But that's beside the point. 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 run 'fdisk' to create your partitions: it's very self-
explanatory. If you make a swap partition you need to change it's type
to "Linux swap" with the fdisk 't' command.
And, if you want a Linux partition larger than 64 megabytes, you'll
need to use the extended filesystem[*] (as opposed to the default, the
Minix filesystem). The extended filesystem ("extfs" for short) has a
4 terabyte size limit (and lets you have filenames longer than 14
characters). If you want to use it just set the type of the partition
to "Linux extfs" with the fdisk 't' command.
[*] You can also use the Xia filesystem (xiafs) or ext2fs (better version of
the extended filesystem). These two filesystems are proving to be more
widely used as both the extfs and the Minix filesystem are being phased out.
Both of them are now included in SLS. Use "mkxfs" to create Xia filesystems,
and "mke2fs" to make Extdended 2 Filesystems. As most installations are
phasing out the Minix and Extended filesystems I suggest using xiafs or ext2fs.
NOTE: "Extended filesystem" does NOT equal "extended partition". An
extended partition acts as a "container" for logical partitions, which
is nice because you can have many logical partitions inside the
extended partition, and only use up one of your four available primary
partitions on the drive. (You can have only one extended partition
per drive). Extended partition can't hold data on their own: you need
to create logical partitions on top of it first. They are numbered
/dev/hda5, /dev/hda6, and so on.
The extended FILESYSTEM on the other hand has nothing to do with
extended partitions. It's just the name of another filesystem used by
Linux which lets you have larger filesystem sizes and other features.
Once you've got your partitions created, you need to reboot the system
so that changes to your partition table are picked up. Then you need
to 'format' the partitions (i.e. create filesystems on them). For your
swap partition, use the command 'mkswap <partition> <size>'. For
example, if you have a swap partition on /dev/hda2 with a size of 8208
blocks (about 8 megs), use the command
mkswap /dev/hda2 8208
If you have a partition set up for a Minix filesystem (the default
type) use the command 'mkfs <partition> <size>'. If however you're
going to use the extended filesystem (a must for partitions over 64
megs) use the command 'mkefs <partition> <size>'. (Note: If you use the
ext2fs, you'll have to use mke2fs, and if you use Xia filesystem, you'll
have to use mkxfs when creating the filesystems).
III.12) Why does fdisk say "Linux cannot currently use XXXX sectors of
this partition"?
ANSWER: 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.13) 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 root 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 the
root device set to the wrong partition, for example, then the kernel should
hang at this point and you'll have to use "rdev" to set it correctly.
III.14) 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.15) 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.
NOTE: This is only needed for older RLL and MFM drives. SCSI and IDE
drives have bad block logic on-board.
Generating a bad block list for mk(e)fs
=======================================
Nov 11, 1992 Gerhard Kircher (kircher@neuro.tuwien.ac.at)
Introduction
------------
First of all: the -c option (check bad
blocks) of mk(e)fs does not work (the code used cannot detect any bad
blocks). Fortunately there is another option -l <file> to tell
mk(e)fs where the bad blocks are. SCSI and IDE drive users do not
need any bad block management - the drive logic does it for them.
However, users of old MFM or RLL drives do need it.
1 Where are my bad blocks ?
---------------------------
Every MFM or RLL drive is tested by the manufacturer and the locations
of bad blocks are usually printed directly on the drive case. If you
cannot find any bad block information on your drive, you can use the
common disk test software (Norton,...) to check your drive and obtain
a defect list.
Locations of bad blocks are given in terms of cylinder and head
coordinates. Cylinder and head together specify a certain track. Some
manufacturers are more specific about the location of the bad spot
within the track but if you know how to use this information you
probably do not need to read this guide. So if we know the track
where the bad spot sits, we declare the entire track as bad (even
experts do this).
What we have now is a table of the form
CYLINDER HEAD
... ...
... ...
... ...
2 calculating all bad sectors
-----------------------------
Each sector on the drive can be addressed by three cordinates:
Cylinder = [0..CYLINDERS-1]
Head = [0..HEADS-1]
Sector = [0..SECTORS-1]
where
CYLINDERS ... total number of cylinders
HEADS ... total number of heads
SECTORS ... number of sectors per track
The absolute address of a sector on the disk is then calculated
according to the formula
Abssector = HEADS*SECTORS*Cylinder + SECTORS*Head + Sector.
We can now calculate the absolute addresses of all sectors
of every bad track on our disk according to
for each bad track given by Cylinder and Head do
begin
for Sector=0 to SECTORS-1 do
begin
Abssector = HEADS*SECTORS*Cylinder + SECTORS*Head + Sector
end
end
obtaining a list of all bad sectors.
3 Converting absolute sectors to partition relative sectors
-----------------------------------------------------------
Partitions are like separate disks, that means that sector counting
starts with 0 for each partition. So what we have to do next is to
generate a bad sector list for each partition we want to use for
linux. To do that, we must know where each partition starts and ends.
We can get this information from fdisk. When we start fdisk and type
'p' to view the partition table, the begin, start and end information
will be given in terms of cylinders. When we type 'u' to toggle the
units, an then again 'p' we get what we need: Start and End of each
partition in terms of absolute sectors. Here is what I see on my
system (I use my second disk for linux):
# fdisk /dev/hdb
Command (m for help): p
Disk /dev/hdb: 8 heads, 17 sectors, 1024 cylinders
Units = cylinders of 136 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hdb1 1 1 963 65483+ 81 Linux/MINIX
/dev/hdb2 964 964 1024 4148 82 Linux swap
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/hdb: 8 heads, 17 sectors, 1024 cylinders
Units = sectors of 1 * 512 bytes
Device Boot Begin Start End Blocks Id System
/dev/hdb1 1 1 130967 65483+ 81 Linux/MINIX
/dev/hdb2 130968 130968 139263 4148 82 Linux swap
Sector counting (as counting always should do :-) starts with 0.
The first partition begins with sector one, as sector 0 is
always the boot sector.
This is how we calculate the addresses for one partition:
a) From the list obtained in section 2, cancel all addresses
that are not in the range [Start..End] (including limits)
shown by fdisk.
b) Subtract Start from each remaining entry.
4 Converting to blocks
----------------------
A disk sector has a length of 512 bytes (this is the usual size
BIOS/DOS can handle). Linux groups two sectors to an entity called
block. A block therefore consists of two physical sectors and has a
size of 1024 bytes (I read somewhere that larger blocks will be
supported in the future). The mk(e)fs program wants to know the
addresses of bad blocks, not sectors. So we convert our partition
relatve sector addresses to partition relative block addresses by
dividing by two and taking the integer part. Doing that we certainly
get a lot of duplicate addresses which we have to get rid of, so we
simply delete redundant entries.
What we have now is a list of bad blocks for each partition. Mk(e)fs
likes to get this information from a file, one address per line, one
file for each partition.
5 Automating the process
------------------------
Doing all the calculations by hand is tedious and error prone.
So we may decide to automate the whole thing.
We can do everything in dos when we use the proper utilities
(see later)
5.1 The Input File
We need a single file containing the coordinates of all bad tracks of
one entire disk. Each line of the file consists of two fields, the
first of which is the cylinder number and the second is the head
number. These are the first few lines of the file for my second disk:
48 0
105 4
150 2
224 1
380 2
427 6
435 1
5.2 An AWK script for doing all the calculations
In the following we present an awk script that does all the work for
us. We just have to plug in the correct values of the partition and
drive parameters and off we go. I use gawk211.zip and sort03.arc
which I downloaded from a simtel20 mirror. Sort is used to remove the
duplicates.
#---the awk script starts here
# generates linux bad blocks file (starting count with 0)
# for partition ONE
# for micropolis drive 8 heads, 17 sectors
# input file: cyl[0.. ] head[0.. ]\n
# stdout: abs blocks of corresponding partition\n
BEGIN { start = 1;
end = 130967;
sectors = 17;
heads = 8;
}
{ sec=$1*sectors*heads+$2*sectors;
if (sec>=start && sec<=end)
for (i=0; i<sectors; i++) print int((sec-start+i)/2) | "sort -mu"
}
#---the awk script ends here
Suppose that our input file is named 'badtrack.lst' and that the awk
file is 'part1.awk', then we can generate a bad block list for mk(e)fs
by typing the command
gawk -f part1.awk badtrack.lst > badblk1.lst
This is the file we need.
5.3 Making the file system
What we must do now is to have this file accessible for linux during
installation. There are several ways to do this. You can either mount
your DOS partition and copy the file over to Linux, or use mtools (as
in 'mcopy c:badblk1.lst /user/badblocks').
Now we can make the file system. In this case the bad blocks file is
in /user/badblocks, and the partition we're making a filesystem on is
/dev/hdb1. We're making an extended filesystem with a size of 65483
blocks:
mkefs -l /user/badblocks /dev/hdb1 65483
Thats it!
Bugs
----
I only tried mkfs but I'm rather convinced that it works with
mkefs as well.
III.16) 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.
III.17) Cripes! 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.18) 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.
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.19) 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.20) 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.21) 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.22) 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.
III.23) 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.24) 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.25) 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 .TZ). The names change from time
to time: you need to get the compiler (often in a file such as
'gcc233.TZ'), 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.26) What's the deal with these things called "jump tables"?
ANSWER: There's more information in section IX and VII, but to be
brief: There are three 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.27) 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.28) 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.29) 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.30) 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.31) 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 -v /Image
Then use OS/2's fdisk to add it to the Boot Manager.
III.32) 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================
--
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1993-04-06 5:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-04-06 5:17 Linux Frequently Asked Questions 2/4 [monthly posted] corsini
-- strict thread matches above, loose matches on Subject: below --
1993-02-18 17:41 Linux Frequently Asked Questions 1/4 " corsini
1993-02-18 17:41 ` Linux Frequently Asked Questions 2/4 " corsini
[not found] <PART1_729797776@geocub.greco-prog.fr>
1993-02-15 17:36 ` corsini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox