Skip to content

Est. 2011ยทMicrosoft Partner 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix 3241

Error 3241: The Media Family on Device Is Incorrectly Formed

11 min read Updated October 5, 2026 SQL Server

Fix it now

The file you pointed a restore at is not something this instance can read as a complete backup set, and the restore never reached the database inside. Three situations cover nearly all of them: the file is truncated or still being copied, it was written by third-party software, or it is one member of a striped set.

Ask the file to describe itself before trying to restore it

RESTORE HEADERONLY FROM DISK = N'D:\bk\MyDb.bak';
RESTORE LABELONLY  FROM DISK = N'D:\bk\MyDb.bak';
  1. If HEADERONLY also fails, stop restoring. The file is not a native backup set this instance can read, and no restore option changes that.
  2. Read the family count from LABELONLY and compare it with how many files you actually hold. A count above one means a striped set.
  3. If it was striped, name every member in one statement: RESTORE DATABASE [MyDb] FROM DISK = N'D:\bk\p1.bak', DISK = N'D:\bk\p2.bak' WITH RECOVERY;
  4. Compare the file size against the source, and verify the copy: certutil -hashfile D:\bk\MyDb.bak SHA256
  5. If the file came from third-party backup software, restore it with that software. Native RESTORE cannot open a proprietary container.

3132 is the most useful member of this family because it counts for you: it prints how many media families the set has and how many you supplied.

If HEADERONLY lists the backup sets you expected, the file is fine and you can restore. If not, the next section explains how these files get broken.

Why it happens

A native backup writes to a media set. The media set is made of one or more media families, which in practice means one or more files, and each family holds part of the stream. Inside the set are backup sets, one for each backup operation, which is why several backups can live in one file. RESTORE has to read header structures at both levels before it can do anything useful, and this family of errors is what you get when one of those structures does not parse.

The four codes divide the problem cleanly. 3241 says the media family on the device is incorrectly formed and SQL Server cannot process it. 3242 is blunter: the file on the device is not a valid Microsoft Tape Format backup set at all, which is what you see with a file produced by a different backup product, or with a file that is not a backup. 3243 says the media family was created using a Microsoft Tape Format version this instance does not support, and it prints both numbers. 3132 counts the media families and tells you how many you supplied.

Truncated files are the most common cause and the easiest to miss, because a partial file looks entirely plausible in Explorer. A copy interrupted by a network drop, a file transferred in text mode rather than binary, a file read off a share while the backup was still writing to it, or a download that stopped short all produce something with the right name and the wrong contents. There is no partial restore: a backup set is meaningful only complete.

The file was copied incompletely

You have this one if HEADERONLY fails, and the file size does not match the source or the msdb backup history.

  1. Get the real size from the instance that produced it: SELECT backup_size, backup_finish_date FROM msdb.dbo.backupset WHERE database_name = N'MyDb' ORDER BY backup_finish_date DESC;
  2. Copy the file again with a tool that reports failures, such as robocopy, and confirm it exits cleanly.
  3. Hash both copies with certutil -hashfile <path> SHA256 and compare the values.
  4. Never copy a backup file while the backup is still running. Wait for the job to report completion.

If the only copy you hold is the truncated one, there is nothing to recover from it. Fall back to the previous full backup and the log chain after it.

It is one file of a striped set

You have this one if 3132 appears, or LABELONLY reports a family count greater than one.

  1. Run RESTORE LABELONLY FROM DISK = N'<one member>'; and read the family count and the sequence number of the member you have.
  2. Locate every other member. They were written at the same moment and are useless individually.
  3. Restore with all of them named in a single statement, in any order.
  4. If a member is genuinely lost, that backup is gone. Fall back to the previous full backup and the log chain.

The file came from third-party backup software

You have this one if 3242, or the extension and naming convention belong to a backup product rather than to a native backup job.

  1. Restore it through the product that created it. Most such tools write a container format that native RESTORE cannot open.
  2. If you no longer have the product, check whether it can export or convert to a native backup file from a machine that still has it installed.
  3. For future restores that must not depend on a third-party tool, schedule a native BACKUP DATABASE alongside the product’s job.

Some products write through the virtual device interface and produce genuine native backup sets. If yours does, the file will pass HEADERONLY and this is not your problem.

The media format version is not supported here

You have this one if 3243, which prints the Microsoft Tape Format version in the file and the version this instance supports.

  1. Read both numbers out of the message before assuming anything about product versions.
  2. Confirm both builds as well: SELECT SERVERPROPERTY('ProductVersion'); on the source and the target.
  3. Restore onto an instance at the same version or newer. Backups do not move down a version and no option overrides that.
  4. If you need the data on an older instance, move it as data – scripts, an export, or a copy of the tables – rather than as a backup file.

The file was damaged at rest

You have this one if The file restored successfully once and does not now, or it lives on deduplicated, compressed or archival storage.

  1. Try another copy of the same backup if you keep more than one.
  2. Restore from the previous full backup and roll forward with the log chain instead.
  3. Back up WITH CHECKSUM in future, and schedule RESTORE VERIFYONLY ... WITH CHECKSUM so damage is found while there is still time to react.

