Tuesday, November 23, 2010

SQL Server Restore error working with backup file (.bak) – Operating system error 21 (The device is not ready)

When I create backup database (.bak) from production database server and restore in development server. An error may occur when I restore it using the SQL Server management studio.
The error is like this: "System.Data.SqlClient.SqlError: Directory lookup for the file "...rap.mdf" failed with the operating system error 21(The device is not ready.). (Microsoft.SqlServer.Smo)"

The backups store the path of each file that was backed up, by default a restore will restore these files to the same path. The trouble comes when restoring on a different machine where this path does not exists.

We should check following options before going further:

  • Should create a new database at known location (of ldf & mdf files)
  • make  the overwriting = true when restore
  • In restore as option - provide correct file paths(same as of  created ldf & mdf files)

1 comment:

  1. Not ready to take DB Backup in SQL Server Management Studio? Contact to DB Recovery Support
    This appears to be extremely odd making basic inquiry to take the DB Backup in SQL Server Management Studio. Anyway taking reinforcement isn't so troublesome however it requires some sort of aptitude yet in the event that you don't have the foggiest idea about the procedure how to take reinforcement at that point unobtrusively contact to DB Recovery Services or Exchange Database Recovery to get back your information. We utilize straightforward methodology to determine your concern with propel procedures and with moderate costs.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801