Reformatting master MySQL server and temporary solution We have MySQL master and replication servers both running on different machines. We have noticed some system files showing integrity issues in the master machine. Temporarily we would like to make the slave as a master and reformat the original master and then bring back everything to the original architecture.  

What are the crucial steps now for us to maintain data integrity?  

We can down the master and let the inserts and update take place in the replication db, but how do we revert back to the original situation later?
Globally speaking, I would essentially be performing the following steps in the same situation.

Before starting, backup everything on both machines.  


Put the website or application into maintenance, preventing users from accessing the database.  Also make sure there are no imports/updates/activity coming in from cron jobs.  You can verify this by running SHOW FULL PROCESSLIST; in MySQL.
Make sure the slave server is fully synced with the master. Read notes below. 
Stop replication on the slave server STOP SLAVE; and turn off the master server.
Exchange IP addresses between the old and new master server.  Or point the application's database connection to the slave server. 
Bring the application back online.
Perform your maintenance on the old master server. 
Once your old master server is back up and running
Put the website or application back into maintenance.
Backup your new master server's database and restore it to the original and now functional master server.
Exchange IP addresses once again between the two machines. Or point the application's database connection to the master server again.
Reconfigure replication between the newly restored master server and the original slave server.  Read notes below.
Bring the application back online.


For step 2, when you are making sure that the master and slave are synced, you would do this. Comparing the current log file and file position for both servers.

On the master server

SHOW MASTER STATUS;

mysql&gt; SHOW MASTER STATUS;
+---------------+----------+--------------+------------------+
| File          | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------+----------+--------------+------------------+
| mysql-bin.003 | 73       | test         |                  |
+---------------+----------+--------------+------------------+


On the slave server

SHOW SLAVE STATUS;

mysql&gt; SHOW SLAVE STATUS\G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: master.server.ip.address
                Master_User: root
                Master_Port: 3306
              Connect_Retry: 3
            Master_Log_File: mysql-bin.003
        Read_Master_Log_Pos: 73


Since you are planning on reverting back to the original infrastructure, there is no need to setup the slave server as a new master.  You can leave the slave server's configuration in place, so that once the master server is back online, you can restart replication more quickly. 

Configuring replication 

Rolando answered a similar question with an easy to read how to on setting up replication. 

Clarification about master slave configuration in mysql