Explained: How to Defrag a Network Drive (NAS or Remote PC)
Infopackets Reader Ron C. writes:
" Dear Dennis,
I have several drives on my network that I'd like to defrag, but none of the defrag software programs I've tried allow me to defrag a network drive. Any suggestions on how to defrag a network drive, or a program that can provide this functionality? "
The reason you can't find a program to defrag a network drive is because this is not possible - the easiest way to explain "why" is that the remote drives are owned by another operating system. Simply put: your system does not have permission to move these files around. With that said, there is a workaround to defragging a network drive, and I'll explain in detail below.
Why Defragging a Network Drive isn't Possible
First, I'll explain why defragging over a network won't work.
Let's assume that your wife has a PC on the network and she's given everyone on the network access to one of her folders. Normally if you go to "My Computer" or "This PC", then click on the "Network" icon, then click on a specific network computer, Windows will display all the available shared folders pertaining to a particular PC. If you then right click an available shared drive (or folder), you can map the network drive to your PC - let's call it drive "Z". Now, when you click on "My Computer" or "This PC" the mapped network drive or folder is displayed as drive "Z", alongside your "C" and "D" drives (for example).
Even though the network "Z" drive appears as if it were part of your system, the truth is that your wife's PC still "owns" this drive as far as file permissions are concerned. When it comes to file permissions, the most important thing to realize is that certain files on your wife's PC will be constantly in use (loaded into memory) by the operating system, and this list changes as each second passes.
With that said, there is no way for a defrag program running on your local PC to know which files are in use on the remote PC. As such, these operating system files on the remote PC would be considered "locked" because they are resident in memory, and therefore unmovable. The way defrag works is to move files from one location on the drive to another so that the files are placed in a contiguous (side by side) manner - whether you're defragging according to most accessed files, or to optimize free space. Since the defrag program running on your local PC can't move certain files on the remote PC (because they are locked), the defrag would not be able to complete.
With that in mind: even if you could defrag a network drive, the data would have to be read from the remote drive, then sent to your local PC over the network for temporary holding until the defrag program figures out where to put it back (which takes time to transfer!); once that is figured out, the data would have to be read from your local PC, then transferred back over the network (which takes more time!), then stored on her drive. Since most computers these days have anywhere from twenty thousand to a few hundred thousand files, defragging over the network would likely take days to weeks to complete. In other words, it's not a good idea!
So, what is the proper way to defrag a network drive?
The simple answer is to have the remote drive defragged by the owner of that drive.
In other words, if you are sharing a folder on your wife's PC over the network and you want to defrag this folder (or drive), then have the wife run a defrag on her own system. That way, the defrag program and the operating system can communicate with one another to decide which files are OK to move and which ones are not. If you need the files defragged constantly, you can likely find a good freeware defrag program that is capable of running on schedule, then have your wife (or yourself) implement a schedule.
Defrag using NAS (Network Attached Storage)
If the drive you're sharing on the network is attached using NAS (network attached storage) - for example, a hard drive directly connected to a router - and you need that drive defragged, then you would have to safely disconnect the drive from the NAS and reconnect it to a PC, then run the defrag that way, then re-attach it to the NAS.
A word of warning, however: some NAS systems use a proprietary operating system (usually Linux), and defragging the drive in the manner I just described won't work. In that case you would have to get the technical specifications of the NAS and defrag using a similar operating system. Optionally, the NAS may be able to defrag the drive(s) natively within its own system - you would need to connect to the web administration control panel to see if that option is available.
I hope that helps.
Got a Computer Question or Problem? Ask Dennis!
I need more computer questions. If you have a computer question - or even a computer problem that needs fixing - please email me with your question so that I can write more articles like this one. I can't promise I'll respond to all the messages I receive (depending on the volume), but I'll do my best.
About the author: Dennis Faas is the owner and operator of Infopackets.com. With over 30 years of computing experience, Dennis' areas of expertise are a broad range and include PC hardware, Microsoft Windows, Linux, network administration, and virtualization. Dennis holds a Bachelors degree in Computer Science (1999) and has authored 6 books on the topics of MS Windows and PC Security. If you like the advice you received on this page, please up-vote / Like this page and share it with friends. For technical support inquiries, Dennis can be reached via Live chat online this site using the Zopim Chat service (currently located at the bottom left of the screen); optionally, you can contact Dennis through the website contact form.
Infopackets Top Windows 10 FAQs
How to Upgrade from Windows 10 32-bit to 64-bit
How to Fix: Windows 10 Antivirus Missing, Not Compatible
How to Fix: Windows 10 Display Shifted; Screen Fuzzy
How to Upgrade Windows 7, 8 32-bit to Windows 10 64-bit
to Downgrade from Windows 10
- How to Fix: Windows 10 Upgrade Failed Error C1900208
- How to Fix: Windows 10 Upgrade Failed Error 80240020
- Can I Cancel my Windows 10 Reservation and Reserve Later?
- How to Clean Install Windows 10 using Windows 7, 8 License
- Will Windows 10 Install Automatically?
- Windows 10 Upgrade: Do I have to Reinstall Programs?
- Windows 10 Upgrade: Can I choose 32-bit or 64-bit?
- Which Version of Windows 10 Will I Get (Home or Pro)?
- How to Reserve Windows 10 Upgrade (Free)
- How to Fix: CPU Not Compatible with Windows 10 Error
- Windows 10 Upgrade: Can I keep my Old Windows Install?
- How to Cancel Windows 10 Reservation (Properly)
- Download Windows 10 .ISO (DVD) for Clean Install?
- Microsoft: Windows 10 Will Be The Last Version
- Does Windows 10 require the CPU to support PAE?
- Windows 10: Can I Upgrade or do I need a Clean Install?
Click here for more Windows 10 articles.