Today we will discuss the Linux file system.
What Is Linux File System?
Linux File System or any file system generally is a layer that is under the operating system that handles the positioning of your data on the storage; without it, the system cannot knows which file starts from where and ends where.
Even if you find any unsupported file system type, you can also download software that can deal with it. So what are Linux file system types?
Linux File System Types
When you try to install Linux you will see that Linux offers many file systems like these:
Ext, Ext2, Ext3, Ext4, JFS, XFS, btrfs and swap
So what are these file systems that Linux offers?
Ext: an old one and no longer used due to limitations.
Ext2: first Linux file system that allows two terabytes of data allowed.
Ext3: came from Ext2, but with upgrades and backward compatibility.
The only problem with it that the servers don’t use this kind of file system because this file system doesn’t support file recovery or disk snapshots.
Ext4: faster and allow large files with significant speed.
It is a perfect option for SSD disks, and you notice when you try to install any Linux distro that this one is the default file system that Linux suggests.
JFS: old file system made by IBM. It works very well with small and big files, but it failed and files corrupted after long time use, reports say.
XFS: old file system and works slowly with small files.
Btrfs: made by Oracle. It is not stable as Ext in some distros, but you can say that it is a replacement for it if you have to. It has excellent performance.
You may notice From the comparison above that Ext4 is the best Linux File System.
Top Level Explanation
Now you know what Linux file system is and its types. So what is inside that filesystem, I mean from the top level.
You may come from Windows, and Windows has partitions like C:\ and D:\, you can install Windows on any of these partitions, usually C:\.
What about the Linux File System Structure?
Well, if you navigate to the root partition, which is / you’ll see the Linux File System Hierarchy.
Most distros have the same structure with some little difference between distros.
Linux File System Directories
/bin: Where Linux core commands reside like ls, mv.
/boot: Where boot loader and boot files are located.
/dev: Where all physical drives are mounted like USBs DVDs.
/etc: Contains configurations for the installed packages.
/home: Where every user will have a personal folder to put his folders with his name like /home/likegeeks.
/lib: Where the libraries of the installed packages located since libraries shared among all packages,
unlike Windows, you may find duplicates in different folders.
/media: Here are the external devices like DVDs and USB sticks that are mounted, and you can access their files from here.
/mnt: Where you mount other things Network locations and some distros, you may find your mounted USB or DVD.
/opt: Some optional packages are located here and managed by the package manager.
/proc: Because everything on Linux is a file, this folder for processes running on the system,
and you can access them and see much info about the current processes.
/root: The home folder for the root user.
/sbin: Like /bin, but binaries here are for root user only.
/tmp: Contains the temporary files.
/usr: Where the utilities and files shared between users on Linux.
/var: Contains system logs and other variable data.
Now you have a good idea about what the Linux file system is.
Choosing the right file system can lead you to the best performance, so choose the best.
Founder of LikeGeeks. I’m working as a Linux system administrator since 2010. I’m responsible for maintaining, securing, and troubleshooting Linux servers for multiple clients around the world. I love writing shell and Python scripts to automate my work.