5

Whenever I install Linux on a box that has Windows, and I want to dual boot, I always defragment the hard drive as much as possible before resizing the partition. Is this just superstition, or is it actually a good idea?

4

If your hard drive is already defragmented with all the data at the start of the disk, then it makes resizing the partition easier. Long ago the partition resizing tools were not able to move the data, so it was a requirement.

Today if you hard drive is not already defragmented then there is no reason to defragment it first in an attempt to move the data to the front of the drive since the resize utility will do that automatically. All you are doing is shifting the effort from the resize utility to the defrag utility. The only reason that is advantageous is if your defrag utility has a better progress indicator and gives you the ability to restart when your resize utility does not.

| improve this answer | |
  • 1
    Windows 8's Disk Management tool doesn't seem able to move data when you try to shrink a volume. A message pops up that mentions defrag. – Drew Noakes Mar 12 '13 at 14:07
  • Won't it at least make the partitioning process faster? You can split up the task into separate steps and keep the "critical" part short (when you may need system downtime). – Sridhar Sarnobat Aug 17 at 21:34
1

I believe it depends on disk partition software that you use as some do a better job of it than others. The vendors themselves will be able to tell you if it is necessary for their particular software and also advise on any best practises.

Ideally you would want a hard disk per operating system. That way the core OS is installed at the start of each drive which will have the quickest access time. If you have a 1.5TB drive that's got 1TB of Windows and Music on it and you for example stick Linux on the spare 0.5TB then its bound to run slower given the nature of how hard disks work. They are after all still using moving parts to read the various platters of the hard disk.

I suppose the ideal solution if money was no object would be to use solid state disks, they shouldn't in theory need de-fragging much as the seek times of some of the quicker SSD drives is about the same when full or empty.

| improve this answer | |
  • 1
    From what I`ve heard, defragging an SSD is always BAD because it wears out the electronics inside. – NoviceUbuntuGeek Sep 13 '15 at 23:09
0

It depends. Some defraggers might scrunch everything at the start of the partition, but most like to spread data across the whole disk. That way, there tend to be free fields in between blocks, so extending a file to a new block will not fragment the filesystem as quickly.

| improve this answer | |
  • Sub question. which one does windows vista disk defragmenter do? – andrewrk Jul 30 '09 at 20:37
  • I'm not sure about the details beyond this point. Either way, take a full backup beforehand, and you should be good--resizing doesn't take that long either way, in my experience. – koenigdmj Jul 30 '09 at 20:56
0

I think it depends on how the defragmenter works. There's a freeware defragger called jkdefrag that purports to optimize the drive for better access time first, but I don't know how that might interfere with a particular partitioning scheme (i.e., optimizing the position of files in a partition of size A would probably not be optimal as you're resizing it for partition size B) so you may not see much improvement.

| improve this answer | |
  • jkdefrag is now called mydefrag. – 3dinfluence Jul 31 '09 at 0:12
  • You're absolutely right...I noticed it while (quickly) grabbing links to post here. Thanks for the update. – Bart Silverstrim Jul 31 '09 at 12:16
0

If you intend to put Linux on a new partition then like others have said you will need to get all the data as far forward as possible. GParted will only let you shrink the existing NTFS volume/partition to the last block that holds data. Perfect Disk has a 30 day demo and has the ability to compact the data to the front of the drive. I also believe that the free opensource defragger http://www.mydefrag.com/ may have a script to do the same.

You'll want to use one of these as a first step.

| improve this answer | |
  • this conflicts with what Jim McKeeth says. Who is correct? – andrewrk Jul 31 '09 at 11:42
  • It depends on what partition resizing tools. The most common one used for installing Linux is QParted. It will only let you resize the partition to the last used block of the drive. This may not be true if you're using a tool like Partition Magic as it may be able to move the used data blocks around on the disk though. If you want to test this yourself boot up on a LiveCD fire up QParted and have a look for yourself. It will only let you shrink the partition to the last used block. – 3dinfluence Jul 31 '09 at 13:57
  • I meant GParted rather than QParted...but either will work...both are just front ends for parted. – 3dinfluence Jul 31 '09 at 14:10
0

On server 2012 R2 - defragging is sometimes required as the diskmgmt resize feature sometimes failes to move data.

This was confirmed on numerous occasions - resize tool failed with "not enough free space". Defrag, stopping at 1 pass with native defrag tool, and re-attempting was successful.

| improve this answer | |
  • IIRC, diskmgmt.msc doesn't allow partition resizing, you need a third party tool for that. And the reason it takes so long is because it has to take all the fragments that belong in the original partition and move them there. I think you're wrong, though I don't have references. – Xalorous Dec 20 '18 at 19:31
  • It should be evident from my post that I've actually done this... I don't need the references you don't have. Modern windows does indeed allow partition resizing from diskmgmt.msc... – MarkPippin Dec 22 '18 at 9:26
  • I stand corrected. Sorry, my experience with Server is dated. For systems installed with MFT instead of GPT, resizing the partitions was limited to expanding, and then only with certain versions (2008 and later). With GPT resizing became possible. After reading your comment, I checked my workstation and I have the option to shrink partitions, and I see a greyed out extend option. It's sad that the resize option doesn't move all the fragments. – Xalorous Jan 6 '19 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.