I always install Windows first because GRUB recognizes Windows and auto-configure its config files. So I installed Windows, installed some software and now I'm wondering: should I defragment Windows partitions before installing Linux? Or it doesn't matter?

What’s the harm? Unless it’s an SSD, there’s nothing wrong with keeping the disk nice and tidy now and then.
–
SynetechJul 20 '12 at 17:41

1

@Synetech will it really help even though you are going to reformat/create a new partition for linux? (Personal,honest question)
–
RhyukJul 20 '12 at 17:50

1

Defragging the Windows partition has no effect on the Linux partition or install; it will only help Windows while it boots and runs. Are you asking about defragging the partition on which Linux will be installed? If so, then there is no reason to bother since you are going to format it anyway.
–
SynetechJul 20 '12 at 17:53

3 Answers
3

If you planned ahead and left space for the Linux installation on the drive, it isn't necessary. Your Windows partition and Linux partition have no real impact on each other, beyond accessing each others' data if you'd like to do that. However, if you need to resize the Windows partition, it's much better to defragment the drive beforehand, so that the partition manager's job of making sure all the data is in the right spot is easier. As Synetech pointed out, though, there's no harm in tidying up the disk (unless it's a solid-state drive as was also pointed out).

Unless you're doing something adorably weird, you will be installing seperate operating systems on seperate partitions. A file system will never be fragmented outside the bounds of its partition, so defragmentation will not touch the parts of the hard drive you're about to install Linux on. As the installer will probably keep its hands off any partition the new OS will not be written to, it really doesn't matter whether you install Linux or defragment your Windows partition first.

One other time you'd want to defrag before installation is if you were using something like Wubi, which installs Ubuntu into a virtual disk on your Windows system. In this case, a large file is created on your Windows drive to house the Linux filesystem.