I really don't know which stackexchange site to ask this question on. So here I go...

I know that we have various file systems today and most OSs(except may be a few) work with all of them. I have always wondered how do OSs recognize which file system is being used? Consider the example of accessing hard-disk files from Linux live-boot USB. How does it know that the Os of hard-disk is using FAT and not NTFS or some such? I know that some bits are set which determine the file system. But is that all? Or are there other ways of determining file systems? I referred to sites like wikipedia-file systems makeuseof and many others. But none provide the information I am looking for. Will someone please provide me the table which lists file-systems and signature(as I like to call them) bits?

I found this helpful. But I still don't get half the things written there


Its a mixture of reading the partition table and signature. lsblk -no FSTYPE can be used for the former, file for the later.

For a signature list, https://raw.githubusercontent.com/php/php-src/master/ext/fileinfo/tests/magic is a starter .

  • The MBR (master boot record) holds the first boot code and the partition table. It can be replaced by e.g. the GPT (several other partition schemes exist). Here no file systems are involved yet. Partitions have a PBR (Partition boot record), which is often also called super block. And its content and even the layout depends on the file system (ok, some restrictions apply, but this is beyond the scope here) - in fact the file system defines its layout. – mifritscher Aug 31 '19 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.