› Forums › Operating Systems › Windows Server 2008 R2 › Miscellaneous › Tip: Enable Windows 7 Boot Optimization Function in R2
- This topic has 15 replies, 6 voices, and was last updated 10 years, 11 months ago by
halladayrules.
- AuthorPosts
-
- 1st July 2011 at 03:45 #44288
Video Tutorial
[youtube:11cadpqg]http://www.youtube.com/watch?v=LQJQT_kmbXA[/youtube:11cadpqg]
Video is available in 1080p. Please view in full screen for optimal viewing experience.What is Boot Optimization?
Boot Optimization, not to be confused with “boot optimization tools” is a newly revised feature of the windows defrag utility that improves the overall startup time of a machine.
How does it work?
This feature works by reducing the overall amount of time your machine spends locating non-contiguous boot files and startup items during the boot process. By ordering these files in a contiguous manner, your disk heads spend less time seeking and more time accessing resulting in a much faster boot time.
How To Enable Boot Optimization
1. Install Superfetch
Superfetch is needed to rebuild the Layout.ini file for boot optimization to cache startup applications AND boot files.
You can download Superfetch via the R2 Conv GUI here: viewtopic.php?f=21&t=1460
Thanks to ExpertUser for the upload.
2. Download the BootOptimize.reg attachment below to enable the Boot Optimization feature. Note that you have only enabled the function and not actually used it yet!
3. Open Command Prompt. (Click start, type in cmd, and choose “Run as Administrator”)
In command prompt type in the following command:
sc start defragsvc
This will start the Disk Defragmentation service.
Next type in the following command:
rundll32.exe advapi32.dll,ProcessIdleTasks
NOTE: This process takes roughly 10-15 minutes to complete!
This command will build the Layout.ini located in C:WindowsPrefetch. It will build a “database” of optimized files that is passed on to the disk defrag service will which complete the process.
According to our good friend Wikipedia:
“Every three days, when the machine is idle, a list of files and directories that are referenced during the boot process and application startups is created. This list is stored in Layout.ini in the Prefetch directory, and is subsequently passed to the Disk Defragmenter, instructing it to place all the files in sequential order on the physical hard drive, which will further improve startup performance, as Windows will spend less time waiting for the hard drive’s heads to move to the relevant data. Alternatively, running “Defrag.exe %systemdrive% -b” from the command line forces a defragmentation of the prefetcher files without requiring a full Defragmentation”
TIP: Use Resource Monitor to track when this command has completed. You can tell when this command is complete based on the amount of disk thrashing in Resource Monitor. For example when you run the command you will see your Disk usage go up to say “10 MB/sec” and it will stay in MB range until it completes. When it completes your disk usage will go down to the KB range, signifying to you that the process has been completed.
To open Resource Monitor, click on Start and type in “Resource Monitor”. Then in Resource Monitor ensure that the “overview” tab is selected. On the right-side, look for “Disk”. You should see the current disk activity in KB or MB/sec. For example 100 KB/sec.
4. While still in command prompt, type in the following command:
defrag C: /b
Assuming C: is the drive letter of your operating system. If it is E: for example you would type in defrag E: /b
You will receive a message saying “Invoking Boot Optimization…”
The process should take 10-20 minutes depending on your hardware specs and speed of your hard disk. When you are able to type in commands into command prompt the process is complete.
Your computer will need to be restarted 6 times (not joking) in total for Windows to successfully learn the status of your boot files and build a sufficient database of prefetched files. If completed successfully after a few reboots you should notice a drastic reduce in boot time! You should notice a change by the 3rd reboot.
- 4th July 2011 at 03:24 #51853
Hi halladayrules, need Superfetch service ?
- 4th July 2011 at 04:05 #51854
@sythrar wrote:
Hi halladayrules, need Superfetch service ?
You might I’m not sure though. It’s a separate feature of 7 but im not sure if it utilizes the caching feature of Superfetch or uses another utility altogether.
- 9th July 2011 at 05:33 #51848
I made some tests and need Superfetch service, but look error:
Invoking boot optimization on (C:)…
Analysis: 100% complete.
Some registry entries were missing from the boot optimization section of the reg
istry. (0x89000017)Lacks some register, create in:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftDfrgBootOptimizeFunction
NAME – TYPE – DATA
Enable – REG_SZ – Y
LcnEndLocation – REG_SZ –
LcnStartLocation – REG_SZ –Look, now:
Invoking boot optimization on (C:)…
Pre-Defragmentation Report:
Volume Information:
Volume size = 241,73 GB
Free space = 220,15 GB
Total fragmented space = 0%
Largest free space size = 105,95 GBNote: File fragments larger than 64MB are not included in the fragmentat
ion statistics.The operation completed successfully.
Post Defragmentation Report:
Volume Information:
Volume size = 241,73 GB
Free space = 220,15 GB
Total fragmented space = 0%
Largest free space size = 74,76 MBNote: File fragments larger than 64MB are not included in the fragmentat
ion statistics.Boot time:
68s to 45s -> normal defragmentation
45s to 38s -> Superfetch + boot optimization + bare-bone services 😎Ty halladayrules, for good found 😀
- 10th July 2011 at 11:35 #51849
I got same 0x89000017 error code, you just need to rerun the “Rundll32.exe advapi32.dll,ProcessIdleTasks”
command once more and then “defrag C: /b” again and it will work. - 13th July 2011 at 21:34 #51852
- 15th July 2011 at 12:26 #51855
@sythrar wrote:
Hi halladayrules, need Superfetch service ?
I have recently discovered that Superfetch is required to rebuild the Layout.ini file which the defrag service uses to optimize your boot files AND startup apps.
- 20th July 2011 at 02:43 #51850
I am getting the following error after trying the above steps:
Invoking boot optimization on (C:)…
Analysis: 100% complete.
Boot optimization has been disabled in the registry. (0x89000018)
My RegKey looks as so after running the defrag c: /b
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftDfrgBootOptimizeFunction]
“Enable”=”Y”
“OptimizeComplete”=”No”
“OptimizeError”=”Missing Registry Entries”Anyone have any ideas?
- 20th July 2011 at 02:48 #51851
@poisedforflight wrote:
I am getting the following error after trying the above steps:
Invoking boot optimization on (C:)…
Analysis: 100% complete.
Boot optimization has been disabled in the registry. (0x89000018)
My RegKey looks as so after running the defrag c: /b
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftDfrgBootOptimizeFunction]
“Enable”=”Y”
“OptimizeComplete”=”No”
“OptimizeError”=”Missing Registry Entries”Anyone have any ideas?
Rerun “Rundll32.exe advapi32.dll,ProcessIdleTasks” and try again. It should work.
The boot optimization does not work on SSDs from what I can gather, if you have an SSD it will not work.Also try this:
Right-click on “BootOptimizeFunction” key and go to permissions. Add your username and give yourself full control. Exit command prompt. Then re-enter it again.
Type in
Rundll32.exe advapi32.dll,ProcessIdleTasks
defrag C: /btry once again if it doesn’t work the first time.
- 26th July 2011 at 16:50 #51856
It looks like all I was missing was the prefetch function. It’s working great now, no errors.
@halladayrules wrote:
@poisedforflight wrote:
I am getting the following error after trying the above steps:
Invoking boot optimization on (C:)…
Analysis: 100% complete.
Boot optimization has been disabled in the registry. (0x89000018)
My RegKey looks as so after running the defrag c: /b
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftDfrgBootOptimizeFunction]
“Enable”=”Y”
“OptimizeComplete”=”No”
“OptimizeError”=”Missing Registry Entries”Anyone have any ideas?
Rerun “Rundll32.exe advapi32.dll,ProcessIdleTasks” and try again. It should work.
The boot optimization does not work on SSDs from what I can gather, if you have an SSD it will not work.Also try this:
Right-click on “BootOptimizeFunction” key and go to permissions. Add your username and give yourself full control. Exit command prompt. Then re-enter it again.
Type in
Rundll32.exe advapi32.dll,ProcessIdleTasks
defrag C: /btry once again if it doesn’t work the first time.
- 14th August 2011 at 06:46 #51857
I have uploaded my video tutorial for this feature on the main page of this topic. Enjoy!
- 24th December 2011 at 12:35 #51858
just wanted to say thanks for this 😀
great work 😀
Vinda
- 15th February 2012 at 10:31 #51859
Hi,
I followed your tutorial, and so far everything worked, except when I tried running sc start defragsvc and got this error:
[SC] StartService: OpenService FAILED 1060:
The speficied service does not exist as an installed service.I tried googling on how to enable defragsvc in Server 2008 R2, but to no avail.
Any help would be much appreciated =)
- 16th February 2012 at 06:23 #51860
Start > Administrative Tools > Services
Navigate to Disk Defragmenter
Double click to open it up.
Set Startup type to Automatic
Click Start
Click on Apply, then OK, then close out.
If this service does not start or does not exist something has corrupted Windows, i.e a virus accidental deletion and you will most likely need to reinstall Windows.
- 16th February 2012 at 09:50 #51861
I tried going to Services, but couldn’t find the Service “Disk Defragmenter”.
My installation of Windows Server 2008 R2 is brand new, and I’m thinking could it be I didn’t install a specific Role, or Feature that would enable the Disk Defragmenter service?
I could do a manual defragmentation using Start > Accessories > System Tools > Disk Defragmenter. But I couldn’t find that service..
Any more ideas?
- 17th February 2012 at 08:33 #51862
@ethanweku wrote:
I tried going to Services, but couldn’t find the Service “Disk Defragmenter”.
My installation of Windows Server 2008 R2 is brand new, and I’m thinking could it be I didn’t install a specific Role, or Feature that would enable the Disk Defragmenter service?
I could do a manual defragmentation using Start > Accessories > System Tools > Disk Defragmenter. But I couldn’t find that service..
Any more ideas?
A default installation of R2 has the Disk Defragmenter service with no roles or features installed. Are you sure that is Server 2008 R2 and not Server 2008? There’s a difference.
- AuthorPosts
- You must be logged in to reply to this topic.