Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Disk Defragmenter - Open and Use



Disk Defragmenter - Open and Use

How to Use Windows 7 Disk Defragmenter
Published by Brink
01 Jun 2009
Default Disk Defragmenter - Open and Use

How to Use Windows 7 Disk Defragmenter

information   Information
Fragmentation makes your hard disk do extra work that can slow down your computer. Removable storage devices such as USB flash drives can also become fragmented. Disk Defragmenter rearranges fragmented data so your disks and drives can work more efficiently. While Disk Defragmenter can run on a schedule, this will show you how to open and use Disk Defragmenter to manually analyze and defragment your disks and drives in Windows 7.
Note   Note
  • If the disk is already in exclusive use by another program, or if the disk is formatted using a file system other than NTFS file system, FAT, or FAT32, then it cannot be defragmented.
  • Network locations cannot be defragmented.
  • If a disk that you're expecting to see under Current status is not showing up there, it might be because it contains an error. You should try to repair the disk first with Disk Check, then return to Disk Defragmenter to try again.
warning   Warning
Solid State Drives (SSD) and USB flash key drives do not need to be defragmented. Doing so may shorten the lifespan of them.




OPTION ONE
Using "Disk Deframenter" in Windows 7
1. Open the Start Menu, and double click on to expand All Programs, Accessories, System Tools, and click on Disk Defragmenter. (See screenshot below)
Disk Defragmenter - Open and Use-step1.jpg
A) Go to step 3.
OR

2. Open the Start Menu, then type dfrgui into the search line and press Enter.

3. To Anaylze a Disk
NOTE: This will anaylze the selected disk to see what percentage fragmented it is. If the number is above 10%, you should defragment the disk.
A) Select a disk, and click on the Anaylze disk button. (See screenshot below)
Name:  Step2.jpg
Views: 36524
Size:  138.4 KB
4. To Defragment a Disk
NOTE: Disk Defragmenter might take from several minutes to a few hours to finish, depending on the size and degree of fragmentation of your hard disk. You can still use your computer during the defragmentation process.
A) Select a disk, and click on the Defragment disk button. (See screenshot below)
Name:  Step3.jpg
Views: 36437
Size:  157.9 KB
B) You will now see the disk being defragmented. (See screenshot below)
NOTE: You can abort the defragmentation of the selected disk at anytime by clicking on the Stop operation button.
Name:  Step4.jpg
Views: 36217
Size:  153.4 KB
5. When finished, click on Close. (See screenshot below)
Name:  Step5.jpg
Views: 36315
Size:  158.8 KB



OPTION TWO
Run Defragmenter from Drive's Properties Page
1. Open the Start Menu and click on the Computer button on the right dark side.

2. Right click the hard disk drive that you want to check, and click on Properties. (see screenshot below)
Disk Defragmenter - Open and Use-computer.jpg
3. Click on the Tools tab, and click on the Defragment now button. (see screenshot below)
Name:  Computer-2.jpg
Views: 34163
Size:  57.3 KB
4. You can now do either step 3 or 4 in OPTION ONE above.



OPTION THREE
Run Defragmenter in a Command Prompt
1. Do step 2 or 3 below for how you would like to run the defrag command.

2. To Use an Elevated Command Prompt in Windows 7
A) Open an elevated command prompt.

B) Go to step 4.
3. To Use a Command Prompt at Boot
A) Open a command prompt at startup.

B) In the command prompt, type diskpart and press Enter.

C) In the command prompt, type list volume and press Enter.
NOTE: Make note of the drive letter that you want to run defrag on. The drive letter for the drive will not always be the same at boot as it is in Windows 7.

D) In the command prompt, type exit and press Enter.

E) Continue on to step 4.
4. In the command prompt, type in the following command below followed by one or more switches (flags) that you would like to use below with a space between each switch and press Enter.
NOTE: For example, the most common command to run defrag on your C: drive is:

defrag C: /F
defrag [drive letter]: [switches]

Tip   Tip
If you would like to defrag more than one drive letter at once, then you can just include as many separate drive letters in the command like below for the ones you want to defrag. For example, with drive letters C, E, and H.

defrag C: E: H: /F



