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 

13 comments:

  1. can u tell me specific reasons why NTFS is better than FAT32 ??
    thnx in advance....

    and grt post btw!!

    ReplyDelete
  2. 1) Do not copy entire lines, or a group of them, from an online source and post them in your post.
    2) Regarding your view about NTFS, you said "When installing Windows, I recommend using NTFS only." Can you give reasons why you think so? Basically, the features that NTFS has that FAT lacks, performance differences, why NTFS is used more instead of FAT, or any other reason you may have.
    3) Regarding your claims about ext3/ext4:
    a) "You will use this file system when installing Linux on your PC." Why? Aren't there any other file systems on which Linux can be installed?
    b) "Partitions with ext3/4 are not readable in any OS except Linux." ext3 can read on almost all major OSes. ext4 can be read on almost all major OSes as well, but certain operating systems require absences of certain features on ext4. Almost all major operating systems, except for Windows, have a native driver for these file systems. Please specify which operating systems cannot read ext3 and ext4.

    For future posts:
    1) Please provide reasons for your personal opinions. They need not be too elaborate, a brief reason may do as well.
    Bad example: "Chromium rocks, Internet Explorer sucks."
    Good example: "I prefer Chromium over Internet Explorer because it is faster and more secure."

    2) No information is better than misinformation. Please verify your claims before you make them.

    ReplyDelete
  3. Hey Nishant,

    NTFS is better than FAT32 in many technical ways like:
    1. Better support for metadata(it is like small data in each file which remembers details like when and by whom the file was created)
    2. Use of advanced data organizing schemes like compression of old data to maximise performance and space utilisation
    3. Better security by enabling encryption techniques at low level
    4. File system journaling(for us, it just means lesser chance of data corruption)
    5. One of the biggest drawbacks of FAT32 for us as users is that the max file size in FAT32 systems is 4 GB which we can easily surpass these days with HD videos, bigger softwares etc.
    6. Many more technical improvements which I also don't understand and is irrelevant for us now!

    Hope it is clear now. Glad you like it.

    ReplyDelete
  4. Definitely NTFS is a better file system, but there is one drawback as well & that's very important.On NTFS, we cannot store programs or files which are to be used on multiple OS, so if a computer has more than one OS then there must at least be one partition that is formatted with FAT, which can store the programs/files that need to be used on multiple OS.But this is very risky because anybody can change it or delete it, even on a network.

    I found this on a link given below. You can go there and read the complete article given by a Microsoft expert.

    http://www.microsoft.com/windowsxp/using/setup/expert/russel_october01.mspx

    ReplyDelete
  5. Can you justify why "we cannot store programs or files which are to be used on multiple OS" as you claimed?
    The article you've linked to was written in 2001, when NTFS was fairly new. Can you link to a newer article which talks about inter-OS compatibility of NTFS?
    As I've just told Apoorv, please verify your claims before you make them.

    ReplyDelete
  6. And one more thing I forgot to add was that you cannot boot on systems having windows 95/98/ME using NTFS file system.So that is another Drawback.But the security is good only in NTFS file system so it is always advisable to use NTFS until there is a necessity to use FAT because of the above stated reasons or some else.

    ReplyDelete
  7. Hi Arjun,

    Thanks for your suggestions. I will keep them in mind the next time I write a post. I understand that I was quick in giving my observations about ext3/4 without verifying, will be cautious in the future. As for the copying part, I just took a few necessary lines in the beginning from Wikipedia and mentioned the source after modifying them as needed, wrote the rest myself. I'll try to keep it shorter next time.

    ReplyDelete
  8. @Apoorv..gr8 post..childhood doubts being cleared..hehe..
    @Arjun..thanx so much for guiding all us newbees...

    ReplyDelete
  9. @Apoorv.. nice post but can u tell me where do u get the information about maximum file size of fat32 system, or is it ur personal experience???

    ReplyDelete
  10. Mayank, why don't you figure that out and create another post which into the details why, in several cases, 4GB is the max limit? To help you get started, you can compare the size of the address word used by NTFS and FAT. Then list some other situations where size is limited to 4GB.

    Also, try to include why RAM is capped at ~3GBs by most operating systems working in 32-bit architectures, even though entire 4GB should be accessible. (Don't go into too much details here, since it would be very confusing for people not too used to dealing with system-level software/hardware. A brief description should be okay.)

    Apoorv, the point is not to keep the blog post short. The post could've gone into further details, imo. It was a pretty nice attempt, however, and I look forward to seeing more articles by you.

    ReplyDelete
  11. @Mayank You can google it up or refer to:
    http://en.wikipedia.org/wiki/File_Allocation_Table#FAT32

    ReplyDelete
  12. And just to clarify, Linux can be installed natively on almost any file system that supports POSIX-like permissions. You can still install it natively on other file systems with minor modifications to the base utilities and, probably, the kernel (though this will not be very secure).

    This basically means that you cannot install Linux natively on FAT*, ISO9660, Joliet, etc.

    You can, however, create a loopback file system on any other file system (eg. EXT3 on FAT32) and use that to run Linux.

    ReplyDelete
  13. Thanx @Apoorv i'll shortly be posting my article

    ReplyDelete