Reputation: 47
This might be a silly question but where is a filesystem logic code located? This question appeared while I was studying the implementation of filesystems in Linux:
I understand that different filesystems (ext4, xfs, etc) will create different structures in a storage disk. But how does the system know how to use those structures (for example, when I read from a file, how does it know the logic of: first check the inode of the file, then check the blocks associated with it...). Since different filesystems will have different structures, and so different file access logic, I'm guessing that there is some code somewhere which tells the OS how to read a file in a particular FileSystem. Where is that code?
My first guess would be that the logic code for each filesystem comes directly in the Linux Kernel. But this would mean that the Kernel only knows about the filesystems that the kernel developers put there (I guess) like ext4, xfs, FAT. What if someone wants to create their own filesystem? Do they have to update the kernel to include it?
Upvotes: 0
Views: 43
Reputation: 225162
Yes, the kernel has several filesystem drivers. There is also FUSE which allows userland implementation of filesystems.
Upvotes: 1