Wishlist filesystem hierarchy

Jump to: navigation, search

is largely similar to other UNIX-based and Linux systems you may be familiar with. This topic describes the function of each major filesystem or directory on the system and how they are organized.



The root directory (/) is the top-level directory of any Linux filesystem. Everything falls below root. Don't confused the root directory with the root user's directory. The root user has his own home directory, much like regular user accounts, in /root.

Think of / as the tree, and each directory and sub-directory below it are branches and leaves. / is the trunk of the tree, the single most important directory below which everything else lives.


The /bin directory is where essential binary files (programs) live. The /bin directory should be on the same partition as the / filesystem because most of the tools in /bin are required to boot the system and will be needed before other filesystems may be mounted during boot. The /bin directory is largely static and should never change except when packages are upgraded. This directory should not be shared to other systems (via samba, NFS, etc.).


The /boot directory is where kernels, ramdisks (initrd files), and Template:Prog's configuration file lives. This directory can be on the / root filesystem, but it is recommended to make this directory it's own partition (typically the first partition on the first hard drive installed on the system).


The /dev directory is a special directory that should not be changed by hand. This directory contains system device files that allow you to interact with physical hardware via a filename. Files that it contains include /dev/hda (access to the master IDE drive on the primary IDE controller), /dev/null, and so forth.


The /etc directory contains configuration files related to the system and the applications installed. More often than not, to configure something about a particular application of service, the configuration file(s) will be found here. This directory must also be on the / root filesystem.


The /home directory is typically where all user accounts will have their home directory, such as /home/chum. It is recommended to make /home it's own partition.


The /lib directory is where shared libraries are installed that are often-used and/or used by programs in /bin. This directory should be on the / root filesystem. It also contains the kernel modules; such as /lib/modules/2.4.32-5205avx.


The /media directory is used as a top-level mount point for removable media. For instance, you should mount a USB disk here as, say, /media/usbdisk, or a CD-ROM as /media/cdrom, a floppy disk as /media/floppy, and so forth. By default, will place entries in /etc/fstab to mount the CD-ROM and/or floppy devices here.


The root user's home directory.


The /sbin directory contains administration files for the system and must be a part of the / root filesystem. These are files that typically are executed only by root and not regular users.


The Annvix operating system imposes almost nothing on users, including the location of where to place web files or files served by FTP. It is our opinion that using the /srv directory for this type of data is optimal. For instance, web data would be stored in /srv/www (rather than /var/www, FTP data would be stored in /srv/ftp (rather than /var/ftp, and mail storage (such as used by virtual mail systems) would be stored in /srv/mail. This can further be broken down by domain to keep things clean, consistent, and logical. For instance, on a system serving up "annvix.org" you might have:

  • /srv/www/annvix.org/html
  • /srv/ftp/annvix.org
  • /srv/mail/annvix.org/chum

The first directory would be the webroot for the annvix.org website. The second would be the root directory of FTP files served by annvix.org, and the last would be the directory for storing the virtual mail for chum@annvix.org.

This is, of course, purely recommendation and you can place this data anywhere you like.


Temporary files for any user are stored in /tmp. This directory is special in that, while it is writable by any user, no user can overwrite or delete another user's files.


The /usr directory is a top-level directory for many other directories with different functions.


The /usr/bin directory contains the bulk of the system's binary files. All files that aren't essential to the startup of the system, or are administrative in nature, belong here. The major exception is binaries installed as part of a ports package or that you compile on your own.


Like /lib, the /usr/lib directory contains library files, but these are library files not required by applications involved in bringing the system up to a useable state.


The /usr/sbin directory contains system administration binaries that are not needed to boot the system.


This directory contains read-only architecture independent data that is required by applications in /usr. Zone information files, locales, documentation (/usr/share/doc), manpages, and more are located here.


The /usr/local directory mimics /usr in that it contains similar directories, such as /usr/local/bin, /usr/local/sbin, /usr/local/etc, /usr/local/lib, etc. These directories serve the same function as their top-level counterparts with the exception that applications stored here are those either a) installed by ports packages or b) installed by compiling source on your own.



An exceptional directory here is /usr/local/ports which contains all the ports-related information. The /usr/local/ports/ports directory contains the build information for ports packages, including patches, source files, and spec files. The /usr/local/ports/packages directory contains the actual Template:Prog-built ports RPM packages that can be installed via Template:Prog. See the Ports documentation for more information.


The /var directory is used to store variable data, such as database files, process accounting files, logs, mail spools, and so forth.


The /var/log/system directory is used to store all the system's syslog files. As of Template:Version, Annvix uses Template:Prog for system logging by default, rather than Template:Prog. As a result, instead of looking for /var/log/messages you would instead look for /var/log/system/messages/current. Read the socklog documentation for more information on how to configure and use Template:Prog.

not sure about socklog. whats wrong with syslog?


Database files live here, be they MySQL or PostgreSQL database files, the system's RPM database, or the urpmi database files. This is a good directory to backup.


Personal tools