Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know the magic number of the current partitions and also the procedure of changing the magic number for the file system types.

share|improve this question
Why would you want to change the magic number? – m0skit0 Feb 13 '12 at 11:37
I want to make my own file system using ext3 type but want to change file system name and magic number so that no one can copy the content of that – Bhavik Ambani Feb 13 '12 at 12:44
Sounds like too much work for hiding data... Why don't you just encrypt the partition? – m0skit0 Feb 13 '12 at 13:21
I've done work on filesystems, for real, and then the question does make sense. But in all honesty, if you have to ask such a simple question, then the job of designing a new filesystem will be far too complex. Oracle started work on Btrfs in 2007, and it still isn't finished. And that's a multi-billion dolar company with experienced engineers. – MSalters Feb 13 '12 at 13:38
up vote 2 down vote accepted

For the first part, you can use dumpe2fs or tune2fs to read and modify tunable file system parameters. But AFAIK, they don't allow changing the magic number of a superblock. This is possible with recovery software, such as TestDisk.

Note that if you modify the magic number, the partition would likely not be mountable anymore, as it's an identifier for the system to know how to handle the data on that partition.

share|improve this answer
What if I want to change the magic number of the partitions – Bhavik Ambani Feb 13 '12 at 11:45
You can use whatever partition editing tool you wnat. There are plenty out there. In my post, TestDisk is able to do it as well. But usually this shouldn't be done, except if for recovery purposes. – Karolos Feb 13 '12 at 12:01
Suppose I have file system image file, now I dont know the file system, then how can I know the file system or magic number etc. ? – Bhavik Ambani Feb 13 '12 at 12:43
Ok. That's much clearer :) As far as linux is concerned, a disk image is the same as a real disk; so you can do tune2fs -l /path/to/your/image – Karolos Feb 13 '12 at 12:51
What if I want to know the magic number of the partition that is unknown to me. I tried with that and it gave me an error – Bhavik Ambani May 2 '12 at 12:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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