Linux Directory Structure Changed RHEL7 File System Hierarchy Standard
Do you ever think why Linux Directory Structure is different than other operating systems..? And why we need to have so many directories in Linux, Let me explain in a better way to understand Linux Directory Structure Changed RHEL7 File System Hierarchy Standard (FHS).
Why File System Hierarchy is important..?
- Basic Security
- Categorizing Sharable and UN-sharable files in different buckets
- Organizing application files as per the FHS complaint
- Which gives more flexibility for the developers to write / develop programs
- Easy to manage Operating system for Administrators
File System Hierarchy is dependent for more other processes like booting process and recover / restore processes. Let’s see one by one what they store and how it is useful.
Linux Directory Structure Changed RHEL7 File System Hierarchy Standard
/bin is a separate directory under / (slash / root) which stores essential command binaries and commands that may be used by normal users and administrators. symbolic links also to the other commands /scripts.
Example: cat, chgrp, chmod and so an..
/boot contains static files of the boot loader, This Directory contains everything required by the boot process except configuration files not needed at boot time and the map installer. This may include saved master boot sectors and sector map files.
Example: Grub2
/dev directory contains device files. dev directory contains MAKEDEV and MAKEDEV.local to create externally attached device files and also local device files.
Example: /dev/cdrom – CD player
/dev/st0 – Tape Drive
/etc directory hold host-specific system configuration files. Configuration files must be an local files and must not be an executable binaries. No binary files located under /etc directory. It contains major / important system configuration files.
Example: /etc/passwd, /etc/group
/lib directory includes essential shared libraries and kernel modules. Dynamically linked C library files (lib.so) and execution time linker/loader (ld) file types contained by lib directory.
/media directory is used as mount point for removable media, such as CD / DVD drives, thumb drives etc. We can create sub-directories under /media directory to mount multiple devices.
/mnt directory used as mount point for mounting a filesystem temporarily. Any partitions you would like to mount it for temporary you can make use of this temp path.
/opt directory is reserved for add-on application software packages such as chrome browser. Every third party packages you install it will create and <package name> directory or <provider name> directory to identify them easily. Directories under opt /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, and /opt/man are reserved for local system administrator use.
Example: /opt/chrome etc..
/sbin directory
This /sbin directory contains essential system binaries. Utilities used by systemd administrators will be stored under this directory. /sbin also contains binaries which are used for booting, restoring, recovering and repairing the system.
Example: fsck, reboot etc..
/srv directory stores data for services provided by this system. It contains site specific data which is served by system.
/tmp stores temporary files. /tmp is very special directory which is accessible to every user in the system. Assigned an permissions called sticky bit and few more special permissions.
/usr secondary major hierarchy. When /bin directory is not flexible to keep more binaries / scripts we can keep in /usr/bin directory. /usr is an shareable and read-only data, FHS complaint hosts and must not be writable.
/var holds variable data, which is not static data variable data is an dynamic data. Var directory contains log files as well.
/home is an default users home directory
/root is an default root user home directory.
Conclusion: Directory structure is created in Linux based on FH complaint. File system hierarchy standard. FHS gives basic security and separate shareable and UN-shareable files.
For Video Tutorial Click Here
RHCSA Certification Complete Road Map
RHCSA and RHCE Certifications Complete Course Content
Thanks for your wonderful Support and Encouragement