Rebuilding the master database is done using the Rebuild Master utility
“rebuildm.exe” which is located in the 80\Tools\Binn directory of the
SQL Server installation.

Select the server and instance that you want to rebuild.
Now you are going to need access to the files from the install CD for SQL Server.
Browse to the Data dircetory in the SQL Server install files.
Set the collation you want SQL Server to be using, and hit Rebuild.

If you are run the utility using the CD as the source, you might encounter the error:

Rebuild Master failed with error -1:

Microsoft Support Q273572 lists the error as a bug in the utility. As it copies the read-only
files from the install CD it does not turn off the read-only flag. To work around this
simply copy the Data directory from the CD to the harddrive and turn off the read-only
setting for the files. Then go ahead and rebuild again.

With the master database rebuilt, verify that it worked by starting SQL Server. The instance should
start, but all the previous settings and databases will be missing. Restoring the Master database
will bring back all the previous instance settings.

Read on about how to [story:sql2000-restore-master-database].