This commit is contained in:
binh 2003-09-09 11:47:02 +00:00
parent db89f1bdb6
commit 0ef74b0766
2 changed files with 221 additions and 0 deletions

View File

@ -0,0 +1,52 @@
<chapter id="/lost+found">
<title>/lost+found</title>
<para>
As was explained earlier during the overview of the FSSTND, Linux should
always go through a proper shutdown. Sometimes your system might crash
or a power failure might take the machine down. Either way, at the next
boot, a lengthy filesystem check (the speed of this check is dependent on
the type of filesystem that you actually use. ie. ext3 is faster than ext2
because it is a journalled filesystem) using fsck will be done. Fsck will
go through the system and try to recover any corrupt files that it finds.
The result of this recovery operation will be placed in this directory.
The files recovered are not likely to be complete or make much sense but
there always is a chance that something worthwhile is recovered. Each
partition has its own lost+found directory. If you find files in there,
try to move them back to their original location. If you find something
like a broken symbolic link to 'file', you have to reinstall the file/s
from the corresponding RPM, since your file system got damaged so badly
that the files were mutilated beyond recognition. Below is an example of
a /lost+found directory. As you can see, the vast majority of files
contained here are in actual fact sockets. As for the rest of the other
files they were found to be damaged system files and personal files.
These files were not able to be recovered.
</para>
<para>
<screen>
total 368
-rw-r--r-- 1 root root 110891 Oct 5 14:14 #388200
-rw-r--r-- 1 root root 215 Oct 5 14:14 #388201
-rw-r--r-- 1 root root 110303 Oct 6 23:09 #388813
-rw-r--r-- 1 root root 141 Oct 6 23:09 #388814
-rw-r--r-- 1 root root 110604 Oct 6 23:09 #388815a
-rw-r--r-- 1 root root 194 Oct 6 23:09 #388816
srwxr-xr-x 1 root root 0 Oct 6 13:00 #51430
srwxr-xr-x 1 root root 0 Oct 6 00:23 #51433
-rw------- 1 root root 63 Oct 6 00:23 #51434
srwxr-xr-x 1 root root 0 Oct 6 13:00 #51436
srwxrwxrwx 1 root root 0 Oct 6 00:23 #51437
srwx------ 1 root root 0 Oct 6 00:23 #51438
-rw------- 1 root root 63 Oct 6 13:00 #51439
srwxrwxrwx 1 root root 0 Oct 6 13:00 #51440
srwx------ 1 root root 0 Oct 6 13:00 #51442
-rw------- 1 root root 63 Oct 6 23:09 #51443
srwx------ 1 root root 0 Oct 6 10:40 #51445
srwxrwxrwx 1 root root 0 Oct 6 23:09 #51446
srwx------ 1 root root 0 Oct 6 23:09 #51448
</screen>
</para>
</chapter>

View File

