Linux File System Layout

 < Day Day Up > 

The Linux file system layout is hierarchical. Files are contained in directories, and directories can have any number of subdirectories. Most operating systems are arranged this way, including UNIX. The following are descriptions of some of the more important directories found on a Linux system:

/

The root directory, which is the base of the file system's hierar chical tree structure. A directory is logically viewed as being part of /. Regardless of the disk on which a directory or logical volume is stored, it is logically viewed as a part of the root hierarchy.

/bin

Contains commonly used commands that you issue at the command line all the time.

/boot

The kernel files and those related to the kernel are in this directory.

/dev

Contains host-specific device files.

/etc

Contains host-specific system and application configuration files. The information in this directory is important to the system's operation and is of a permanent nature. There are also additional configuration directories below /etc.

/home

Users' home directories are recommended to be located here. Because the data stored in users' home directories will be modified often and much will be added over time, you can expect this directory to grow in size.

/initrd

An initrd image is needed for loading your SCSI module at boot time or if you are compiling the kernel with ext3 support as a module.

/lib

Libraries and parts of the C compiler are found in this directory.

/lost+found

The lost files directory. Here, you find files that are in use, but are not associated with a directory. These files typically become "lost" as a result of a system crash that caused the link between the physical information on the disk and the logical directory to be severed. The program fsck, which is run at the time of boot, finds these files and places them in the lost+found directory. You will typically see one of these for every disk that you have mounted.

/misc

A directory that is in place to contain miscellaneous information.

/mnt

Directory for mounting, especially temporary mounts, such as floppies and DVD-ROMs.

/opt

The directory under which applications are installed. As a rule, application vendors never specify a particular location for their applications to be installed. Now, with /opt, there is a standard directory under which applications should be installed. This is an organizational improvement for system administrators because they can now expect applications to be loaded under /opt and the application name.

/proc

Images of all running processes are shown here.

/root

Home directory for the user root.

/sbin

Contains commands and scripts used to boot, shut down, and fix file system mounting problems.

/tmp

A free-for-all directory, where any user can temporarily store files. Because of the loose nature of this directory, it should not be used to store anything important, and users should know that whatever they have stored in /tmp can be deleted without notice. Application working files should go in /var/tmp or /var/opt/appname, not in /tmp.

/usr

Most of the UNIX operating system is contained in /usr. Included in this directory are commands, libraries, and documentation. A limited number of subdirectories can appear in /usr.

/var

Holds files that are primarily temporary. Files such as log files, which are frequently deleted and modified, are stored here. Think of this as a directory of "variable" size. Files that an application or command create, at runtime should be placed in this directory, including logfile and spool files. However, some applications, including init scripts, may store state information in /var.


The following is a long listing of the root (/) directory of the Integrity server used throughout this book:

 # ls -l / total 244 drwxr-xr-x    2 root     root         4096 Jan 16 11:37 bin drwxr-xr-x    3 root     root         4096 Jan 16 16:40 boot drwxr-xr-x   18 root     root        86016 Jan 28 20:08 dev drwxr-xr-x   66 root     root         8192 Jan 28 20:08 etc drwxr-xr-x    3 root     root         4096 Jan 16 11:37 home drwxr-xr-x    2 root     root         4096 Jun 21  2001 initrd drwxr-xr-x    6 root     root         4096 Jan 16 11:32 lib drwx------    2 root     root        16384 Jan 16 10:39 lost+found drwxr-xr-x    2 root     root         4096 Aug 29  2001 misc drwxr-xr-x    3 root     root         4096 Jan 16 16:40 mnt drwxr-xr-x    2 root     root         4096 Aug 23  1999 opt dr-xr-xr-x   59 root     root            0 Jan 28 15:07 proc drwxr-x---   13 root     root         4096 Jan 28 21:34 root drwxr-xr-x    2 root     root         8192 Jan 16 11:35 sbin drwxrwxrwt   10 root     root        77824 Jan 29 04:02 tmp drwxr-xr-x   17 root     root         4096 Jan 16 11:26 usr drwxr-xr-x   26 root     root         4096 Jan 16 11:35 var # 

You'll be working extensively in some of these directories in upcoming chapters. You'll become familiar with the contents of some of these directories in upcoming chapters, such as /boot and /proc in the kernel chapter.

The previous sections of this chapter covered some of the most important aspects of working with a Linux system, such as adding and partitioning a disk, mounting the disk, the layout of the file system, and log files. This working knowledge of the file system is important Linux knowledge. The next section covers configuration of the Smart Array controller.

     < Day Day Up > 


    Linux on HP Integrity Servers. A System Administrator's Guide
    Linux on HP Integrity Servers: A System Administrators Guide
    ISBN: 0131400002
    EAN: 2147483647
    Year: 2004
    Pages: 100

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net