1

SCOM 2007 R2 added a fragmentation analsysis health check that is producing warnings on many of my servers. To try to understand how SCOM is determines the fragmentation level, I created the following Powershell script that reproduces the same data:

$vols = Get-WmiObject -computername "Z002" Win32_Volume -filter "DriveType=3"
$defragInfo = $vols | %{$_.DefragAnalysis() | add-member -membertype noteproperty vname $_.name -passThru}
$defragInfo | %{$_.DefragAnalysis | add-member -membertype noteproperty DefragRecommended $_.DefragRecommended -passThru | add-member -membertype noteproperty vname $_.vname -passThru} | out-file ./tmp.txt

Sample output below. SCOM uses the FilePercentFragmentation number to warn on anything over 10%, what I'm wondering is how is the percentage calculated since it certainly isn't fragmented files divided by total files.

DefragRecommended : True

vname : I:\

AverageFileSize : 20277223990

AverageFragmentsPerFile : 1.11

ClusterSize : 4096

ExcessFolderFragments : 0

FilePercentFragmentation : 54

FragmentedFolders : 1

FreeSpace : 131237363712

FreeSpacePercent : 24

FreeSpacePercentFragmentation : 0

MFTPercentInUse : 10

MFTRecordCount : 65

PageFileSize : 0

TotalExcessFragments : 4

TotalFiles : 35

TotalFolders : 14

TotalFragmentedFiles : 2

TotalMFTFragments : 2

TotalMFTSize : 606208

TotalPageFileFragments : 0

TotalPercentFragmentation : 27

UsedSpace : 405626204160

VolumeName :

VolumeSize : 53686356787

1
  • By the way, I like your Powershell script. I'm going to pinch it.
    – user3914
    Oct 14, 2009 at 11:18

1 Answer 1

1

I'm making an educated guess here, but I think it has to do with average fragmented file size (e.g. how many files are fragmented vs not), and their size as a percentage of total files.

For example, on one of my production servers, I have 0% fragmentation for all files bar one, which happens to be the database MDF file. The 60GB file is in two fragments, but the total fragmentation report states 73%.

Hope that makes sense.

1
  • I think that's a good guess and a likely explaination -- thanks Oct 14, 2009 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .