Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assuming I'm on an NTFS partition, is it just as safe to edit files during defragmentation as when not? Is there any added risk, even if very small? If not, how does the operating system ensure the integrity/consistency of the data?

share|improve this question
I think the worse case is just that the defragmentation process gets restarted. I don't think the data can become corrupted in this way unless there is a bug in the application used for defragmentation. – bobo Apr 1 '11 at 21:08
You can lose data if there's a power failure or system freeze during a defragmentation though. – emgee Apr 1 '11 at 21:21
Nothing is 100% safe in Windows ;-> I have only had one defrag job go south in all my years, I tried to stop the defrag and it locked the system up for some reason, did a hard reboot and it was trashed, reinstalled XP. I tend to leave the system alone when defrag is running, but is not necessary. – Moab Apr 1 '11 at 21:32
@Moab: It depends a lot on the filesystem. I've never had data loss with NTFS. On the other hand, I'm not touching FAT32 ever again. – grawity Apr 2 '11 at 17:00
@grawity, It was ntfs in my case, I think it was bad luck also. I did not lose data, it just would not boot and I could not fix it in a reasonable amount of time, it was faster to copy data off the drive and blow my clean image back on using Acronis. XP sp1 if I remember right. Forget Allocation Table is what I use to call it. – Moab Apr 3 '11 at 2:20
up vote 5 down vote accepted

There is no risk associated with editing files during defragmentation. If a file is open for editing (you can aquire a read-only or a read-write lock when opening a file) it is considered "locked". When the defrag process gets to that file it skips over it, leaving it in it's current place.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .