• Fred Langa: Why does Disk Defrag (Win7) fail, despite plenty of room?

    Home » Forums » Newsletter and Homepage topics » Fred Langa: Why does Disk Defrag (Win7) fail, despite plenty of room?

    Author
    Topic
    #221955

    And you thought Langalist was dead…. Naw. It’s just morphing, gradually, into a blog. https://langa.com/index.php/2018/10/05/a-reader-asks-why-does-
    [See the full post at: Fred Langa: Why does Disk Defrag (Win7) fail, despite plenty of room?]

    6 users thanked author for this post.
    Viewing 14 reply threads
    Author
    Replies
    • #221962

      I started out on the Langa List, at first free, then paid, which then became Windows Secrets, which then added Woody’s lounge. Now I’m at Ask Woody.

      I always hoped to be the lucky one that Fred would visit to check out my computer to see how he could make it run better!

      Fred is a true technician; he knows his stuff.

      Group "L" (Linux Mint)
      with Windows 10 running in a remote session on my file server
      4 users thanked author for this post.
    • #221983

      What I find interesting, is that Mr. Langa did not recommend the questioner check his Windows and System logs using the Management tools to see if there were any errors being logged. That is often a good first look and makes no changes to the system. Even if the errors are just gibberish to you, there is usually someone who can descipher it, or you can look for the answer(s) online.

      For 41% fragmented with as much free space as the questioner has, it has not been working for a LONG time. I have never had even close to that level unless there was a hardware error occuring in the background, or a truly nasty crash or power failure during a large read/write session. Even that was during the old pre-NFTS Win98SE days.

      Defrag will not run if there are crosslinked files, but since NFTS I have hardly ever had that issue. The SMART report check is a good suggestion. The small application CrystalDiskInfo is good for that.

      My main concern is that I was always told to avoid corrective actions if there are potential hardware created errors or hardware was failing, as it would make it worse. That is why I would have recommended checking the logs for step one.

      I guess I prefer the PC equivelent of “First do no Harm.”

      1 user thanked author for this post.
    • #221988

      You ought to invite Mr. Langa to join us here on AskWoody!

      4 users thanked author for this post.
      • #222120

        I always hope that Fred’s hangin’ out in these parts.

        • #222729

          Now that I live in the Boston area, I am in “these parts” as far as living fairly close to Fred. I live in the “Metro West” part (but inside the I-95/Rte. 128 beltway), while he seems to hang out up north in the Mystic Valley. Two different worlds really, but not many miles apart. Still, this being Boston, I can hardly drive into the big mall in the Mystic Valley without getting well and truly lost!

          Like Fred, I volunteer in some outdoors trail and river watershed projects, with the Waltham Land Trust and the Charles River Watershed Association. This keeps my body from getting stuck in a sedentary and unhealthy condition. Again, two rivers just a few miles apart, but different worlds. With so much damage to our environment around here over the four centuries Europeans have settled here, there’s always much to do.

          -- rc primak

    • #222017

      One thing Disk Defragmenter (at least in Windows 7) does not defragment is the Registry, although it appears listed without comment along with the storage devices that can be defrag in the window of this application. There is a whole industry producing allegedly great Registry defragmenters, cleaners, etc. Using them, usually not a good idea: https://www.thewindowsclub.com/registry-defrag-good-or-bad

      I am mentioning this in case someone gets confused about the subject of this thread, which is about the PCs’ mass storage, not about the Registry.

       

      Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

      MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
      Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
      macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

      • #222037

        @OscarCP, and what of the pagefile.sys and hiberfil.sys?

        If debian is good enough for NASA...
        • #222048

          At least in Windows 7, the user does not see those two listed in the Defragmenter’s window. My only intention here was to tell those who may not be aware of it, that at least the Win 7 Registry, while it is listed along with several items that actually get defragged, as if implying that it is also going to be defragged, actually does not get defragmented with Defragmenter.

          In other words: a fragmented Windows 7 Registry is just part of life. Forget about it so you may live long and prosper. Or worry and go try some dodgy software you can find and download on line, so you may not.

          Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

          MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
          Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
          macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

          1 user thanked author for this post.
    • #222022

      If the system disk is an SSD, that described behaviour would all be quite normal 🙂

      • #222052

        True enough. I also understand that defragging an SSD is a bad idea. It cuts down its useful life, because of all the extra and unnecessary I/O operations that tend to wear it down without a countervailing gain. In several respects, those devices are like random access memory, including the fact that defragging RAM is about as useful, and productive as, for example, if one’s intent is to become really popular in the community, attending church services naked.

        Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

        MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
        Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
        macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

        • #222731

          Defrag is not recommended on SSDs. Windows 10 (and maybe Windows 7) knows this. There is “garbage collection” in a function known as Trim. This is supposed to run (in Win 10) every two weeks, but it can be run (in Win 10) manually. This may also apply to Win 7. Trim may help speed up performance on some SSDs, but it is not a cure-all for the slowing which occurs over time as an SSD fills up.

          -- rc primak

    • #222035

      Kind of surprised Fred didn’t mention chkdsk /r. That’s the command to use to check for physical errors on the disk. /f only checks the file system itself.

      Red Ruffnsore

      3 users thanked author for this post.
    • #222088

      What I find interesting, is that Mr. Langa did not recommend the questioner check his Windows and System logs using the Management tools to see if there were any errors being logged.

      Indeed.  Controller failures, physical disk issues, overheating, faulty cables, corrupted NTFS tables…. lots and lots of potential problems, and most of them will be logged to the System log.   That should be the -first- port of call for anyone attempting to diagnose a disk problem.

    • #222138

      I wouldn’t have suggested any of Fred’s suggestions until confirming that the drive’s dirty bit hasn’t been set, until confirming via a third party utility the drive’s S.M.A.R.T. status, and until confirming the drive’s make and model number in order to assure that the drive is not falsely reporting the drive’s S.M.A.R.T. status. Think about Maxtor drives which did not report, via S.M.A.R.T., that the drive had remapped failing sectors to reserved sectors, and which would only update the drive’s S.M.A.R.T. status when there were no more reserved sectors available for remapping failing sectors. Yes, Maxtor hid their design flaws. Seagate wasn’t aware of this, and for quite a while, Seagate suffered after buying Maxtor along with Maxtor’s flawed production lines. This is a long story, yet this was years ago.

      The OP mentioned that his Windows 7 system disk has only a 100MB capacity and with 70% free. The question is, what drive is the OP using? Is the OP using a really old hard drive, or perhaps a 100MB SSD, either of which has become long in the tooth? One never should defrag SSD drives since fragemation on SSD drives does not matter in terms of performance. And one never wants to repeatedly defrag platter hard drives. In fact and on all of my Win7 computers which have platter hard drives, I defrag the OS partitions on my platter hard drives only once a year.

      I generally use cheaper hard drives. I read the specs in terms of their intended use in terms of the number of data overwrites, and in the context of the drive’s warranty. Constant or repeated defragging of consumer hard drives is a great way to prematurely age consumer hard drives which are not meant for an order of magnitude of more overwrite cycles. Again, I don’t defrag any consumer grade hard drives, all of which have less than 5 year warranties, except manually an only once or perhaps twice a year. The upshot is that the safest data is the data which does not get repeatedly moved by a plethora of defragmentation cycles.

      Somebody recently posted in another thread that Windows automatically defrags any file when it is opened. I don’t know if this true, yet I assume that Windows 10 or possibly Windows 8.1 might do this? If this is true, then this yet another reason why I will stick with Windows 7 with auto defrag disabled, since I don’t want Microsoft prematurely aging my hard drives in terms of maximum overwrite cycles. Again, I don’t know if this is true. If somebody proves that this is true, then I for one would be royally upset since this would amount to intentional hard drive lifetime degradation by Microsoft.

       

      3 users thanked author for this post.
      • #222149

        GoneToPlaid wrote: ” And one never wants to repeatedly defrag platter hard drives. In fact and on all of my Win7 computers which have platter hard drives, I defrag the OS partitions on my platter hard drives only once a year.

        Thanks for the tip: I’ve been defragmenting the (spinning) hard disk in my 7 year old Windows 7 PC every Patch Tuesday since I can remember. Instead, now I am thinking of doing it just twice a year, in June and December, and see how I like it.

        Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

        MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
        Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
        macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

        2 users thanked author for this post.
    • #222170

      The default setting for Disk Defrag in Win 7 is auto-schedule defrag every fort-nightly at 3am, Wednesday(?). If the user is doing conflicting stuffs with the disk while it is being auto-defragged on schedule, the built-in Disk Defrag or Task Scheduler program may likely become borked.

      So, it is better to reset Disk Defrag to manual, similarly for Windows Update(= to prevent the computer from being borked by buggy auto-updates)

      1 user thanked author for this post.
    • #222309

      The default setting for Disk Defrag in Win 7 is auto-schedule defrag every fort-nightly at 3am, Wednesday(?). If the user is doing conflicting stuffs with the disk while it is being auto-defragged on schedule, the built-in Disk Defrag or Task Scheduler program may likely become borked. So, it is better to reset Disk Defrag to manual, similarly for Windows Update(= to prevent the computer from being borked by buggy auto-updates)

      On all of my Win7 computers, the default Defrag settings which cause issues appear to be:

      Triggers: At 1:00 AM every Wednesday of every week

      Conditions:

      1. Start the task only if the computer is idle for: 3 minutes
      2. Wait for idle for: 7 days
      3. Stop if the computer ceases to be idle.

      Settings:

      4. Run task as soon as possible after a scheduled start is missed.
      5. Stop the task if it runs longer than: 3 days

      My notes:

      — Regarding Condition #1, it appears that Windows determines that the computer is idle only by checking whether or not the user is using the keyboard or mouse.

      — Trigger Condition #1, in conjunction with Trigger Condition #2 and Setting #4, will cause Defrag to launch and run during OS bootup the next time you reboot your computer and if you do not immediately start working on your computer. During OS bootup, Windows 7 does become idle for more than 3 minutes, especially if you don’t log into Windows, since all Delayed Start programs do not load until 5 minutes after you log into Windows. Again, Windows considers the computer to be idle only if it isn’t detecting any use of the keyboard or mouse.

      — Trigger Condition #2 in conjunction with Settings #4 and #5 pretty much guarantees that Defrag will try to run all the time, unless Defrag actually manages to complete its defragmentation run within 3 days.

      The result is that if you were using your computer when the default Trigger occurred, then on reboot, Defrag will launch after 3 minutes of idle time during the OS bootup, and before all Delayed Start programs try to run. This will occur every time you reboot your computer! Moreover, Defrag will try to continue to start and run, for the next 7 days, every time Windows thinks that you haven’t been using your computer for more than 3 minutes!

      The upshot is that the default Task Scheduler settings for Defrag, depending on real world user computer usage scenarios, can create a sort of endless loop if you were using your computer at the Trigger time. This can occur due to Condition #2 in conjunction with Settings #4 and #5.

       

    • #222313

      To be a bit more clear about what I do (in the following order) before I manually run Defrag on my OS partitions…

      1. I use either CrystalDiskInfo or Speccy to verify that the hard drive has not ever remapped even one (1) sector, as this is the first sign that a hard drive is either beginning to fail or that the hard drive has experienced a strong vibrational shock during use. Never defrag a drive which shows signs of failing! Instead, immediately clone it to a new hard drive! Defragging a failing hard drive has non-zero chance of killing a failing hard drive.

      2. I make sure that the OS partition’s Dirty Bit is not set, since one want’s to resolve whatever the issue is that caused the OS partition’s Dirty Bit to become set to True.

      3. I check the drive for errors by scheduling an error check for the OS drive and rebooting so that the drive is checked for errors.

       

    • #222428

      While I, too, have always admired Mr. Langa’s work, I would like to point out that the last time I attempted to Clean Up System Files on Win7, on reboot the machine would no longer start windows. It hung interminably with a message to the effect that it was applying windows updates. Very luckily, I had a recent backup and was able to restore the system. I’d advise anyone who’s going to try to clean up system files to have a backup handy.

    • #222434

      Thanks for all the helpful comments.

      For my part, I have had the defrag utility always set to “manual”; whenever I get around to start defragging the main drive and the other bits and pieces, I do do nothing else than to look at that utility’s window to see how things are going. Otherwise I leave the machine well alone. I imagine that it is always possible that some clueless system process might try to kick in right in the middle of it all and really mess things up, but that has never happened in the seven years since I bought the PC.

      Of course, statistics based on one single case may not be all that reliable, but I am putting this out there, anyhow, as just one more data point.

       

      Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

      MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
      Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
      macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

    • #222443

      Oh dear, oh dear. I use both Disk Cleanup and Disk Defragmenter regularly and both appear to work perfectly. I must have a problem.

      5 users thanked author for this post.
    • #222741

      I did get a bit of a chuckle out of something Fred posted under his personal info.

      But here’s another thing: Windows itself has changed. Under most normal circumstances, on decent hardware, Windows 10 is mostly self-maintaining. There’s just not as much need for deep-geek repair work anymore; and thus not as much to write about.

      I do wonder especially right about now, whether Fred might reconsider his remark about how “self-maintaining” Windows 10 is these days.

      -- rc primak

    Viewing 14 reply threads
    Reply To: Fred Langa: Why does Disk Defrag (Win7) fail, despite plenty of room?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: