Como o Windows calcula a porcentagem de fragmentação?

1

Ao executar defrag -a -v C: no Windows 2008 R2, recebi a seguinte saída:

Windows Disk Defragmenter
Copyright (c) 2006 Microsoft Corp.

Analysis report for volume C:

    Volume size                         = 40.00 GB
    Cluster size                        = 4 KB
    Used space                          = 13.94 GB
    Free space                          = 26.06 GB
    Percent free space                  = 65 %

File fragmentation
    Percent file fragmentation          = 19 %
    Total movable files                 = 73,181
    Average file size                   = 233 KB
    Total fragmented files              = 1,574
    Total excess fragments              = 5,611
    Average fragments per file          = 1.09
    Total unmovable files               = 21

O valor Porcentagem de fragmentação de arquivo parece muito estranho para mim. Das contagens de arquivos, 1574 arquivos fragmentados são apenas 2% do número total de arquivos.

Como o Windows calcula o valor Percentual de fragmentação do arquivo ?

    
por jpa 05.03.2015 / 16:59

2 respostas

2

Parece que:

Porcentagem de fragmentação de arquivos = Porcentagem de espaço livre (após desfragmentação) - Porcentagem de espaço livre ( antes da desfragmentação)

Em outras palavras, o percentual de espaço livre adicionado ao executar a desfragmentação completa.

Como você pode ver, 7% = 31% - 24%:

C:\Windows\system32>defrag c: -w -v
Windows Disk Defragmenter
Copyright (c) 2006 Microsoft Corp.'

Defragmentation report for volume C:

    Volume size                         = 74.53 GB
    Cluster size                        = 4 KB
    Used space                          = 55.96 GB
    Free space                          = 18.57 GB
    Percent free space                  = 24 %

File fragmentation
    Percent file fragmentation          = 7 %
    Total movable files                 = 203,178
    Average file size                   = 342 KB
    Total fragmented files              = 3,641
    Total excess fragments              = 32,280
    Average fragments per file          = 1.19
    Total unmovable files               = 26

Free space fragmentation
    Free space                          = 18.57 GB
    Total free space extent             = 22,689
    Average free space per extent       = 858 KB
    Largest free space extent           = 4.09 GB

Folder fragmentation
    Total folders                       = 40,150
    Fragmented folders                  = 155
    Excess folder fragments             = 567

Master File Table (MFT) fragmentation
    Total MFT size                      = 203 MB
    MFT record count                    = 205,234
    Percent MFT in use                  = 98
    Total MFT fragments                 = 3

    Note: On NTFS volumes, file fragments larger than 64MB are not included in the fragmentation statistics

Defragmentation report for volume C:

    Volume size                         = 74.53 GB
    Cluster size                        = 4 KB
    Used space                          = 50.90 GB
    Free space                          = 23.62 GB
    Percent free space                  = 31 %

File fragmentation
    Percent file fragmentation          = 0 %
    Total movable files                 = 203,178
    Average file size                   = 342 KB
    Total fragmented files              = 3
    Total excess fragments              = 1,152
    Average fragments per file          = 1.00
    Total unmovable files               = 26

Free space fragmentation
    Free space                          = 23.62 GB
    Total free space extent             = 10,109
    Average free space per extent       = 2 MB
    Largest free space extent           = 6.99 GB

Folder fragmentation
    Total folders                       = 40,150
    Fragmented folders                  = 1
    Excess folder fragments             = 0

Master File Table (MFT) fragmentation
    Total MFT size                      = 203 MB
    MFT record count                    = 205,234
    Percent MFT in use                  = 98
    Total MFT fragments                 = 3

    Note: On NTFS volumes, file fragments larger than 64MB are not included in the fragmentation statistics

C:\Windows\system32>  

Por outro lado, quando, após a desfragmentação de uma unidade, o Porcentagem de espaço livre não é alterado, nem a Porcentagem de fragmentação de arquivos não é alterada, mesmo que o < O número de arquivos> Total de arquivos fragmentados é alterado:

C:\Windows\system32>defrag d: -w -v -f
Windows Disk Defragmenter
Copyright (c) 2006 Microsoft Corp.

Defragmentation report for volume D:

    Volume size                         = 932 GB
    Cluster size                        = 4 KB
    Used space                          = 841 GB
    Free space                          = 90.89 GB
    Percent free space                  = 9 %

File fragmentation
    Percent file fragmentation          = 2 %
    Total movable files                 = 400,108
    Average file size                   = 2 MB
    Total fragmented files              = 7,671
    Total excess fragments              = 1,420,753
    Average fragments per file          = 4.70
    Total unmovable files               = 7

Free space fragmentation
    Free space                          = 90.89 GB
    Total free space extent             = 213,633
    Average free space per extent       = 446 KB
    Largest free space extent           = 27.46 GB

Folder fragmentation
    Total folders                       = 16,189
    Fragmented folders                  = 526
    Excess folder fragments             = 2,304

Master File Table (MFT) fragmentation
    Total MFT size                      = 421 MB
    MFT record count                    = 405,678
    Percent MFT in use                  = 94
    Total MFT fragments                 = 3

    Note: On NTFS volumes, file fragments larger than 64MB are not included in the fragmentation statistics

Defragmentation report for volume D:

    Volume size                         = 932 GB
    Cluster size                        = 4 KB
    Used space                          = 841 GB
    Free space                          = 90.89 GB
    Percent free space                  = 9 %

File fragmentation
    Percent file fragmentation          = 2 %
    Total movable files                 = 400,108
    Average file size                   = 2 MB
    Total fragmented files              = 353
    Total excess fragments              = 1,226,342
    Average fragments per file          = 4.19
    Total unmovable files               = 7

Free space fragmentation
    Free space                          = 90.89 GB
    Total free space extent             = 260,094
    Average free space per extent       = 366 KB
    Largest free space extent           = 27.46 GB

Folder fragmentation
    Total folders                       = 16,189
    Fragmented folders                  = 1
    Excess folder fragments             = 0

Master File Table (MFT) fragmentation
    Total MFT size                      = 421 MB
    MFT record count                    = 405,678
    Percent MFT in use                  = 94
    Total MFT fragments                 = 3

    Note: On NTFS volumes, file fragments larger than 64MB are not included in the fragmentation statistics

C:\Windows\system32>
    
por 02.01.2016 / 16:24
1

Este cálculo está oculto, as informações são fornecidas por Classe Win32_DefragAnalysis :

A classe Win32_DefragAnalysis representa valores de fragmentação em um volume. Uma instância da classe Win32_DefragAnalysis é passada como um parâmetro out dos métodos Win32_Volume DefragAnalysis e Defrag.

class Win32_DefragAnalysis
{
  uint64 AverageFileSize;
  real64 AverageFragmentsPerFile;
  real64 AverageFreeSpacePerExtent;
  uint64 ClusterSize;
  uint64 ExcessFolderFragments;
  uint32 FilePercentFragmentation;
  uint64 FragmentedFolders;
  uint64 FreeSpace;
  uint32 FreeSpacePercent;
  uint32 FreeSpacePercentFragmentation;
  uint64 LargestFreeSpaceExtent;
  uint32 MFTPercentInUse;
  uint64 MFTRecordCount;
  uint64 PageFileSize;
  uint64 TotalExcessFragments;
  uint64 TotalFiles;
  uint64 TotalFolders;
  uint64 TotalFragmentedFiles;
  uint64 TotalFreeSpaceExtents;
  uint64 TotalMFTFragments;
  uint64 TotalPageFileFragments;
  uint32 TotalPercentFragmentation;
  uint64 TotalUnmoveableFiles;
  uint64 UsedSpace;
  string VolumeName;
  uint64 VolumeSize;
};
    
por 05.03.2015 / 17:25