What is the difference between FAT and Inode?
Fat uses tables in central locations while inodes are spread throughout the file system.
To further highlight what the actual difference is to have a look at how each system represents files as a whole and how their base structures work. A single entry in a FAT or inode-based system might be somewhat comparable but the overall structure that supports the system is not.
Since it's been decades there are also variations of those systems that might be slightly different. Newer technologies also might influence those variants as e.g. HDDs and SSDs support different access patterns.
A FAT-based system by design should have an entry for every single cluster in your filesystem. By parsing it you should be able to tell what every cluster in your system contains. Its data structure is a single, solid list that might be kept in multiple locations to have some backup. All the major information is kept in that list. Especially what clusters belong to a file are in that table. Without that information, it's hard to figure out what blocks belong to a file or what directories exist.
See Design of the FAT file system - Technical overview and The FAT File System TechNET article.
An inode-based system on the other hand usually follows a different pattern. One of the major differences is that an inode might point to a list of pointers (very similar to an inode) that points to the actual blocks. So rather than having an index of every single cluster on the disk you only have an index of the (max) number of files. Another major difference is how directories are being handled.
Talking about an inode system requires a bit of a broader view and looking at the Kernel.org article you will find that the location of the inode table is not fixed within a block group and there can be multiple block groups per FS. Each block group features its own inode table. In that way, though you have a contiguous filesystem you might have multiple inode tables that allow you to reference files.
See:
- David A. Rusling - EXT2 Directories
- David A. Rusling - The EXT2 Inode
- inode pointer structure
- SO: Where are inodes stored at?
- SE Unix: What is a Superblock, Inode, Dentry and a File?
- SE Unix: Where are i-node tables stored?
- Kernel.org ext4 Data Structures and Algorithms » 2. High Level Design
- Kernel.org ext4 Data Structures and Algorithms » 3. Global Structures
- Kernel.org ext4 Data Structures and Algorithms » 4. Dynamic Structures
- PC-Freak.net: What is inode and how to find out which directory is eating up all your filesystem inodes on Linux, Increase inode count on a ext3 ext4 and ufs filesystems
- Location of inodes (ext)?
Related videos on Youtube
Rashid
Rashid is working as a programmer since the year 2013. He is passionate to writing code and helping other coders and programmers to learn the new technique and skill of programming. Rashid is also writing technical blogging, which you could see on his blog >> https://rashidjorvee.blogspot.com
Updated on September 18, 2022Comments
-
Rashid over 1 year
Since both are used to map the usage of disk space then how are they different from each other?
-
phuclv almost 7 yearsFAT is a filesystem and inodes are structures used in Unix filesystems and have no relation whatsoever. FAT should be compared to things like ext4, btrfs... and FAT table is like inodes list
-
quadruplebucky almost 7 yearsSaying they are both used to map the usage of disk space makes no sense. FAT is a simple, easy to implement, thus successful method of organizing data on durable media. Inodes are abstract data structures used only by implementers of filesystems and the programmers who love them.
-
-
phuclv about 3 yearsare you sure? ReiserFS stores inodes in a single list. And ext2 also stores it in a single space
-
Seth about 3 yearsIt might come down to different implementations and some lingo. See The FAT File System TechNet article for inodes see e.g. this. The structure on how files are represeneted is different even though both might have central tables that are important the way FAT uses those and inode based systems is differnet.
-
phuclv about 3 yearsof course it depends on implementation, so your assumption that inodes are spread throughout the file system is completely wrong
-
Seth about 3 yearsNo, it is not as you can see in the edited answer. Unless you want to cut it down to a single block group, which wouldn't make sense as a block group has no equivalent in FAT. So in comparison inodes are spread across the volume while that's not the case with FAT.
-
phuclv about 3 yearsyou know that ext2/3/4 aren't the only file systems, right? There are other POSIX file systems and they may not scatter the inode structures around. Even NTFS is 100% POSIX compatible because it can store all POSIX permissions and all POSIX file names, and it has MFT record which is exactly the same thing as the inode structure
-
Seth almost 3 yearsIt is the basic structure. We're talking about FAT as well you realize that, right? Also read the Kernel.org article and don't forget to bring up that newer systems might not be using inodes altogether. If you think you have a better answer provide it. Instead of discussing a 4 year old answer. POSIX compatibility is way out of scope for the question asked and doesn't matter at all for the question.