Article ID: 114829, created on Sep 24, 2012, last review on Mar 18, 2016

  • Applies to:
  • Virtuozzo containers for Windows

Information

This article explains how to check a container's disk fragmentation level in Parallels Virtuozzo Containers for Windows.

Resolution

Using defrag tool

The regular Windows defrag.exe tool works perfectly inside containers and can be used for fragmentation analysis:
C:\Users\Administrator> vzctl enter 101
C:\Windows\system32>defrag C:\ /A /V
defrag C:\ /A /V
Microsoft Disk Defragmenter
Copyright (c) 2007 Microsoft Corp.

Invoking analysis on (C:)...


The operation completed successfully.

Post Defragmentation Report:

        Volume Information:
                Volume size                 = 499.99 MB
                Cluster size                = 2 KB
                Used space                  = 247.81 MB
                Free space                  = 252.18 MB

        Fragmentation:
                Total fragmented space      = 22%
                Average fragments per file  = 1.50

                Movable files and folders   = 56441
                Unmovable files and folders = 13

        Files:
                Fragmented files            = 33
                Total file fragments        = 92

        Folders:
                Total folders               = 13324
                Fragmented folders          = 33
                Total folder fragments      = 125

        Free space:
                Free space count            = 13
                Average free space size     = 16.99 MB
                Largest free space size     = 219.31 MB

        Master File Table (MFT):
                MFT size                    = 55.25 MB
                MFT record count            = 56575
                MFT usage                   = 100%
                Total MFT fragments         = 1

        Note: File fragments larger than 64MB are not included in the fragmentation statistics.

        It is recommended that you defragment this volume.

C:\Windows\system32>

Using disk usage information

The first indication of high fragmentation is a huge difference between the actual root.efd size and the vzquota accounted disk usage. This can be quickly checked with the attached script:
fragmentation_check.bat CTID

Example of a highly fragmented root.efd:
C:\>fragmentation_check.bat 100500
Disk File C:\vz\Private\100500\root.efd
Usage Inside of container(Bytes): 149538000
Image size on the server's disk(Bytes) 1,237,200,416

Example of a regular root.efd:
C:\>fragmentation_check.bat 100500
Disk File C:\vz\Private\100500\root.efd
Usage Inside of container(Bytes): 149538000
Image size on the server's disk(Bytes) 152,700,416

Attachments

965b49118115a610e93635d21c5694a8 2897d76d56d2010f4e3a28f864d69223 d02f9caf3e11b191a38179103495106f

Email subscription for changes to this article
Save as PDF