summaryrefslogtreecommitdiff
path: root/sag-0.6.1-www/Invisible/sag-0.6/node21.html
blob: c0e68cfb8e7269f8b3058b0ae493558a5e77efb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Background</TITLE>
<META NAME="description" CONTENT="Background">
<META NAME="keywords" CONTENT="sag">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="sag.css">
</HEAD>
<BODY LANG="EN" >
 <A NAME="tex2html556" HREF="node22.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html554" HREF="node20.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html548" HREF="node20.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html558" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html559" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html557" HREF="node22.html">The root filesystem</A>
<B>Up:</B> <A NAME="tex2html555" HREF="node20.html">Overview of the Directory </A>
<B> Previous:</B> <A NAME="tex2html549" HREF="node20.html">Overview of the Directory </A>
<BR> <P>
<H1><A NAME="SECTION00410000000000000000">Background</A></H1>
<P>
	This chapter is loosely based on the Linux filesystem
	standard, FSSTND, version 1.2 (see the bibliography, 
	[<A HREF="node113.html#fsstnd-1.2">Qui95</A>]), which attempts
	to set a standard for how the directory tree in a Linux system
	is organized.  Such a standard has the advantage that
	it will be easier to
	write or port software for Linux, and to administer Linux
	machines, since everything will be in their usual places.  There
	is no authority behind the standard that forces anyone to comply
	with it, but it has got the support of most, if not all, Linux
	distributions.  It is not a good idea to break with the FSSTND
	without very compelling reasons.  The FSSTND attempts to follow
	Unix tradition and current trends, making Linux systems familiar
	to those with experience with other Unix systems, and vice
	versa.
<P>
	This chapter is not as detailed as the FSSTND.  A system
	administrator should also read the FSSTND for a complete
	understanding.
<P>
	This chapter does not explain all files in detail.  The intention
	is not to describe every file, but to give an overview of the
	system from a filesystem point of view.  Further information on
	each file is available elsewhere in this manual or the manual
	pages.
<P>
	The full directory tree is intended to be breakable into smaller
	parts, each on its own disk or partition, to accomodate to disk
	size limits and to ease backup and other system administration.
	The major parts are the root, <tt>/usr</tt><A NAME="638">&#160;</A>, <tt>/var</tt><A NAME="640">&#160;</A>, and
	<tt>/home</tt><A NAME="642">&#160;</A> filesystems (see figure&nbsp;<A HREF="node21.html#figfstree">3.1</A>).  
	Each part has a different purpose.
	The directory tree has been designed so that it works well in a
	network of Linux machines which may share some parts of the
	filesystems over a read-only device (e.g., a CD-ROM), or
	over the network with NFS.
<P>
		<P><A NAME="428">&#160;</A><A NAME="figfstree">&#160;</A><IMG WIDTH=438 HEIGHT=220 ALIGN=BOTTOM ALT="figure424" SRC="img3.gif"><BR>
<STRONG>Figure 3.1:</STRONG> Parts of a Unix directory tree.
			Dashed lines indicate partition limits.<BR>
<P>
<P>
	The roles of the different parts of the directory tree are
	described below.
	<UL>
<LI>
	The root filesystem is specific for each machine (it is generally
	stored on a local disk, although it could be a ramdisk or network
	drive as well) and contains the
	files that are necessary for booting the system up, and to bring
	it up to such a state that the other filesystems may be mounted.
	The contents of the root filesystem will therefore be sufficient
	for the single user state.  It will also contain tools for
	fixing a broken system, and for recovering lost files from backups.
<LI>
	The <tt>/usr</tt><A NAME="644">&#160;</A> filesystem contains all commands, libraries, manual
	pages, and other unchanging files needed during normal operation.
	No files in <tt>/usr</tt><A NAME="646">&#160;</A> should be specific for any given machine,
	nor should they be modified during normal use.  This allows the
	files to be shared over the network, which can be cost-effective
	since it saves disk space (there can easily be hundreds of
	megabytes in <tt>/usr</tt><A NAME="648">&#160;</A>), and can make administration easier
	(only the master <tt>/usr</tt><A NAME="650">&#160;</A> needs to be changed when updating
	an application, not each machine separately).  Even if the
	filesystem is on a local disk, it could be mounted read-only,
	to lessen the chance of filesystem corruption during a crash.
<LI>
	The <tt>/var</tt><A NAME="652">&#160;</A> filesystem contains files that change, such as
	spool directories (for mail, news, printers, etc), log files,
	formatted manual pages, and temporary files.  Traditionally
	everything in <tt>/var</tt><A NAME="654">&#160;</A> has been somewhere below <tt>/usr</tt><A NAME="656">&#160;</A>,
	but that made it impossible to mount <tt>/usr</tt><A NAME="658">&#160;</A> read-only.
<LI>
	The <tt>/home</tt><A NAME="660">&#160;</A> filesystem contains the users' home directories,
	i.e., all the real data on the system.  Separating home directories
	to their own directory tree or filesystem makes backups easier;
	the other parts often do not have to be backed up, or at least not
	as often (they seldom change).  A big <tt>/home</tt><A NAME="662">&#160;</A> might have to	
	be broken on several filesystems, which requires adding an extra
	naming level below <tt>/home</tt><A NAME="664">&#160;</A>, e.g., <tt>/home/students</tt><A NAME="666">&#160;</A> and
	<tt>/home/staff</tt><A NAME="668">&#160;</A>.
	</UL>
	Although the different parts have been called filesystems above,
	there is no requirement that they actually be on separate filesystems.
	They could easily be kept in a single one if the system is
	a small single-user system and the user wants to keep things simple.
	The directory tree might also be divided into filesystems differently,
	depending on how large the disks are, and how space is allocated
	for various purposes.
	The important part, though, is that all the standard <em>names</em>
	work; even if, say, <tt>/var</tt><A NAME="670">&#160;</A> and <tt>/usr</tt><A NAME="672">&#160;</A> are actually on the
	same partition, the names <tt>/usr/lib/libc.a</tt><A NAME="674">&#160;</A> and
	<tt>/var/adm/messages</tt><A NAME="676">&#160;</A> must work, for example by moving files
	below <tt>/var</tt><A NAME="678">&#160;</A> into <tt>/usr/var</tt><A NAME="680">&#160;</A>, and making <tt>/var</tt><A NAME="682">&#160;</A> a symlink
	to <tt>/usr/var</tt><A NAME="684">&#160;</A>.
<P>
	The Unix filesystem structure groups files according to purpose,
	i.e., all commands are in one place, all data files in another,
	documentation in a third, and so on.  An alternative would be to
	group files files according to the program they belong to, i.e.,
	all Emacs files would be in one directory, all TeX in another,
	and so on.  The problem with the latter approach is that it
	makes it difficult to share files (the program directory often
	contains both static and shareable and changing and
	non-shareable files), and sometimes to even find the files
	(e.g., manual pages in a huge number of places, and making the
	manual page programs find all of them is a maintenance
	nightmare).
<P>
<HR><A NAME="tex2html556" HREF="node22.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html554" HREF="node20.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html548" HREF="node20.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html558" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html559" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html557" HREF="node22.html">The root filesystem</A>
<B>Up:</B> <A NAME="tex2html555" HREF="node20.html">Overview of the Directory </A>
<B> Previous:</B> <A NAME="tex2html549" HREF="node20.html">Overview of the Directory </A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sat Nov 15 02:32:11 EET 1997</I>
</ADDRESS>
</BODY>
</HTML>