Switches:
NOTE: The ones in red below are new to Windows 7.
  • /A - Perform analysis on the specified volumes.
  • /B - Boot optimization to defrags the boot sector of the boot volume (ex: Windows drive). This will not work on a SSD.
  • /C - Perform the operation on all volumes.
  • /E - Perform the operation on all volumes except those specified.
  • /F - Forces defragmentation of the volume when free space is low.
  • /H - Run the operation at normal priority (default is low).
  • /M - Run the operation on each volume in parallel in the background.
  • /R - Performs partial defragmentation (default). Attempts to consolidate only fragments smaller than 64 megabytes (MB).
  • /T - Track an operation already in progress on the specified volume.
  • /U - Print the progress of the operation on the screen.
  • /V - Print verbose output containing the fragmentation statistics.
  • /X - Perform free space consolidation on the specified volumes.
Name:  CMD-1.jpg
Views: 34705
Size:  115.6 KB

That's it,
Shawn


Published by
25 Jul 2009   #1
hannibal

Windows 7 Home Premium 64
 
 
Disk degfragmenter hanging and crashing computer

Hi, I have just installed windows 7 after a particularly bad virus destroyed xp, and I could not restore xp (even system restore was wiped off!)
So I have tried to run the Windows 7 defrag to see if that would clear a bit of the mess left by the virus, but when I tried to run it, it got stuck at 97% analysed. When I came back a bit later to see if it had done anything, the computer had crashed.
I tried a hard reboot, and when Windows 7 recovered the session, the defrag came back on its own, and was showing the c drive as 0% consolidated, and just got stuck there too.
Has this happened to anyone else? Because from what I read the defrag tool is meant to be very good, but it doesn't seem to do much on my pc?


My System SpecsSystem Spec
25 Jul 2009   #2
mickey megabyte

ultimate 64 sp1
 
 

there are also a few command-line options for those that like that kind of thing.


Disk Defragmenter from Command Prompt - Vista Forums


open a command prompt, and type defrag to see the full list.

probably the most useful is the /c switch which will defrag all your drives/partitions one after the other.

if you have multiple drives (rather than multiple partitions on the one drive) you can also use the /m switch in combination with /c - this will partition your drives in parallel ie all at the same time - please note that this switch is best avoided on multi-partitioned drives, as it will put too much strain on the drive as the heads will be constantly switching from one partition to the other.

you can also use further switches to exclude certain partitions.

happy defragging!
My System SpecsSystem Spec
26 Jul 2009   #3
hannibal

Windows 7 Home Premium 64
 
 

Cheers for that-weirdly enough after I tried rebooting again it has worked! But if it hangs again I might give that a go.

Take it easy
My System SpecsSystem Spec
.


24 Nov 2009   #4
John Gray

Windows 7
 
 
Surely USB Flash Drives should not be defragmented?

"Removable storage devices such as USB flash drives can also become fragmented."

True - but since there's no time-consuming disk head movement a fragmented UFD is no slower than a defragmented one. Additionally, the UFD 'wears out' by being written. See, for example, Should I defragment my USB Flash drive?
My System SpecsSystem Spec
24 Nov 2009   #5
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Hello John, and welcome to Seven Forums.

No, it would not be a good idea to defragment a USB flash drive.
My System SpecsSystem Spec
25 Mar 2011   #6
villanuevayael

Windows 7 Home Premium
 
 

what happens if you defragment a 3% fragmented disk or even a 0% fragmented disk ??
My System SpecsSystem Spec
25 Mar 2011   #7
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Hello Villanuevayael,

As long as it's not a SSD, then it's not going to hurt anything to defrag a 3% fragmented HDD or even a 0% fragmented HDD. It's just that there's really no need to until it reaches a higher percentage, say around 10%.
My System SpecsSystem Spec
26 Mar 2011   #8
villanuevayael

Windows 7 Home Premium
 
 

Quote   Quote: Originally Posted by Brink View Post
Hello Villanuevayael,

As long as it's not a SSD, then it's not going to hurt anything to defrag a 3% fragmented HDD or even a 0% fragmented HDD. It's just that there's really no need to until it reaches a higher percentage, say around 10%.
-- thanks Brink :] this really helps a lot
My System SpecsSystem Spec
26 Mar 2011   #9
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

You're most welcome Villanuevayael.
My System SpecsSystem Spec
Comment

 Disk Defragmenter - Open and Use




Tutorial Tools



Similar help and support threads for2: Disk Defragmenter - Open and Use
Windows 7 Tutorial Category
Disk defragmenter windows 7 a couple of questions? General Discussion
Disk Defragmenter Schedule- Turn On or Off Tutorials
Disk Defragmenter won't defragment a certian disk. Performance & Maintenance
Disk defragmenter scheduled using another program Performance & Maintenance
Disk Defragmenter Stuck Performance & Maintenance
Disk defragmenter no longer opens Performance & Maintenance
disk defragmenter Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:41 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33