File System Hierarchy II
Summary:
- The Root Directory
The Root Directory
The Linux file system starts with '/', the root directory. All other directories are 'children' of this directory. The partition which the root file system resides on is mounted first during boot and the system won't boot if it doesn't find it.
In Mandrake Linux, '/' contains these sub-directories:
/bin
only the partition containing '/' is mounted. This may be necessary if you have to repair other partitions. It also contains programs which the boot script '/etc/rc.d/rc.sysinit' relies on.
/boot
important boot files.
/dev
files (e.g. a file sent to '/dev/lp0' gets printed). Evidently these are needed during boot for hardware initialization.
/etc
sub-directories.
/home
also contained the serving directory of the Apache web server ('/home/httpd').
/lib
('drivers') are in the subdirectory '/lib/modules/$(uname -r)'.
/lost&found
in here. Each partition has its own 'lost&found' directory.
If you find files in there, try to move them back to their original location. If you find something like broken symbolic link to file, you have to reinstall the file(s) from the corresponding RPM, since your file system got damaged so badly that the files were mutilated beyond recognition.
/mnt
non-system partitions are mounted to, like '/mnt/floppy' or '/mnt/cdrom'.
/proc
runtime system information (e.g. system memory, devices mounted, hardware used etc.). You can read most of these files with 'less' (More on processes).
/root
be somewhat confusing ('root on root') but in former days, '/' was root's home directory (hence the name of the Administrator account). To keep things tidier and safer, 'root' got his own home directory.
Why not in '/home'? Because '/home' is often located on a different partition or even on another system and would thus be inaccessible to 'root' when - for some reason - only '/' is mounted.
/sbin
maintenance or administrative tasks. The latter reside either here or - the less important ones - in '/usr/sbin'. For security reasons, these directories are not part of users' PATHs, only of 'root's.
/tmp
do not remove files from this directory unless you know exactly what you are doing1.1 Many of these files are important for currently running programs and deleting them may result in a system crash. Usually it won't contain more than a few KB anyway.
/usr
files that might be shared by the users of a system during normal operation, like executables, documentation, libraries or the X system.
/var
directories. Why not put it into '/usr'? Because there might be circumstances when you want to mount '/usr' as read-only, e.g. if it is on a CD or on another computer (amazing what one can do with Linux, isn't it? ;-)). '/var' contains variable data, i.e. files and directories the system must be able to write to during operation, whereas '/usr' should only contain static data.
Some of these directories can be put onto separate partitions or systems, e.g. for easier backups, due to network topology or security concerns. Other directories have to be on the root partition, because they are vital for the boot process.
'Mountable' directories are: '/home', '/mnt', '/tmp', '/usr' and '/var'. Essential for booting are: '/bin', '/boot', '/dev', '/etc', '/lib', '/proc' and '/sbin'.
Next Item: /etc, /home/, /var
Related Resources:
File system Hierarchy Standard (FHS)
Command Line Manual
Revision / Modified: July 17, 2004
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Version 1.11 last modified by ptyxs on 24/02/2006 at 20:45
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!