How to restore from tapes, if you get “Invalid block size”

Greetings from Veeam Support and welcome to the next episode of our troubleshooting series!

In this article, we will review how to resolve an issue that might be caused by a mismatch between the block size set in your Veeam tape drive properties and the one actually supported by the tape device itself. You will learn why block size can be different and how to fix it.

And even if you’ve never come across such a problem, you may also find this post useful, as under certain circumstances changing the block size can help you increase the processing rate. This is because when you have a higher block size, the drive is supposed to write data more quickly.

Invalid block size backstory

Something bad happened with your HBA controller and you had to replace it. Meanwhile, your Veeam Server stays the same (i.e. the OS and the application were not re-installed), and the tape library and the drive were not changed as well.

You set up everything and your boss asked you to restore a VM from some old tapes written a day before the HBA controller replacement. You see an “Error: Invalid block size” alert.

Identifying the error

First of all, ensure that you see exactly the same issue as we are going to describe. Start with checking restore logs on the Veeam Server from C:\Programdata\Veeam\Backup. In the log, you should see the following stack trace:

[timestamp] <01> Info [AP] (0f3e) command: 'getTapeMediaId\n\\.\Tape3\n'

[timestamp] <10> Info [AP] (0f3e) output: <error code="0">

[timestamp] <08> Info [AP] (0f3e) output: Cannot set block size: 1048576setMediaParameters error: Tape error: &#39;87&#39; (The parameter is incorrect.)

[timestamp] <08> Info [AP] (0f3e) output: --tr:Failed to recognize tape media block size

[timestamp] <08> Info [AP] (0f3e) output: --tr:Tape initialization FAILED.

[timestamp] <08> Info [AP] (0f3e) output: </error>

[timestamp] <08> Info [AP] (0f3e) output: >

[timestamp] <01> Error Invalid block size (Veeam.Tape.Core.MediaHeaderReadException)

For some reason, the new tape library did not let us set the previous block size for the tapes:

[timestamp] <08> Info [AP] (0f3e) output: Cannot set block size: 1048576setMediaParameters error: Tape error: &#39;87&#39; (The parameter is incorrect.)

Once you are done checking the logs, verify what block size is mentioned in the settings of the Veeam tape drive. If you can change it to the one that was used to write the data to tape, the issue is likely to be resolved. However, if you see that the maximum block size is lower than you expected, go to the Device Manager and verify the block size mentioned there. If there is any mismatch and the maximum available block size in the Device Manager is larger than the one in Veeam Backup & Replication, you are facing the same behavior we are investigating here.

For example, in the support case that became the blueprint for this article, the Veeam drive settings showed the maximum available block size of 512 KB. However, in the past there was a possibility to choose a bigger block size.

Troubleshooting Invalid block size

Fig 1. Drive settings in Veeam Backup & Replication

And in the Device Manager, the maximum available block size was 8 MB.

Troubleshooting Invalid block size

Fig 2. Tape Drive parameters in the Device Manager

So why do we have this restriction in Veeam, while the driver itself allowed the use of a bigger block size? To figure this out, let’s go deeper.

The deeper you look, the more you find

There can be several root causes of such behavior, but we’re going to examine the most common one. In the above case, the reason was in the block size limitation in the controller. As you remember, that was the only difference in the new setup — the new HBA controller. Per the Veeam Backup & Replication User Guide:

If you connect the tape devices via HBA, Veeam Backup & Replication uses the block size configured for the HBA.

Resolution steps

To resolve the issue, you need to determine what block size is supported and configured for HBA and align it with the one you want. After you change the block size, you need to run “scan for hardware changes” in the Device Manager. Once changes are applied for the drive, don’t forget to restart Veeam Tape Service.

There can be different scenarios for different vendors, which can easily be found on the internet. Further in this article, we’ll provide an example based on the HPE QLogic device. HPE provides an official article on changing block size in a QLogic HBA.

To manage settings, we downloaded a specific tool for our tape server’s OS from the HPE QLogic site.

To determine the block size that was set, we used -tsize cmd, as it’s shown on the image below:

Troubleshooting Invalid block size

Fig 3. HPE QLOGIC management tool

After that we set a new block size with the command -tsize /fc /set 2048 and were able to select a bigger block size in Veeam Backup & Replication. Keep in mind that you need to set the block size used previously for writing the data to this specific tape.

Troubleshooting Invalid block size

Fig 4. Updated drive settings in Veeam Backup & Replication

Conclusion

The issue with the invalid block size can appear not only during restore operations but also during inventory or cataloging. You should always keep in mind that whenever there are changes there are consequences. Check carefully for limitations, find the mismatches and try to fix them. Otherwise, we are always here and ready to help!

Read also:

Similar Blog Posts
Business | March 5, 2024
Technical | February 5, 2024
Business | December 7, 2023
Stay up to date on the latest tips and news
By subscribing, you are agreeing to have your personal information managed in accordance with the terms of Veeam’s Privacy Policy
You're all set!
Watch your inbox for our weekly blog updates.
OK
Veeam Data Platform
Free trial
Veeam Data Platform
We Keep Your Business Running