The Linux File System Hierarchy

To be able to manage a Linux computer, you need to be familiar with the default directories.

The layout of the Linux file system hierarchy is defined in the Filesystem Hierarchy Standard (FHS).

File System Hierarchy Overview

Linux Filesystem Hierarchy

Directoryవివరణ
/This is known as the root directory, which is the start of the file system tree. Everything in Linux appears under /, even other partitions.
/binThis directory contains important programs and utilities such as the BASH shell. This directory is essential during boot.
/bootContains all the files and directories to boot the Linux kernel. The Linux kernel and GRUB boot loader files are stored here.
/devYou can find the device files here, such as the ones to access the physical devices. This directory is essential during boot.
/etcContains configuration files that are used by programs and services that are used on your server. These configuration files are used system wide. This directory is essential during boot.
/homeThis is the home directory for the user. If the user is tim then the home directory would be /home/bob. The home directory contains the user's data files and user specific configuration files. The user only has write access to their own home directory. Only elevated permissions can access all users home directory.
/lib, /lib64Shared libraries that are used by programs in /boot, /bin and /sbin
/media, /mnt/media contains directories where removable media devices such as CDs are mounted. /mnt is where temporary files systems are mounted, ఉదాహరణకి, a విండోస్ partition could be mounted at /mnt/windows.
/optOptional directory for programs to store files, if they don't use the FHS standard. A program could store its files in /opt/application
/procThis directory is used by the proc file system. Provides access to kernel information.
/rootHome directory for the root user. This is different to /.
/runContains process and user specific information that has been created since the last boot. Applications can store information such as sockets and process IDs.
/sbinSimilar to /bin, but for system administration commands that are run by the root user.
/srvDirectory that may be used for data that is used by services like NFS, FTP & HTTP.
/sysUsed to interface to different hardware devices that is managed by the Linux kernel and associated processes
/usrContains directories with program files, libraries for these program files and documentation. These files are used by user application.
/varContains files that may change in size. Eg. log files (/var/log), mail boxes and spool files.

 

Mounting in Linux

Linux allows mounting devices under the / root. This allows to organise the Linux file-system in a flexible way such as distributing the file system among different devices.

/boot : Often mounted to a separate hard disk as this directory contains important information for booting the computer.

/var : Often is on a separate dedicated hard disk as the size of the directory can grow rapidly. Using a separate storage also ensures the space of the computer stays intact.

/home : Often stored on a dedicated device or hard disk for security reasons. You can then mount the device to the Linux file-system in secure way. If the OS needs to be reinstalled user specific files stay intact and can be easily remounted.

/usr : Contains operating system files that users don’t need write access to. Putting this on a dedicated device ensures that it can be mounted read-only.

The mount command is used to show the overview of the mounted devices. The information used by the mount command is read from the /proc/mounts directory. df -Th command shows available disk space on current mounts. -h summarizes the output and -T shows the filesystem type used on the different mounts. findmnt shows mounts and the relation that exists between the different mounts.

 

స్పందించండి