Sunday, April 21, 2013

Defragmenting the virtual Disk in VMWare

Actually what does fragmentation and defragmentation mean?

These two terms refer to the condition of a disk in which files are divided into pieces scattered around the disk. Fragmentation happens when we use disks frequently in creating, deleting and modifying files. At some point, the operating system needs to store parts of a file in non-contiguous clusters. Though this is entirely invisible to users, it can slow down the speed at which data is accessed because the disk drive must search through different parts of the disk to put together a single file. 

Just think of it in a simple scenario. If you put all your books around a table, will you be able to find a specific book quickly? But it is easier and quicker to find it if you have organized and stored the books in a proper way. This is the state that I want to explain here. All what I am going to do is similar to rearranging the books on a table to make finding things faster :)

Like physical disk drives, virtual disks also can become fragmented. Defragmenting disks rearrange files, programs and unused space on the virtual disks so that programs run faster and files quicker. Also note that defragmenting does not reclaim unused space on a virtual disk. to do so, you can shrink the virtual disk. But it is best practice to run a disk defragmentation before shrinking the disk 

Let me explain the steps you need to follow to defragment the virtual hard disk through your VMWare Workstation

  1. Power off the virtual machine if it is already running
  2. select the proper tab of your virtual machine from the VMWare Home screen

  3. Select VM tab from the top and select Settings
  4. Under Hardware tab, click on Hard Disk (SCSI) and select Defragment from the Utilities drop down list. 


  5.The disk defragmentation starts automatically and displays a success message if the defragmentation      completes

Remember that Disk defragmentation may take a considerable time based on how frequently you run this action.

Note: The defragmentation process requires free working space on the host computer's disk. If your virtual disk is contained in a single file, for example, you need free space equal to the size of the virtual disk file. Other virtual disk configurations require less free space.