MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

* DocIndex - Basics

File System Hierarchy II

* The Root Directory

Related Resources:

File system Hierarchy Standard (FHS)
Mdk Reference, II.6

Revision / Modified: April 20, 2002

 

*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
'/bin' contains essential system programs that must be available even if 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
Home of the kernel, the System.map, GRUB's configuration files, and other important boot files.
/dev
'/dev' contains the device files. Unix handles all In/Out operations via files (e.g. a file sent to '/dev/lp0' gets printed). Evidently these are needed during boot for hardware initialization.
/etc
All important system-wide configuration files are in here or in one of its sub-directories.
/home
Here are the users' home directories located. In pre-ML 7.2 releases, it also contained the serving directory of the Apache web server ('/home/httpd').
/lib
Essential libs needed for basic system functionality. Kernel modules ('drivers') are in the subdirectory '/lib/modules/$(uname -r)'.
/lost&found
If a file system check discovers any 'loose' file fragments, it puts them 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
By convention '/mnt' contains the directories external media and non-system partitions are mounted to, like '/mnt/floppy' or '/mnt/cdrom'.
/proc
'/proc' is a bogus file system. It doesn't contain 'real' files but 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
This is the home directory of the System Administrator, 'root'. This may be somewhat confusing ('root on root') but in former days, '/' wasroot'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
Unix discriminates between 'normal' executables and those used for system 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
This directory contains, um, well, temporary files ;-). Do notremove files from this directory unless you know exactly what you are doing! 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
'/usr' usually the largest chunk of data on a system. It contains all files that might be shared by the users of a system during normal operation, like executables, documentation, libraries or the X system.
/var
Contains variable data like system logging files, mail and printer spool 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'.

* section index * top

* /etc, /home/, /var


 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.