The short answer depends on what "the drive name" means in your setup. If you are asking how to recover a SQL Server instance after the Windows drive letter that holds the data or log files has changed, the fix is not to restore the database from backup—it is to re-point SQL Server at the same physical files under their new drive letter, then bring the databases online. If you mean the SQL Server instance itself will not start because a disk now appears under a different letter, the same principle applies: Windows has moved the path, but the files are intact, so SQL Server needs the path corrected. If instead you mean the drive name of the server or a network share has changed, you need to re-create the storage path and let SQL Server reconnect. In every one of these cases, the databases are usually still there; what has changed is the path string that points to them.
The single most useful mental model: a drive letter is just a label Windows assigns to a volume. SQL Server stores the full file path, including the drive letter, for every database file. When the volume is reassigned a new letter, the files are unchanged but the paths in SQL Server's metadata and in the error log now point at a letter that no longer resolves to the right place. The repair is therefore about correcting path references, not rewriting data.
What "Drive Name" Usually Means in This Context
The phrase "drive name" is imprecise, and the correct repair depends on which of several things actually happened. It is worth separating them before you touch anything.
Drive letter changed (for example, the data volume used to be D: and is now E:). This is the most common cause and is usually what people mean. The physical disk and its files are fine; only the letter Windows mounts it under has changed. This can happen after a reboot, after a storage controller or SAN change, after adding or removing disks, after cloning, or after someone reassigned the letter in Disk Management. Volume discovered under a new name or mount point. On modern Windows, a volume can be mounted to a folder path or a new letter without changing its contents. Server name, hostname, or network share changed. If your databases live on a network path, an SMB share name, or you renamed the server, the path or connection target changed rather than a physical drive letter. The drive is genuinely gone or failed. If the volume is not present at all, the situation is different from a renamed drive: you are looking at recovery from backup or repair of a failed disk, not a path correction.
Get clear on which one you are facing before proceeding. The steps below focus on the first and most common case—the drive letter or mount path changed while the files remain intact—and note where the other cases diverge.
Quick Diagnosis: Is the Data Still There?
Before doing anything, confirm the files exist. Open Disk Management or File Explorer and look for the volume's contents, including the database files themselves. SQL Server data files typically have .mdf and .ndf extensions; log files use .ldf. If you can see these files on the new drive letter, you are almost certainly in the "letter changed" scenario, and no restore is needed yet.
Then check the SQL Server error log or the Windows Application event log. A classic symptom of a changed drive letter is messages indicating that a database file cannot be opened because the operating system cannot find the file, or that the log or data files for one or more databases do not exist. Notice that the path in the message names the old letter. That is your smoking gun.
A second symptom is the SQL Server service failing to start, with messages about the master database or model database being unavailable. SQL Server depends on the master database to start, and master itself has files on a specific drive. If the drive that hosted master has changed letters, the service cannot find its own system database and will refuse to start.
The Core Repair: Correct the Paths, Then Bring Databases Online
There are two broad situations, and they need different handling: the SQL Server service starts but individual databases are offline or suspect, versus the service itself will not start.
When SQL Server Starts but Databases Are Offline
If the instance is running, use SQL Server Management Studio (SSMS) or T-SQL to re-point each affected database. For each database, the sequence is: set the database offline, change the file paths using ALTER DATABASE ... MODIFY FILE, then bring it back online.
An illustrative example, assuming the data volume moved from D: to E::
The logical file names (SalesDB_Data, SalesDB_Log) are the internal names recorded in the database, not the operating-system file names. You can look them up with SELECT name, physical_name FROM sys.master_files WHERE database_id = DB_ID('SalesDB');. That same query also shows the old physical path you are replacing.
Repeat for each additional data file (.ndf files) on the moved volume.
For databases that share a common drive change, you can generate the ALTER DATABASE statements programmatically from sys.master_files, then run them after taking the databases offline. Be careful: scripted changes are only safe when you are confident every file on the affected volume landed at a predictable new path.
When SQL Server Will Not Start
This is the harder case, and it usually means the master database (and possibly model, msdb, and tempdb) is on the affected volume. You cannot run ALTER DATABASE against a stopped instance. The documented recovery path is:
1: Start SQL Server with the minimal configuration and with master's path corrected, using the startup parameters -m for a single-user or minimal mode and -f to start in minimal configuration. You also need the correct file paths for the system databases. Microsoft documents that you can use the -T3608 and -f startup options, and in older versions you could use sqlservr.exe -c -m from the command line to control startup, but the cleanest approach for a moved drive is to start the service with the correct paths so SQL Server can open master and the rest of the system databases. The practical point is to start in a restricted mode where you can run the corrective commands.
2: Re-point the system databases. Once SQL Server starts in restricted mode, run ALTER DATABASE against master and the other system databases to fix their file paths, just as you would for a user database. For master, you use MODIFY FILE the same way, and this requires the instance to be in a state where it can accept the change—this is why the restrictive startup is necessary.
3: Restart normally. After the system database paths are corrected, restart SQL Server in normal mode and confirm that it opens master and your user databases.
The exact flags have changed across SQL Server versions, so consult the documentation for your specific version rather than relying on a remembered command line. The conceptual steps—start restricted, correct master's path, restart—are stable.
Moving and Re-Pointing Databases the Supported Way
It is worth knowing that SQL Server has a designed procedure for relocating database files, which is also the safe template for a drive-letter change: take the database offline, move the files to the new path, update the paths with ALTER DATABASE ... MODIFY FILE, and bring the database online. If you are relocating to a genuinely new volume, you would physically copy or move the files (with SQL Server stopped or the database offline) and then update the paths. When a drive has merely been relabeled but the files stayed put, you skip the physical move and only update the paths.
Why Changing the Letter Back Is Sometimes the Fastest Fix
Before undertaking any of the above, consider simply restoring the original drive letter. If the volume is present and its files are intact, reassigning the letter it used to have in Disk Management will often make SQL Server start and find everything again without touching any database metadata. This is the lowest-risk approach when you are in a hurry and the original letter is available.
The catch is that the letter may now be claimed by another volume, or changing letters may disturb other applications that depend on the current assignment. The path-correction approach leaves Windows alone and changes only SQL Server's internal references, which is cleaner in the long run if the new letter needs to stay. Choose based on which side should be normalized.
The Distinct Case: A Renamed Server or Changed Share Path
If "drive name" refers not to a local drive letter but to the server's name, hostname, or the name of a share where database files reside, the repair is different. For a renamed server, you should run the supported procedure for renaming a server hosting SQL Server, which updates the internal system metadata so that the server name references match. For network paths, if the share name or UNC path changed, you update the file paths with the same ALTER DATABASE ... MODIFY FILE mechanism, using the new UNC path, and ensure the SQL Server service account has access to that share.
Databases on network shares (\server\share... paths) behave differently from local volumes in terms of support, performance, and permissions, so it is worth confirming that this is actually the architecture you are running before treating a path change as a simple letter swap.
What Not to Do
Two mistakes waste time in these situations.
The first is restoring backups that you do not need. If the files are intact and only the path changed, a restore overwrites perfectly good databases and, worse, risks restoring an older copy over newer data. Diagnose the path issue before reaching for backups.
The second is detaching and reattaching as a first resort. Detaching removes the database from the instance, and a botched attach—wrong file, mismatched log chain, or a failed operation that leaves the database in an odd state—turns a simple path fix into a bigger problem. Detach/attach is legitimate for specific migrations and when done carefully, but using ALTER DATABASE ... MODIFY FILE avoids the detach step entirely and is the more controlled repair for a letter change.
How to Prevent This Next Time
Drive letters are a fragile reference. A few practices reduce the chance that a letter change brings the instance down:
Use volume mount points or folder paths rather than drive letters for SQL Server data and log files on modern Windows. A volume mounted to a folder like C:\Mounts\SQLData is still identified by its underlying volume, not by a reusable letter. This removes an entire class of failure. Use dedicated volumes for data and logs and document their intended letters, so that any change is immediately visible and can be reverted. Assign drive letters deliberately through Disk Management rather than letting them shift when disks are added or removed, and be wary of systems that reassign letters after hardware changes. Test after storage changes. After any storage controller, SAN, clustering, or disk change, verify that SQL Server can start and that all expected databases are online before considering the work complete. Keep current backups regardless. Path repair is the common case, but the "drive is genuinely gone" case still only has one real answer: restore from a verified backup into a new location.
Bottom Line
When SQL Server loses a drive, the first question is whether the data is still there under a new letter or path. If it is, you almost never need a restore: correct the drive letter back, or update SQL Server's internal file paths with ALTER DATABASE ... MODIFY FILE, and the databases come back online. The only wrinkle is the system databases—especially master—which require a restricted-mode start before you can correct their paths and restart normally. Confirm the files exist, watch the error log for the old path, fix the references, and keep the physical relocation procedure in your back pocket for the case where there really is a new volume to move to.