Full reference

Working out which of the five you have

What you observe What it means
RESTORE HEADERONLY fails as well Not a readable native backup set. Look at where the file came from
3132 naming a family count higher than the files you hold A striped backup. You are missing members
The file is smaller than the one on the source server A truncated or still-running copy
3242 Not a valid Microsoft Tape Format backup set. Almost always a proprietary format, or not a backup at all
3243 The media format version in the file is newer than this instance supports. The message prints both numbers
It worked last month and does not now Damage at rest. Check the storage, and use another copy

The three statements that describe a file without restoring it

Statement What it returns When to use it
RESTORE LABELONLY One row about the media set, including the family count First, when you suspect striping
RESTORE HEADERONLY One row per backup set in the file, with database name, type, position and dates To find out what is in the file and which position to restore
RESTORE FILELISTONLY One row per data and log file in the backup set, with logical names Before writing MOVE clauses

If HEADERONLY succeeds, the file is structurally sound and any subsequent failure is about the database inside it rather than about the media. That single fact saves a lot of time, because it moves the investigation from the file to the restore statement.

Why a striped set cannot be partly restored

The stripes are written in parallel and each one holds a fraction of the stream, interleaved. There is no sense in which the first file contains the first half of the database. That is the main argument against striping to targets you cannot guarantee to keep together, and it is why 3132 exists as its own error: the engine can tell you exactly how many members it is short.

Preventing the silent version of this

  • Back up WITH CHECKSUM so the backup itself detects damaged pages as it writes them.
  • Run RESTORE VERIFYONLY WITH CHECKSUM at both ends of any transfer, as a scheduled step rather than a habit.
  • Hash the file after transfer with certutil -hashfile <path> SHA256 and compare. Microsoft documents certutil’s hashfile option with MD5, SHA1, SHA256, SHA384 and SHA512.
  • Never read a backup file while the job that writes it is still running.
  • Copy with a tool that reports failure. A drag-and-drop copy that silently stops is how most truncated backups are made.

What no tool can do

Products exist that claim to repair a broken .bak file, and it is worth being clear about what is possible. If the file is truncated, the missing bytes are not anywhere in it and nothing invents them. If the format is proprietary, the answer is the product that wrote it. The effort is better spent getting a good copy from the source, or restoring the previous full backup and rolling forward, than on a tool that promises to reconstruct what was never transferred.

Every code this article covers

Code What it points at Source
3241 The media family on the device is incorrectly formed. SQL Server cannot process this media family Microsoft Learn
3242 The file on the device is not a valid Microsoft Tape Format backup set Microsoft Learn
3243 The media family was created using a Microsoft Tape Format version this instance does not support. The message prints the version in the file and the version supported Microsoft Learn
3132 The media set has a stated number of media families and only some were provided. All members must be provided Microsoft Learn

Confirm the fix worked

  1. Run RESTORE HEADERONLY FROM DISK = N'<path>'; and confirm it lists the backup sets in the file.
  2. Run RESTORE VERIFYONLY FROM DISK = N'<path>' WITH CHECKSUM; and confirm it reports the set as valid.
  3. Complete the restore and confirm the database comes online: SELECT name, state_desc FROM sys.databases;
  4. Run DBCC CHECKDB (N'MyDb') WITH NO_INFOMSGS; on the restored copy before putting it into service.
  5. If the file was transferred, compare hashes at both ends so you know the next transfer is trustworthy.

Questions people ask about this

Is there a tool that repairs a broken .bak file?

Products exist that claim it, but be realistic about what is possible. If the file is truncated, the missing bytes are not in it and no tool invents them. Spend the effort on getting a good copy from the source, or on the previous backup and the log chain.

Do I need a particular edition or licence to restore this?

No. Backup and restore are core engine features in every edition, and this error is about the file rather than your entitlement. The only version rule that matters is that you cannot restore onto an instance older than the one that made the backup.

Can I restore just part of a striped backup?

No. The stripes are written in parallel and each holds a fraction of the stream, so the set is only meaningful complete. This is the main argument against striping to targets you cannot keep together.

3243 mentions version numbers I do not recognise. What are they?

They are Microsoft Tape Format versions, not SQL Server product versions. The message prints the version the media was written with and the version this instance supports. It is still worth comparing SERVERPROPERTY(‘ProductVersion’) on both machines, because a newer source instance is the usual explanation.

How do I stop shipping broken files between sites?

Back up WITH CHECKSUM, verify with RESTORE VERIFYONLY at both ends, and compare a hash of the file after transfer. Three cheap steps that turn a silent failure into an alert.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

License Error Error 1412: The Remote Copy Has Not Been Rolled Forward Far Enough License Error Error 17300 and 1204: Worker and Lock Resources Exhausted on a Capped Edition Free Fix SSIS Error 0xC02020A1: Data Conversion and Truncation Failures in a Data Flow Free Fix Error 10054: Existing Connection Forcibly Closed During a Running Query
โ† Back to Knowledge Base