How to find out whether vmdk, vhd VM’s slowdown due to fragmentation on Windows?
I ran into this issue a couple of days ago on my windows and unix host machines running vmware workstation: namely the vm was responding really slowly. On windows XP (and beyond as I understand) there is defrag utility (accessories->system tools). I ran it with the analyze option
It produced the following report:
Which showed that my VM had 263 fragments!!!
My next thought was whether I could find a script to run this periodically …. I could only find scripts to run defrag from the command line which produces output (below) but no information on specific files. I am in search of something like filefrag for ext* which can tell me fragment info just for one file.
C:\>defrag -a -v c:\
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International, Inc.
Volume size = 74.46 GB
Cluster size = 4 KB
Used space = 70.85 GB
Free space = 3.61 GB
Percent free space = 4 %
Total fragmentation = 22 %
File fragmentation = 42 %
Free space fragmentation = 3 %
Total files = 362,428
Average file size = 305 KB
Total fragmented files = 11,723
Total excess fragments = 36,590
Average fragments per file = 1.10
Pagefile size = 2.00 GB
Total fragments = 1
Total folders = 83,631
Fragmented folders = 2,269
Excess folder fragments = 7,870
Master File Table (MFT) fragmentation
Total MFT size = 437 MB
MFT record count = 446,433
Percent MFT in use = 99
Total MFT fragments = 3
You should defragment this volume.