5

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?

5
  • 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, 2011 at 21:08
  • 3
    You can lose data if there's a power failure or system freeze during a defragmentation though.
    – emgee
    Apr 1, 2011 at 21:21
  • 2
    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, 2011 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. Apr 2, 2011 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, 2011 at 2:20

1 Answer 1

6

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.

1
  • What if we open a file for editing when it's in the middle of defragging? For example a 100MB file scattered in 1000 sections take a long time to defrag. What happened if we open it for editing when it's in the middle of the defragmentation process? Sep 19, 2016 at 23:43

You must log in to answer this question.

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