Show
A tutorial on file system types, directory structure, and a few related commands in LinuxLinux File System Structure (Image created by the author | Icon credits: PNGWing)File systems are standards for organizing data on storage devices. A file system divides the storage space on a drive into virtual compartments known as clusters. It also maintains an index of where each file is located and where free space is available. In this article, we will discuss the different file system types, the directory structure within the file system, and a few commands for navigating and performing different operations on the file system. File System TypesLinux supports various file system types, and we will discuss some important ones below. ExtThe extended file system (ext) was launched for Linux in 1992 and is the first file system designed specifically for Linux. It was designed partly based on the UNIX file system. The purpose of its creation was to innovate beyond the file system being used then (MINIX file system) and overcome its limitations. This file system allows a file size of up to 2 GB and a volume size of 2 GB. Ext2The second extended file system (ext2) was created in 1993 to be a successor to the original ext file system for Linux. It had improvements in areas such as storage capacity and general performance. It was for many years default for many Linux distributions. This file system allows a file size of up to 2 TB and volume size of 32 TB. Ext3The third extended system (ext3), created in 2001, surpasses ext2, and it is a journaling file system. A journaling file system is a system that records the changes and updates in the data at different stages. Journaling is used to repair and restore the data to its previous state upon reboot, in case your computer or hard disk(s) crashes or you face a power failure. This file system allows a file size of up to 2 TB and volume size of 32 TB. Ext4The fourth extended system (ext4) was created in 2008. Since this file system overcomes numerous limitations that the ext3 had, it’s both widely used and the default file system that most Linux distributions use. This file system allows a file size of up to 16 TB and volume size of 1 EB. JFSThe Journaled File System (JFS) was first created by IBM in 1990 and later taken to open source for implementation for Linux in 1999. And as we have discussed in ext3, this is also a journaling file system that uses records on updates in the file system to repair and restore data. It can also be used as an alternate for ext4, where we need stability with few resources because it uses less CPU power than the other file systems. This file system allows a file size of up to 4 PB and a volume size of 32 PB. ReiserFSThe ReiserFS is a journaling file system developed in 2001 and is an alternate to ext3. It uses a B+ Tree that gives it less than linear time in directory lookups and updates. It was the default file system for SUSE Linux till it was switched to ext3 in 2006 due to some policy changes. This file system allows a file size of up to 8 TB and a volume size of 16 TB. XFSThe Extend File system (XFS) was created by Silicon Graphics in 1990 but later given to Linux in 2001. XFS is a 64-bit high-performance journaling file system developed for parallel I/O processing. It provides many features like snapshots, online defragmentation, sparse files, and variable block sizes. It is particularly noteworthy for how incredibly well it works with large files, contrarily not the best with smaller files. And NASA is still using this file system with its high storage server (300+ Terabyte servers). This file system allows a file size of up to 8 EB and volume size of 8 EB. BTRFSThe B Tree File System (BTRFS) was created by Oracle in 2009. It is used for fault tolerance, repair system, extensive storage configuration, and much more. But, it is not a good suit for a production system. It provides many features like snapshotting, drive pooling, data scrubbing, self-healing, and online defragmentation. And it is the default file system for Fedora Workstations. This file system allows a file size of up to 16 EB and volume size of 16 EB. SWAPThe swap file system is not exactly a file system but reserved disk space used for memory paging in Linux operating system during the system hibernation. A system that never goes to hibernate state requires a swap space equal to its RAM size. Directory StructureThe Linux File system has a hierarchal file system structure for directories defined by FileSystem Hierarchy Standard(FSHS). It looks like an inverted tree with root ( At the root level, you can find different directories, which have specific purposes and hold the files necessary for running the OS and performing various operations on the operating system. How many and what directories are present at the root level will vary with different distributions of Linux. So, here we will see the most common directories that you would see on most distributions. /bootThis directory contains the files needed for booting the Operating System (OS). A few examples are Basic Input/Output System (BIOS), Linux kernels, Master Boot Record (MBR) boot loader, and many other files. The BIOS checks the integrity of the hard disk(s) in the system then it executes the Master Boot Record (MBR) boot loader. Although all the booting-related files rest in /etcAs we
discussed above, the configuration files for booting and all the different programs that run on the OS are in the Basically, you can find different configuration files in the /binThis
directory contains the core system executables (programs) and utilities. For example, very well-known and commonly used commands such as /sbinThe /libEach program or binary uses specific libraries to function, and all the shared libraries are in the /homeThe For example, if the user name is joe, the home folder for the user would be These individual home folders contain the user data files and configuration files, that are specific to a user, which need to be stored elsewhere besides in the If one user wants to modify files of other users on a system, they must become the root user, as each user only has /usrThe /usr directory stores read-only data, including the executable binaries, libraries, and the other files shared between multiple users. The There is a /devLinux displays all connected devices as directories/files, and the /tmpThe /procThe /varThe /optThe Few Commands to work with the file systemYou can explore and perform different operations in the filesystem, below are a few commands related to files, directories, navigation, and performing other operations on the file system that you can use. The The The The The The The The The The The The The
The The These were a few things like what a file system is, different types of file systems for Linux, the directory structure within the file system, and a few commands to navigate and perform operations on files and directories in the file system. Hope you have found them useful. Thanks for reading, and happy learning! If you enjoy reading stories like these and want to support me as a writer, consider signing up as a Medium member. It’s $5 a month, giving you unlimited access to all the stories on Medium. If you sign up using my link, I’ll earn a small commission. What is the current Linux file system?Most of the recent Linux distributions use Ext4 file system which is modern and upgraded version of older Ext3 and Ext2 file systems. Reason behind most of the Linux distributions use Ext4 file systems is that it is one of the most stable and flexible file systems out there.
What is the file system used in the operating system?A file system in an operating system decides the way the contents of its storage medium (secondary memory, etc) are stored and organized. Examples of filesystems are btrfs, xfs, zfs, ext series, ntfs, etc. These filesystems differ in aspects of implementation, use cases, etc.
Which is the most likely used file system in Linux?Ext4 is the default file system on most Linux distributions for a reason. It's an improved version of the older Ext3 file system.
|