diff options
Diffstat (limited to 'sag-0.6.1-www/sag-0.6.1.html/x1384.html')
-rw-r--r-- | sag-0.6.1-www/sag-0.6.1.html/x1384.html | 460 |
1 files changed, 460 insertions, 0 deletions
diff --git a/sag-0.6.1-www/sag-0.6.1.html/x1384.html b/sag-0.6.1-www/sag-0.6.1.html/x1384.html new file mode 100644 index 0000000..677cfa2 --- /dev/null +++ b/sag-0.6.1-www/sag-0.6.1.html/x1384.html @@ -0,0 +1,460 @@ +<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN"> +<HTML +><HEAD +><TITLE +>Allocating disk space</TITLE +><META +NAME="GENERATOR" +CONTENT="Modular DocBook HTML Stylesheet"><LINK +REL="HOME" +TITLE="The Linux System Administrators' Guide" +HREF="book1.html"><LINK +REL="UP" +TITLE="Using Disks and Other Storage Media" +HREF="c701.html"><LINK +REL="PREVIOUS" +TITLE="Disks without filesystems" +HREF="x1366.html"><LINK +REL="NEXT" +TITLE="Memory Management" +HREF="c1450.html"></HEAD +><BODY +BGCOLOR="#FFFFFF" +TEXT="#000000" +><DIV +CLASS="NAVHEADER" +><TABLE +WIDTH="100%" +BORDER="0" +CELLPADDING="0" +CELLSPACING="0" +><TR +><TH +COLSPAN="3" +ALIGN="center" +>The Linux System Administrators' Guide</TH +></TR +><TR +><TD +WIDTH="10%" +ALIGN="left" +VALIGN="bottom" +><A +HREF="x1366.html" +>Prev</A +></TD +><TD +WIDTH="80%" +ALIGN="center" +VALIGN="bottom" +>Chapter 4. Using Disks and Other Storage Media</TD +><TD +WIDTH="10%" +ALIGN="right" +VALIGN="bottom" +><A +HREF="c1450.html" +>Next</A +></TD +></TR +></TABLE +><HR +ALIGN="LEFT" +WIDTH="100%"></DIV +><DIV +CLASS="SECT1" +><H1 +CLASS="SECT1" +><A +NAME="AEN1384" +>Allocating disk space</A +></H1 +><DIV +CLASS="SECT2" +><H2 +CLASS="SECT2" +><A +NAME="AEN1386" +>Partitioning schemes</A +></H2 +><P +>It is not easy to partition a disk in the best possible way. + Worse, there is no universally correct way to do it; there are + too many factors involved.</P +><P +>The traditional way is to have a (relatively) small + root filesystem, which contains <TT +CLASS="FILENAME" +>/bin</TT +>, + <TT +CLASS="FILENAME" +>/etc</TT +>, <TT +CLASS="FILENAME" +>/dev</TT +>, + <TT +CLASS="FILENAME" +>/lib</TT +>, <TT +CLASS="FILENAME" +>/tmp</TT +>, and other + stuff that is needed to get the system up and running. This way, + the root filesystem (in its own partition or on its own disk) + is all that is needed to bring up the system. The reasoning is + that if the root filesystem is small and is not heavily used, + it is less likely to become corrupt when the system crashes, and + you will therefore find it easier to fix any problems caused by + the crash. Then you create separate partitions or use separate + disks for the directory tree below <TT +CLASS="FILENAME" +>/usr</TT +>, the + users' home directories (often under <TT +CLASS="FILENAME" +>/home</TT +>), + and the swap space. Separating the home directories (with the + users' files) in their own partition makes backups easier, since + it is usually not necessary to backup programs (which reside + below <TT +CLASS="FILENAME" +>/usr</TT +>). In a networked environment it + is also possible to share <TT +CLASS="FILENAME" +>/usr</TT +> among several + machines (e.g., by using NFS), thereby reducing the total disk + space required by several tens or hundreds of megabytes times + the number of machines.</P +><P +>The problem with having many partitions is that it splits + the total amount of free disk space into many small pieces. + Nowadays, when disks and (hopefully) operating systems are + more reliable, many people prefer to have just one partition + that holds all their files. On the other hand, it can be less + painful to back up (and restore) a small partition.</P +><P +>For a small hard disk (assuming you don't do kernel + development), the best way to go is probably to have just one + partition. For large hard disks, it is probably + better to have a few large partitions, just in case + something does go wrong. (Note that `small' and `large' are + used in a relative sense here; your needs for disk space + decide what the threshold is.)</P +><P +>If you have several disks, you might wish to have the + root filesystem (including <TT +CLASS="FILENAME" +>/usr</TT +>) on one, + and the users' home directories on another.</P +><P +>It is a good idea to be prepared to experiment a bit + with different partitioning schemes (over time, not just + while first installing the system). This is a bit of work, + since it essentially requires you to install the system from + scratch several times, but it is the only way to be sure you do + it right.</P +></DIV +><DIV +CLASS="SECT2" +><H2 +CLASS="SECT2" +><A +NAME="AEN1404" +>Space requirements</A +></H2 +><P +>The Linux distribution you install will give some indication + of how much disk space you need for various configurations. + Programs installed separately may also do the same. This will + help you plan your disk space usage, but you should prepare + for the future and reserve some extra space for things you will + notice later that you need.</P +><P +>The amount you need for user files depends on what your + users wish to do. Most people seem to need as much space for + their files as possible, but the amount they will live happily + with varies a lot. Some people do only light text processing + and will survive nicely with a few megabytes, others do heavy + image processing and will need gigabytes.</P +><P +>By the way, when comparing file sizes given in + kilobytes or megabytes and disk space given in megabytes, it + can be important to know that the two units can be different. + Some disk manufacturers like to pretend that a kilobyte is 1000 + bytes and a megabyte is 1000 kilobytes, while all the rest of + the computing world uses 1024 for both factors. Therefore, + my 345 MB hard disk was really a 330 MB hard disk. + + <A +NAME="AEN1409" +HREF="#FTN.AEN1409" +>[1]</A +> + </P +><P +>Swap space allocation is discussed in <A +HREF="x1532.html" +>the section called <I +>Allocating swap space</I +> in Chapter 5</A +>.</P +></DIV +><DIV +CLASS="SECT2" +><H2 +CLASS="SECT2" +><A +NAME="AEN1413" +>Examples of hard disk allocation</A +></H2 +><P +>I used to have a 109 MB hard disk. Now I am using a 330 MB + hard disk. I'll explain how and why I partitioned these + disks.</P +><P +>The 109 MB disk I partitioned in a lot of ways, when my + needs and the operating systems I used changed; I'll explain + two typical scenarios. First, I used to run MS-DOS together + with Linux. For that, I needed about 20 MB of hard disk, or + just enough to have MS-DOS, a C compiler, an editor, a few other + utilities, the program I was working on, and enough free disk + space to not feel claustrophobic. For Linux, I had a 10 MB swap + partition, and the rest, or 79 MB, was a single partition with all + the files I had under Linux. I experimented with having separate + root, <TT +CLASS="FILENAME" +>/usr</TT +>, and <TT +CLASS="FILENAME" +>/home</TT +> + partitions, but there was never enough free disk space in one + piece to do much interesting.</P +><P +>When I didn't need MS-DOS anymore, I repartitioned the + disk so that I had a 12 MB swap partition, and again had the + rest as a single filesystem.</P +><P +>The 330 MB disk is partitioned into several partitions, like + this: + + <DIV +CLASS="INFORMALTABLE" +><P +></P +><TABLE +BORDER="1" +CLASS="CALSTABLE" +><TR +><TD +ALIGN="LEFT" +VALIGN="TOP" +>5 MB</TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +>root filesystem</TD +></TR +><TR +><TD +ALIGN="LEFT" +VALIGN="TOP" +> 10 MB</TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +>swap partition</TD +></TR +><TR +><TD +ALIGN="LEFT" +VALIGN="TOP" +>180 MB</TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +>\fn{/usr} filesystem</TD +></TR +><TR +><TD +ALIGN="LEFT" +VALIGN="TOP" +>120 MB</TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +>\fn{/home} filesystem</TD +></TR +><TR +><TD +ALIGN="LEFT" +VALIGN="TOP" +> 15 MB</TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +>scratch partition</TD +></TR +></TABLE +><P +></P +></DIV +> + + The scratch partition is for playing around with things that + require their own partition, e.g., trying different Linux + distributions, or comparing speeds of filesystems. When not + needed for anything else, it is used as swap space (I like to + have a lot of open windows).</P +></DIV +><DIV +CLASS="SECT2" +><H2 +CLASS="SECT2" +><A +NAME="AEN1439" +>Adding more disk space for Linux</A +></H2 +><P +>Adding more disk space for Linux is easy, at least after the + hardware has been properly installed (the hardware installation + is outside the scope of this book). You format it if necessary, + then create the partitions and filesystem as described above, + and add the proper lines to <TT +CLASS="FILENAME" +>/etc/fstab</TT +> + so that it is mounted automatically.</P +></DIV +><DIV +CLASS="SECT2" +><H2 +CLASS="SECT2" +><A +NAME="AEN1443" +>Tips for saving disk space</A +></H2 +><P +>The best tip for saving disk space is to avoid installing + unnecessary programs. Most Linux distributions have an + option to install only part of the packages they contain, + and by analyzing your needs you might notice that you don't + need most of them. This will help save a lot of disk space, + since many programs are quite large. Even if you do need a + particular package or program, you might not need all of it. + For example, some on-line documentation might be unnecessary, + as might some of the Elisp files for GNU Emacs, some of the + fonts for X11, or some of the libraries for programming.</P +><P +>If you cannot uninstall packages, you might look into + compression. Compression programs such as <B +CLASS="COMMAND" +>gzip</B +> + or <B +CLASS="COMMAND" +>zip</B +> will compress (and uncompress) + individual files or groups of files. The <B +CLASS="COMMAND" +>gzexe</B +> + system will compress and uncompress programs invisibly to the + user (unused programs are compressed, then uncompressed as they + are used). The experimental DouBle system will compress all + files in a filesystem, invisibly to the programs that use them. + (If you are familiar with products such as Stacker for MS-DOS, + the principle is the same.)</P +></DIV +></DIV +><H3 +>Notes</H3 +><TABLE +BORDER="0" +CLASS="FOOTNOTES" +WIDTH="100%" +><TR +><TD +ALIGN="LEFT" +VALIGN="TOP" +WIDTH="5%" +><A +NAME="FTN.AEN1409" +HREF="x1384.html#AEN1409" +>[1]</A +></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +WIDTH="95%" +><P +>Sic transit discus mundi.</P +></TD +></TR +></TABLE +><DIV +CLASS="NAVFOOTER" +><HR +ALIGN="LEFT" +WIDTH="100%"><TABLE +WIDTH="100%" +BORDER="0" +CELLPADDING="0" +CELLSPACING="0" +><TR +><TD +WIDTH="33%" +ALIGN="left" +VALIGN="top" +><A +HREF="x1366.html" +>Prev</A +></TD +><TD +WIDTH="34%" +ALIGN="center" +VALIGN="top" +><A +HREF="book1.html" +>Home</A +></TD +><TD +WIDTH="33%" +ALIGN="right" +VALIGN="top" +><A +HREF="c1450.html" +>Next</A +></TD +></TR +><TR +><TD +WIDTH="33%" +ALIGN="left" +VALIGN="top" +>Disks without filesystems</TD +><TD +WIDTH="34%" +ALIGN="center" +VALIGN="top" +><A +HREF="c701.html" +>Up</A +></TD +><TD +WIDTH="33%" +ALIGN="right" +VALIGN="top" +>Memory Management</TD +></TR +></TABLE +></DIV +></BODY +></HTML +>
\ No newline at end of file |