Wednesday, July 28, 2010

File Systems

File Systems can be very confusing. I remember getting confused so much between NTFS and FAT32 when using Windows. I have written this article using help from Wikipedia but have tried to simplify as much as possible to understand without getting confused. I hope this post helps you in understanding file systems better.

file system (often also written as filesystem) is just a method of storing and organizing computer files and their data. A file system organizes these files into a database for storage and usage by the computer's operating system(Windows, Mac OS, Linux etc.). Some common examples of file systems are NTFS, FAT32, ext3 etc.

File systems are used on data storage devices such as a hard disks or pen drives to maintain the physical location of the files by organizing physical sectors present in hard disks(the stuff that we learned today in class) into files and folders for our use. Most file systems address data in fixed-sized units called "clusters" which contain a certain number of sectors (usually 1-64). This is the smallest amount of disk space that can be allocated to hold a file.

Image: File systems shown in different disk partitions in a multi-boot configuration on my PC. Click the image to see it bigger. Note the red circled text.

A file system is an integral part of any modern operating system(OS) to organize and read files in the hard disk. To use a hard disk(or its partition) in an OS like C:/, D:/ etc., it must be formatted in the supported file system of the OS. Different OSs use different file systems some of which are:

FAT: FAT(File Allocation Table) is the most widely used file system due to its relative simplicity. It is used in pen drives, memory cards etc. as it is compatible with virtually all operating systems. The FAT file system compares poorly to most other file systems as it uses overly simplistic data structures, making file operations time-consuming, and makes poor use of disk space in situations where many small files are present. So it is not used much to install the OS nowadays due to the presence of superior options. Versions of FAT include FAT16, FAT32, exFAT etc. The latest exFAT version despite being good enough is not used much due to low adoption. Use FAT16 or FAT32 while formatting your pen drive or memory card.

NTFS:  NTFS (New Technology File System) is the standard file system of Windows since Windows 2000 and is widely used in Windows XP, Windows Vista, and Windows 7. It is better than the FAT32 file system in many ways. When installing Windows, I recommend using NTFS only(Update: Please read comment#3 for NTFS vs. FAT32). Partitions with NTFS are readable in Linux by default and by installing special drivers in Mac OS X.

ext3/4: ext3 is a file system most commonly used by Linux(and Linux distributions like Ubuntu and Fedora). ext4 is the successor to ext3 used by new versions of Ubuntu and Fedora. You will use this file system when installing Linux on your PC as the installer recommends it(Update: Linux can also be installed on some other file systems like FAT32). Partitions with ext3/4 are accessible in Windows by using 3rd party drivers and software.

HFS+:  Hierarchical File System Plus or HFS+ is a file system developed by Apple to replace their HFS as the primary file system used in Macintosh computers (or other systems running Mac OS). It is also one of the formats used by the iPod digital music player. Partitions with HFS+ are readable in Linux by default and by installing special drivers in Windows.

There are many other types of file systems but these are the only ones relevant to us in daily use. You will come across these more often when installing an OS or partitioning your hard drive. But if you have survived till this end of the post, I think you should be fine in deciding file systems when needed. Please feel free to ask any questions or doubts in the comments regarding file systems. Please avoid miscellaneous discussions in comments.

Source: Wikipedia