Decoding File Systems
Filesystems??
- How would you feel if your files stored in your drive would look like the image above? Unorganised and untidy mostly like our book shelfs?😅
- Ever wondered how your data is stored under a computer or your Smartphone? Even a USB drive with billions of files which could be a document, image, audio or an application knows which files to retrieve and store 💾
- Of course the operating system like Windows or a Unix-based OS does it for you, but some file systems also provide extra features you could use explicitly to manage your files 🗂️
- Every piece of data being stored on your physical drive with any number of partitions is well organized using a file system. Let’s put a new perspective about these types of file systems being used across operating systems 💽
All file systems are not the same. There exists different file systems which are classified based on security, speed or compatibility. It ranges from a simple FAT (File Allocation Table) to the most advanced file systems like ZFS (Zettabyte File System).
Let’s assume a power failure happens just before you were modifying a file, the file system logs the change (in the journal) before modifying the actual file. This ensures that if something goes wrong, the system knows what was supposed to happen. After the power restores, the system checks the journal, finds the incomplete operation, and re-applies the necessary changes to restore the file to its proper state. This is known as Journaling and is used by modern file systems.
NTFS (New Technology File System)
- 🖥️ NTFS is the primary file system used by the Windows operating system. It is deeply integrated into the Windows ecosystem.
- 📝 NTFS uses journaling to track changes. However, its journaling is limited compared to other file systems because it stores only metadata, not the actual content.
- 📉 Over time, NTFS can lead to fragmentation. This affects performance and is a known drawback of the system.
- 💾 NTFS is the default format for most USB drives and partitions used by Windows users. Your USB drive is probably using NTFS if you're a Windows user.
FAT (File Allocation Table) (FAT12, FAT16, FAT32)
- 💿 Back in the days of floppy disks and small memory cards, Microsoft introduced the FAT file system. FAT12 could manage up to 32MB of storage, while FAT16 extended that to 4GB.
- 📈 Due to the limitations of FAT16, FAT32 was developed to support larger capacities. FAT32 can handle up to 2TB of data, making it suitable for more modern storage needs.
- 🌍 FAT32 is almost universally supported. It’s often used for boot partitions or the EFI (Extensible Firmware Interface) system partition across many devices.
- ⚠️ FAT32 does not support journaling. In the event of a power failure or disk error, the file system cannot recover lost data since it doesn’t keep track of changes.
Ext4 (Fourth Extended File System)
- 🐧 Ext4 is the most widely used file system across Linux distributions. Even Android has used Ext4 at one point due to its reliability and support for up to 1 EB of data.
- 🚀 Ext4 is fast and performance-oriented. It also offers backward compatibility with Ext3 and Ext2 — allowing older USB drives or partitions to be mounted easily.
- 🔒 Ext4 lacks built-in encryption features. Most users rely on LUKS (Linux Unified Key Setup) for encryption instead.
- ⚠️ Ext4 does not guarantee data integrity after a power outage or disk failure. It may result in data corruption unless combined with proper journaling or redundancy systems.
APFS and HFS+ file systems
- 🍏 APFS (Apple File System) and HFS (Hierarchical File System) are used in the Apple ecosystem. HFS+ is common on older macOS versions, while APFS is used on modern macOS and iOS devices.
- 💽 APFS supports up to 8 exabytes and offers journaling for data protection. It was initially designed for SSDs only, as most Apple devices use SSDs by default.
- 🔐 APFS supports full disk encryption and snapshotting for secure and quick backups. These features are ideal for privacy-focused users and system rollbacks.
- ⚠️ APFS suffers from fragmentation, meaning files may be split into pieces and scattered across the drive. This can reduce performance over time.
- 🧹 HFS+ solves fragmentation with auto-defragmentation and also supports snapshots. However, these file systems are limited to Apple devices — USB drives formatted in APFS/HFS+ need 3rd-party tools to be used on other OSes.
BTRFS (B – tree File system or Butter FS)
- 🔬 Btrfs is an advanced, experimental file system. It's widely used in unstable or bleeding-edge Linux systems like Arch Linux.
- 📷 Btrfs supports snapshots, allowing you to capture the state of your disk like a screenshot. 🖼️ In case of data loss, you can restore from a previous snapshot and create new ones anytime.
- 🛠️ It supports multiple RAID levels (0, 1, 10, 5, and 6). It uses silent checksums to detect and fix errors, acting like a self-healing file system.
- 🧩 Btrfs allows live resizing of partitions even when mounted. Originally developed by Oracle, it’s now maintained by the open-source community.
ZFS (Z File system)
- 💡 ZFS, originally developed by Sun Microsystems (now part of Oracle), is a high-performance and high-capacity file system. It is known for its advanced features and reliability.
- 🏢 ZFS is widely adopted in data centers, enterprise setups, and large-scale storage systems. This is due to its powerful data integrity and management features.
- 🐧 While not natively available on many systems like Windows or macOS, it is commonly used in Linux and FreeBSD environments.
- ⚠️ Linus Torvalds recommends against using ZFS due to licensing issues. However, OpenZFS, an open-source version, is available and can be used without licensing concerns.
Does it matter?
Umm, I would say yes if you are a CS grad or someone who wants more options. Windows, the most popular operating systems holding a market share of 72% (2024). They dominate the market forcing users to use their file systems. You’re probably locked within NTFS and extFAT without even realizing it. Microsoft has kept this ecosystem closed for decades while other operating systems have moved ahead with powerful and efficient systems. NTFS is like the old-school file system unlike Btrfs or HFS+. You literally have to rely on additional software’s for features like self healing data or built-in snapshots. If you’re really interested in real life innovation, time to step out of this loop and try something new and experience it. Even Linux support native NTFS support from the “ntfs-3g” library so you have a system which just supports all those file systems making it almost completely robust.
