Posts Tagged ‘expand vmdk’
Windows de-fragmentation tool or some other commercial alternative, need 5-15% of free disk space, for the tool to be effective. Sometimes it may need more if you have some very large files (like video or database files). Below is the layout of c-drive of may virtual machine. The red segments you see are the fragmented files.
If you have a file with one large segment, for the defrag to be effective it has to move this segment to a free area and copy the rest of the segments with it to make the file contiguous. If there is no place to copy the large extent of a file, then it wont get defragmented.
The best way to de-fragment is to get an empty disk and copy all the files onto the empty disk. So the more free disk you have the better these tools will perform.
Also how you think about de-fragmentation in a virtual disk is very different than how we think about de-fragmentation in a physical world. Take the above disk it is a virtual disk 2GB Max Extent Sparse
The disk was full and then I extended the disk (with fatVM) and then defragmented one file (you can do that with Mark Russinovich’s Contig Tool http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx). You can see that the files are contiguous (blue) in the extended portion. The original disk clearly requires defragmentation, but without extending it, we would not have been able to get the key database file to be contiguous.
It makes one ask the question whether you really need the traditional way of defrag the virtual disk. It is much faster to extend the disk and/or attach a separate disk and simply copy over all the files and re-place the original disk with the new extended disk.
Another advantage of doing this is that it is much faster than defragging also you can improve the performance of the virtual machine considerably. Also you can take the files which are static (don’t change) by taking the files in a virtual machine which don’t change and making the base new disk for c-drive a flat file instead of a sparse disk as the sparse disk is not really saving you anything once you get full. If you have a parent which is flat and then a child which is sparse you get the best of both worlds.
In my limited experience instead of defrag, do the following
- create a new flat disk, copy all the files from C: to the new disk
- make the new disk your c: drive
- create a clone of the base disk (which by definition is sparse)
- extend the sparse disk
Your virtual machine’s performance will be significantly improved.
We are pleased to announce that fatVM Beta for VMware Fusion and VMware Workstation is available for download.
fatVM is a reliable, robust, and safe, single click solution for extending the C drive of your virtual disk that is becoming full. fatVM extends the VM even in cases when it has snapshots and clones. You can use fatVM with full confidence because it preserves your original disk, which remains available to you in case the need ever arises.
A Mac user can download and install the fatVM dmg just like any other Mac application. fatVM provides a simple, intuitive, interface and a reliable process that hides the technical complexity of extending a virtual disk.
For most Mac users, extending the C drive of Window® running within VMware Fusion® can be a daunting task. There are several online tutorials that do provide instructions on how to perform low-level Windows system administration tasks, invoke UNIX utilities and manage disk formats (like partition tables) using third-party tools. Even if you were to follow such steps, they do not handle dependencies, e.g., snapshots or clones, well and you may not necessarily be able to extend the disk. You may also discover that recovering from failures to extend the C-drive can be a very challenging experience.
fatVM packages the process of extending the VM and provides you with the capability of executing it through a single click.
A Windows user can download and install the fatVM.exe just like any other Windows application. fatVM works with VMware Workstation in a similar fashion as described for VMware Fusion.
Single Click Operation
fatvm shows you a menu of VM’s that belong to VMware Fusion’s ® Virtual Machine Library. You can either select a VM from that menu, or you can you can drag and drop the .vmx configuration file for a new VM, to extend it. fatVM analyzes the selected VM and discovers the current size of the VM’s disk. All you have to do is to select the size you want to extend it to and press Extend, fatVM does the rest:
- Verify whether VM is running and terminate the operation if it is found running
- Analyze VM to determine its current size
- Discover partitions and system disk
- Verify disk type
- Create snapshot and new disk
- Attach ISO
- Create Windows partition
- Extend Windows file system
- Boot Windows to ensure that chkdsk runs
- Complete VM extension.
Super Fast Cross-OS VM Browser
Just like Google’s Chrome, a fast, lightweight, cross-OS Web browser, fatVM comes bundled with a super fast, lightweight browser for offline VM’s. You can view 50+ VM’s simultaneously. Just drag and drop the VM you would like to explore. Some highlights of the browser are:
- Supports cross-OS Browsing: Browse Linux VM’s on Windows, Linux and Windows VM on Mac
- Discovers Applications installed inside the VM’s. Supports Ubuntu, Red Hat, and Windows Virtual Machines
- Runs in user mode, does not install any kernel level components
- Includes Offline Registry & Partition Table Browser for Windows VM’s
Undo and Rollback
fatVM leaves the original files untouched and creates an extended VM in a separate directory.
- If there is any problem with extending the VM, you can select Rollback under Tools and simply delete the fatVM folder to leave your work environment in the same state as before the extension was attempted.
- The extended VM is clone of the original VM. For this reason, the original VM must not be booted after it has been extended.
Before you begin, create a backup copy of the virtual disk so that you can restore it in case of failures. Extending a virtual disk can be a complex operations for several reasons, e.g.,:
- The virtual disk that is full happens to contain the boot/primary partition for Windows
- There are snapshots
- There is insufficient disk space available on the physical drive to permit growth
- It is a multi step process and involves use of different tools and commands in a specific sequence. Creative individuals have devised workarounds to extend the primary partition for Windows by using Linux boot disks and disk partitioning tools such as GParted, and you have to get this right.
A blog post that expands on each of the above is here.
You’ll find several posts regarding this topic on Google. Essentially, they are all variations of the following posts
VMware Workstation or Fusion
How To Extend Virtual Machine Hard Disk (VMware) by Kalpesh Prajapati and Extend Boot Volume on Windows Server 2000/2003 by Dominic Rivera provide an illustrated tutorial that demonstrates the extension of Windows 2003 guest. You will notice that there are several steps and from reviewing the comments posted for the former, you’ll realize that these steps have not worked for its readers uniformly.
- Extend the non-system/data drive using WIndows tools. This approach preserves snapshots
- Extend the system drive using vmware-vdiskmanager tools. However, this approach causes loss of snapshots
Adding a new disk to a VMware virtual machine in Linux by Matt Topper provides an illustrated step-by-step how-to gude
- Using vmkfstools and GParted to extend a disk
- Using VMware Converter to shrink or extend a disk
- Using vmkfstools and another Windows virtual machine to extend a disk
- Using vmkfstools and System Rescue CD to extend a disk
- Using Knoppix Live CD with QtPartEd to shrink a disk
- Using Ghost or another 3rd party imaging product to shrink a disk