in reply to measure Win32 disk fragmentation with Perl?

AFAIK, there are no modules that will do that for either FAT or NTFS volumes. I thought maybe the Disk Defragmenter in Windows 2000 might be available over WMI (Windows Management Instrumentation), but that proved false. If you have a Windows Server 2003 machine, this info may be useful: Win32_Volume Class. Other than that, I don't see any automated options for you. Sorry -- I tried. :)



mhoward - at - hattmoward.org
  • Comment on Re: measure Win32 disk fragmentation with Perl?

Replies are listed 'Best First'.
Re: Re: measure Win32 disk fragmentation with Perl?
by flyingmoose (Priest) on Apr 26, 2004 at 18:58 UTC
    Other places to look (if absolutely needed) include SNMP .. or raw Win32 API ...

    Or switch to Linux and stop worrying about fragmentation :)

      Or switch to Linux and stop worrying about fragmentation :)

      To be fair, NTFS is pretty good at handling fragmentation. It's that old simple-stupid FAT fs you have to worry about. No sane admin should be running a server using primarily FAT. Few desktop users running 2k or XP should need it, too.

      ----
      : () { :|:& };:

      Note: All code is untested, unless otherwise stated

        To be fair, NTFS is pretty good at handling fragmentation. It's that old simple-stupid FAT fs you have to worry about.

        I ran NTFS for maybe four years? I fought switching to Linux much harder than I should have. I had to format (Win2k Pro) about every year to keep the machine running happy. I'd run defrag (a lot), but it still was never running like "brand shiny new" -- /some/ of this could be registry corruption, but I think the greater problem is that stuff gets strewn out all over the disk and is never reassembled back in logical order -- not neccessarily fragmentation, but at least scattering of files.

        Every Windows box I've ever installed (including for relatives) eventually gets in to a state where it thrashes and grinds uncontrollably until you reinstall it from scratch (format). I attribute *most* of Linux's performance on the availability of better filesystems, lack of defrag issues, and good IO tuning. The other fact to consider is how many times I've been burned by NTFS corruption in things like kernel32.dll (or elsewhere).

        ext3 kicks NTFS's proverbial buttocks. So this is a difference between fragmentation and scattering, true, but defrag (originally) was designed to fix both (edit: I'm confusing compaction with rearrangement) -- but either way, Windows file storage and retrieval capability does not age well with time ... people like my folks shouldn't have to worry about reinstalling their OS every year to keep it happy -- and these are light users who only surf and do not download attachments, etc (i.e. trained well!).