The SQL Server instance must be stopped before recovering the master database.