I would like to have the Windows Server Backup data compressed on the file system. The lion's share of data is consumed by .vhd files in the \WindowsImageBackup\<hostname>\Backup <timestamp>\ directory.

I have tried pre-enabling compression for the entire volume, but Windows Server backup seems to explicitly disable the compression flag for the .vhd files it is producing. I also have tried setting the compression flag for the .vhds after the backup is done, but it seems to be reset upon the next backup run.

So how would I force the software to just stick with the compression choice I have selected? Is there any good reason for Windows Server Backup to disable compression for the .vhd files?


Apparently, I have at least found the answer for question #2 - the "good reason" to disable compression on .vhd files is because it is broken beyond repair for common NTFS volumes:

A blog post on VHDs and Hyper-V states

VHDs cannot be mounted within a compressed folder in Windows Server 2008 R2. This was possible in Hyper-V role in Windows Server 2008, but this capability was explicitly blocked in the Hyper-V role in Windows Server 2008 R2 since the compressed file size limit is relatively small. A dynamically expandable VHD can easily outgrow that limit and get corrupted.

while the MSDN library explicitly mentions it as a file system limitation:

If you compress a file that is larger than 30 gigabytes, the compression may not succeed.

and KB967351 (A heavily fragmented file in an NTFS volume may not grow beyond a certain size) states that

When a file is very fragmented, NTFS uses more space to save the description of the allocations that is associated with the fragments. The allocation information is stored in one or more file records. When the allocation information is stored in multiple file records, another structure, known as the ATTRIBUTE_LIST, stores information about those file records. The number of ATTRIBUTE_LIST_ENTRY structures that the file can have is limited.

We cannot give an exact file size limit for a compressed or a highly fragmented file. An estimate would depend on using certain average sizes to describe the structures. These, in turn, determine how many structures fit in other structures. If the level of fragmentation is high, the limit is reached earlier. When this limit is reached, you receive the following error message:

[...] STATUS_FILE_SYSTEM_LIMITATION The requested operation could not be completed due to a file system limitation[...]

Compressed files are more likely to reach the limit because of the way the files are stored on disk. Compressed files require more extents to describe their layout. Also, decompressing and compressing a file increases fragmentation significantly. The limit can be reached when write operations occur to an already compressed chunk location. The limit can also be reached by a sparse file. This size limit is usually between 40 gigabytes (GB) and 90 GB for a very fragmented file.

The hotfix accompanying KB967351 is meant to add support for something it is calling "large File Record Segment (FRS)". Format.exe is getting a new parameter /L to enable this for a newly created file system. Format.exe included in Server 2012 already has /L, just as the Format-Volume cmdlet has the -UseLargeFRS parameter. I wonder if Server Backup in 2012 allows for compressed VHDs by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.