B.2. The Directory Tree
Appendix B. Partitioning for Debian

Debian GNU/Linux adheres to the Filesystem Hierarchy Standard for directory and file naming. This standard allows users and software programs to predict the location of files and directories. The root level directory is represented simply by the slash /. At the root level, all Debian systems include these directories:

Directory Content
bin Essential command binaries
boot Static files of the boot loader
dev Device files
etc Host-specific system configuration
home User home directories
lib Essential shared libraries and kernel modules
media Contains mount points for replaceable media
mnt Mount point for mounting a file system temporarily
proc Virtual directory for system information (2.4 and 2.6 kernels)
root Home directory for the root user
sbin Essential system binaries
sys Virtual directory for system information (2.6 kernels)
tmp Temporary files
usr Secondary hierarchy
var Variable data
opt Add-on application software packages

The following is a list of important considerations regarding directories and partitions. Note that disk usage varies widely given system configuration and specific usage patterns. The recommendations here are general guidelines and provide a starting point for partitioning.

  • The root partition / must always physically contain /etc, /bin, /sbin, /lib and /dev, otherwise you won't be able to boot. Typically 150–250 MB is needed for the root partition.

  • /usr: contains all user programs (/usr/bin), libraries (/usr/lib), documentation (/usr/share/doc), etc. This is the part of the file system that generally takes up most space. You should provide at least 500 MB of disk space. This amount should be increased depending on the number and type of packages you plan to install. A generous workstation or server installation should allow 4-6 GB.

  • /var: variable data like news articles, e-mails, web sites, databases, the packaging system cache, etc. will be placed under this directory. The size of this directory depends greatly on the usage of your system, but for most people will be dictated by the package management tool's overhead. If you are going to do a full installation of just about everything Debian has to offer, all in one session, setting aside 2 or 3 gigabyte of space for /var should be sufficient. If you are going to install in pieces (that is to say, install services and utilities, followed by text stuff, then X, ...), you can get away with 300–500 MB. If hard drive space is at a premium and you don't plan on doing major system updates, you can get by with as little as 30 or 40 MB.

  • /tmp: temporary data created by programs will most likely go in this directory. 40–100 MB should usually be enough. Some applications — including archive manipulators, CD/DVD authoring tools, and multimedia software — may use /tmp to temporarily store image files. If you plan to use such applications, you should adjust the space available in /tmp accordingly.

  • /home: every user will put his personal data into a subdirectory of this directory. Its size depends on how many users will be using the system and what files are to be stored in their directories. Depending on your planned usage you should reserve about 100 MB for each user, but adapt this value to your needs. Reserve a lot more space if you plan to save a lot of multimedia files (MP3, movies) in your home directory.

 中文翻译

        1、根分区 / 必须总是包含 /etc,/bin,/sbin,/lib 以及 /dev,否则您将不能引导。典型的 root 分区需要 150–250MB 大小空间。

        2、/usr:包含所有的用户程序(/usr/bin),库文件(/usr/lib),文档(/usr/share/doc),等等。一般而言,这是文件系统占用空间最多的部分。您需要提供至少 500MB 磁盘空间。总容量的增长依据您要安装的软件包数量和类型。大的工作站或服务器安装应该需要 4-6 GB。

        3、/var:包含可变数据,如新闻组文章,电子邮件,网站,数据库,软件包系统的缓存等等。这个目录的大小取决于您对计算机的使用,但是对于大多数人而言将由包管理器支配开销。如果您准备一次性地做一个完整的安装,包含 Debian 提供的所有程序,/var 下面 2 或 3GB 的空间应该满足需求。如果您准备逐次安装(也就是,安装服务程序和工具,然后是文本处理工具,然后是 X,...),您可以在 /var 下准备 300—500 MB。如果硬盘空间很紧张,并且您不准备做主要的系统升级,您可以为 /var 配置 30-40MB 大小。

        4、/tmp: 程序创建的临时数据大都存到这个目录。通常 40–100 MB 应该足够。一些应用程序:包括档案处理器,CD/DVD 制作工具,和多媒体软件 — 可能会使用 /tmp 临时保存映像文件。如果您要使用这些程序,应该依据需要调整 /tmp 目录的大小。

        5、/home:每个用户将放置他的个人数据到这个目录的子目录下。其大小取决于有多少用户将使用系统和有什么文件放在他们的目录下。取决于您计划的使用量,您应该为每个用户准备 100MB 空间,不过这个值应该迎合您的需求。假如您的 home 目录计划保存大量的多媒体文件(MP3, 电影),您该预备更多的空间。

posted on 2005-10-25 15:37  cheerwen  阅读(364)  评论(3编辑  收藏  举报