When we format a partition in a hard disk with a file system using mkfs -t ext4 /dev/sdb1, what's the data that is written on to /dev/sdb1.?

Some data identifying the filesystem type has to be written on to the partition. What is this data and to which area of the partition this data will be written.? I think that this data about the filesystem is required by other computers to identify what is the filesystem on a partition.

closed as off-topic by Ipor Sircer, Archemar, Christopher, Mr Shunz, peterph Jan 24 at 20:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Ipor Sircer, Archemar, Christopher, Mr Shunz, peterph
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    what research have you done? ...... en.wikipedia.org/wiki/Disk_partitioning – jsotola Jan 24 at 7:28
  • this gives info about partitioning and partition types. I asked about the filesystem data that is in a partition. i.e if a parition is formatted as ext4, where will be the information that this partition is ext4 is stored. – Akhil Mohan Jan 24 at 7:45
  • 1
    there are many links on that page ..... it is your job to do the actual research and follow them – jsotola Jan 24 at 18:00
  • Literally: "What research have you done so far?" Have you tried using a search engine? – peterph Jan 24 at 21:19

File systems all store information about themselves, often with some form of signature so that they can be identified. In Ext4’s case, the signature is 0xEF53 at offset 0x438, which you can see with od:

$ od -A x -x -j 1080 -N 2 /dev/<your device>
000438 ef53

This signature is part of the superblock, which contains information such as the overall size of the file system, the features it supports (e.g. whether it has a journal, uses extents, etc.), whether it’s clean or not...

For Ext4 you’ll find a description of the on-disk layout on the Ext4 wiki. Other file systems have similar documentation. You can find other signatures by reading the file systems magic file used by file.

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