@ -0,0 +1,169 @@
<chapter id="/usr">
<title>/usr</title>
<para>/usr usually contains by far the largest share of data on a system. Hence, this is one of the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc.... X and its supporting libraries can be found here. User programs like telnet, ftp, etc.... are also placed here. In the original Unix implementations, /usr was where the home directories of the users were placed (that is to say, /usr/someone was then the directory now known as /home/someone). In current Unices, /usr is where user-land programs and data (as opposed to 'system land' programs and data) are. The name hasn't changed, but it's meaning has narrowed and lengthened from "everything user related" to "user usable programs and data".</para>
<varlistentry><term>/usr/X11R6</term><listitem><para>
<para>Another large subdirectory structure begins here, containing libraries, executables, docs, fonts and much more concerning the X Window System. Its inclusion here is somewhat inconsistent and so is the difference between '/usr' and '/usr/X11R6' directories. One would assume that programs that run on X only have their files in the '/usr/X11R6' hierarchy, while the others use '/usr'. Regrettably, it isn't so. KDE and GNOME put their files in the '/usr' hierarchy, whereas the window manager Window Maker uses '/usr/X11R6'. Documentation files for X11R6 are not in '/usr/X11R6/doc', but primarily in '/usr/X11R6/lib/X11/doc'. This mess is due to the fact that in contrast to other operating systems, the graphical desktop isn't an integral part of the system. Linux is still primarily used on servers, where graphical systems don't make sense.</para>
<para>This hierarchy is reserved for the X Window System, version 11 release 6, and related files. To simplify matters and make XFree86 more compatible with the X Window System on other systems, the following symbolic links must be present if /usr/X11R6 exists:</para>
<para>
<screen>
/usr/bin/X11 -> /usr/X11R6/bin
/usr/lib/X11 -> /usr/X11R6/lib/X11
/usr/include/X11 -> /usr/X11R6/include/X11
</screen>
</para>
<para>
In general, software must not be installed or managed via the above symbolic links. They are intended for utilization by users only. The difficulty is related to the release version of the X Window System - in transitional periods, it is impossible to know what release of X11 is in use.
</para>
</para></listitem></varlistentry>
<varlistentry><term>/usr/X11R6/bin</term><listitem><para>
XFree86 system binaries. These are necessary for the initialisation, configuration and running of the X windowing system. X, xf86config, xauth, xmodmap and even xpenguin are located here.</para></listitem></varlistentry>
<varlistentry><term>/usr/X11R6/include</term><listitem><para>
XFree86 system header files. There are required for the compilation of some applications that utilise the X toolkit.</para></listitem></varlistentry>
<varlistentry><term>/usr/X11R6/lib</term><listitem><para>
XFree86 system libraries.</para></listitem></varlistentry>
<varlistentry><term>/usr/X11R6/lib/modules</term><listitem><para>
XFree86 system modules. These are the modules that X loads upon startup. Without these modules video4linux, DRI and GLX extensions and drivers for certain input devices would cease to function.</para></listitem></varlistentry>
<varlistentry><term>/usr/X11R6/lib/X11/fonts</term><listitem><para>
XFree86 system fonts. Fonts that are utilised by 'xfs' (the X Font Server) and programs of that ilk.</para></listitem></varlistentry>
<varlistentry><term>/usr/bin</term><listitem><para>
This directory contains the vast majority of binaries on your system. Executables in this directory vary widely. For instance vi, gcc, gnome-session and mozilla and are all found here.</para></listitem></varlistentry>
<varlistentry><term>/usr/doc</term><listitem><para>
The central documentation directory. Documentation is actually located in /usr/share/doc and linked from here.</para></listitem></varlistentry>
<varlistentry><term>/usr/etc</term><listitem><para>
Theoretically, that's another directory for configuration files. Virtually unused now.</para></listitem></varlistentry>
<varlistentry><term>/usr/games</term><listitem><para>
Once upon a time, this directory contained network games files. Rarely used now.</para></listitem></varlistentry>
<varlistentry><term>/usr/include</term><listitem><para>
The directory for 'header files', needed for compiling user space source code.</para></listitem></varlistentry>
<varlistentry><term>/usr/include/'package-name'</term><listitem><para>
Application specific header files.</para></listitem></varlistentry>
<varlistentry><term>/usr/info</term><listitem><para>
This directory used to contain the files for the info documentation system. Now they are in '/usr/share/info'.</para></listitem></varlistentry>
<varlistentry><term>/usr/lib</term><listitem><para>
This directory contains program libraries. Libraries are collections of frequently used program routines.</para></listitem></varlistentry>
<varlistentry><term>/usr/local</term><listitem><para>
The original idea behind '/usr/local' was to have a separate ('local') '/usr' directory on every machine besides '/usr', which might be just mounted read-only from somewhere else. It copies the structure of '/usr'. These days, '/usr/local' is widely regarded as a good place in which to keep self-compiled or third-party programs.
The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr. Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr.
</para></listitem></varlistentry>
<varlistentry><term>/usr/man</term><listitem><para>
It once held the man pages. It has been moved to /usr/share/man.</para></listitem></varlistentry>
<varlistentry><term>/usr/sbin</term><listitem><para>
This directory contains programs for administering a system, meant to be run by 'root'. Like '/sbin', it's not part of a user's $PATH. Examples of included binaries here are chroot, useradd, in.tftpd and pppconfig.</para></listitem></varlistentry>
<varlistentry><term>/usr/share</term><listitem><para>
This directory contains 'shareable', architecture-independent files (docs, icons, fonts etc). Note, however, that '/usr/share' is generally not intended to be shared by different operating systems or by different releases of the same operating system. Any program or package which contains or requires data that doesn't need to be modified should store that data in '/usr/share' (or '/usr/local/share', if installed locally). It is recommended that a subdirectory be used in /usr/share for this purpose."</para></listitem></varlistentry>
<varlistentry><term>/usr/share/doc</term><listitem><para>
Location of package specific documentation files. These directories often contain userful information that might not be in the man pages. They may also contain templates and configuration files for certain utilities making configuration that much easier.</para></listitem></varlistentry>
<varlistentry><term>/usr/share/info</term><listitem><para>
Location of 'info' pages. This style of documentation seems to be largely ignored now. Manual pages are in far greater favour.</para></listitem></varlistentry>
<varlistentry><term>/usr/share/man</term><listitem><para>
Manual pages. They are organised into 8 sections, which are explained below.</para></listitem></varlistentry>
<para>
<screen>
man1: User programs
Manual pages that describe publicly accessible commands are contained in this chapter. Most program documentation that a user will need to use is located here.
man2: System calls
This section describes all of the system calls (requests for the kernel to perform operations).
man3: Library functions and subroutines
Section 3 describes program library routines that are not direct calls to kernel services. This and chapter 2 are only really of interest to programmers.
man4: Special files
Section 4 describes the special files, related driver functions, and networking support available in the system. Typically, this includes the device files found in /dev and the kernel interface to networking protocol support.
man5: File formats
The formats for many data files are documented in the section 5. This includes various include files, program output files, and system files.
man6: Games
This chapter documents games, demos, and generally trivial programs. Different people have various notions about how essential this is.
man7: Miscellaneous Manual pages that are difficult to classify are designated as being section 7. The troff and other text processing macro packages are found here.
man8: System administration Programs used by system administrators for system operation and maintenance are documented here. Some of these programs are also occasionally useful for normal users.
</screen>
</para>
<varlistentry><term>/usr/src</term><listitem><para>
The 'linux' sub-directory holds the Linux kernel sources, header-files and documentation.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/RPM</term><listitem><para>
RPM/ provides a substructure for building RPMs from SRPMs. Organiztion of this branch is fairly logical with packages being organised according to a package's architecture.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/RPM/BUILD</term><listitem><para>
Houses RPM binary files that have een built from RPM source files.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/RPM/RPMS/athlon, /usr/src/RPM/RPMS/i386, /usr/src/RPM/RPMS/i486, /usr/src/RPM/RPMS/i586, /usr/src/RPM/RPMS/i686, /usr/src/RPM/RPMS/noarch</term><listitem><para></para></listitem></varlistentry>
<varlistentry><term>/usr/src/RPM/SOURCES</term><listitem><para>
RPM source files.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/RPM/SPECS</term><listitem><para>
RPM spec files.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/RPM/SRPMS</term><listitem><para>
RPM source files.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux</term><listitem><para>
Contains the source code for the Linux kernel.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/.config</term><listitem><para>
The last kernel source configuration. This file is normally created through the 'make config', 'make menuconfig' or 'make xconfig' steps during kernel compilation.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/.depend, /usr/src/linux/.hdepend</term><listitem><para>
'make dep' checks the dependencies of the selections you made when you created your .config file. It ensures that the required files can be found and it builds a list that is to be used during compilation. Should this process be successful these two files are created.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/COPYING</term><listitem><para>
GNU License</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/CREDITS</term><listitem><para>
A partial credits-file of people that have contributed to the Linux project. It is sorted by name and formatted to allow easy grepping and beautification by scripts. The fields are: name (N), email (E), web-address (W), PGP key ID and fingerprint (P), description (D), and snail-mail address (S).</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/MAINTAINERS</term><listitem><para>
List of maintainers and details on how to submit kernel changes.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/Makefile</term><listitem><para>
Contains data necessary for compilation of a working kernel. It allows developers and end-users to compile a kernel with a few simple steps (ie. make dep, make clean, make bzImage, make modules, make modules_install) and also not have to worry about re-compiling everything from scratch if parts of it have already been done so and are up to date.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/README</term><listitem><para>
These are the release notes for Linux version 2.4. Read them carefully, as they tell you what this is all about, explain how to install the kernel, and what to do if something goes wrong.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/REPORTING-BUGS</term><listitem><para>
A suggested procedure for reporting Linux bugs. You aren't obliged to use the bug reporting format, it is provided as a guide to the kind of information that can be useful to developers - no more.</para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/Rules.make</term><listitem><para></para></listitem></varlistentry>
<varlistentry><term>/usr/src/linux/Documentation</term><listitem><para>
Contains documentation that may be necessary in order to re-compile a kernel. However, it also provides quite a lot of information about your Linux system in general as well. For those who wish to seek further information on the contents of this directory you may consult the /usr/src/linux/Documentation/00-INDEX file.</para></listitem></varlistentry>
<varlistentry><term>/usr/tmp</term><listitem><para>
User space temporary files. This directory is not found on modern distributions at all and was most likely created as a consequence of Linux's UNIX heritage.</para></listitem></varlistentry>
</chapter>