The Linux File System Hierarchy is very simple. The topmost directory is called / , also known as the root or slash directory(this is not be confused with the home folder of root user which is /root, similar to the root of a tree. All other directories branch out from here. The following are the default directories present under / in a typical Linux Installation.
- /sbin - This directory contains all the binaries that are essential to the working of the system. These include system administration as well as maintenance and hardware configuration programs. You will find lilo, fdisk, init, ifconfig etc here. These are the essential programs that are required by all the users. Another directory that contains system binaries is /usr/sbin. This directory contains other binaries of use to the system administrator.
- /bin - In contrast to /sbin, the bin directory contains several useful commands that are used by both the system administrator as well as non-privileged users. This directory usually contains the shells like bash, csh etc. as well as much used commands like cp, mv, rm, cat, ls. There also is /usr/bin, which contains other user binaries. These binaries on the other hand are not essential for the user. The binaries in /bin however, a user cannot do without
- /boot - This directory contains the system.map file as well as the Linux kernel. Lilo places the boot sector backups in this directory. Similarly even the Grub bootloader hs its configuration files here. In simple terms , this directory contains information on booting into the system.
- /dev - This is a very interesting directory that highlights one important characteristic of the Linux filesystem - everything is a file - which means even your hardware is a file. Look through this directory and you should see hda1, hda2 etc for IDE hard disks or sda1 , sda2 and so on for your SATA hard discs, which represent the various partitions on the first master drive of the system. /dev/cdrom and /dev/fd0 represent your CDROM drive and your floppy drive. Take /dev/dsp, for instance. This file represents your speaker device. So any data written to this file will be re-directed to your speaker.It also contains files like /dev/ttyÅ› for parallel ports and serial ports which connect to devices like Modem , printer etc, also /dev/usbÅ› for your usb ports. All hardware that are detected in the system by the OS is listed here.
- /etc - This directory contains all the configuration files for your system. Your lilo.conf file lies in this directory as does hosts, resolv.conf and fstab. Under this directory will be X11 sub-directory which contains the configuration files for X. More importantly, the /etc/rc.d directory contains the system startup scripts.
- /home - Linux is a multi-user environment so each user is also assigned a specific directory which is accessible only to them and the system administrator. These are the user home directories, which can be found under /home/username.All the users but for Root/super user have thier home directories here.
- /lib - This contains all the shared libraries that are required by system programs.
- /lost+found - Linux should always go through a proper shutdown. Sometimes your system might crash or a power failure might take the machine down. Either way, at the next boot, a lengthy filesystem check using fsck will be done. Fsck will go through the system and try to recover any corrupt files that it finds. The result of this recovery operation will be placed in this directory.
- /mnt - This is a generic mount point under which you mount your filesystems or devices. Mounting is the process by which you make a filesystem available to the system. After mounting your files will be accessible under the mount-point. This directory usually contains mount points or sub-directories where you mount your floppy and your CD.
- /opt - This directory contains all the software and add-on packages that are not part of the default installation. Generally you will find KDE and StarOffice here. Again, this directory is not used very often as it’s mostly a standard in Unix installations.
- /proc - This is a special directory on your system.
- /root - This is the super userÅ› home directory. This is not to be confused with the system root, which is directory at the highest level in the filesystem.
- /tmp - This directory contains mostly files that are required temporarily. Many programs use this to create lock files and for temporary storage of data.
- /usr - This is one of the most important directories in the system as it contains all the user binaries. X and its supporting libraries can be found here.
- /var - This directory contains spooling data like mail and also the output from the printer daemon. The system logs are also kept here in /var/log/message
This kind of layout, known as the unified file system, does offer several advantages over the conventional methods of file systems.
It is a good practice to keep /home and all other directories in separate partitions. A still better practice is to keep the /home, /usr , /var and all other directories in separate hard disk partitions because this will prevent data loss in case of OS crash, which might happen due to unexpected power cuts , etc.
An explanation to how to effect these different partitions has been mentioned in the Installation of Linux part.
Comments (0)
You don't have permission to comment on this page.