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.
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.