Vmware Thin Disks and Windows formatting options

By | May 23, 2011

Quick Format vs Normal Format and what this actually means

After a partition has been created we always have to do a “format” before it could be used. But what does formatting really do and what is the big difference between Windows 2003 and Windows 2008? And why is this important in a VMware environment using Thin Disks?

As you are probably aware of there is always two options, to do a quick or a normal format. Let us begin with the quick version and see what it does on the Windows servers. If we for example have a new partition of 50 GB and select quick format, we will not do anything to the main disk area, but only create a new empty file system. The “file system” is primarily a low-level hidden file called $MFT which contains the logical file system in NTFS. Along with other NTFS metadata files (e.g. $bitmap) these will basically say that all clusters on the partition are empty and ready for use.

Since we only create these new metadata files and do not touch the main disk space, this kind of format is very quick, hence the name. However, we do not really know if all sectors on the disk are functional. Also all previous data earlier written to the disk is still physically there, but will be eventually be overwritten as new files are added. The quick format will work the same in Windows 2003 and Windows 2008.

Let us now look at the actions when doing a full format. If you run Windows 2003 Server and do select a normal format we will do two things: first we create a new logical file system and then we will do a read against all sectors on the disk. The reason for this is to detect any damaged sectors before use. This will take some time on a physical disk, for example against a 50 GB disk we will do 50 Gigabytes of read access.

Note that no files/data on the main disk are actually overwritten and that the Windows 2003 format tool could not be used to safely erase any confidential information (this also applies for Windows 2000, or Windows NT or any other earlier version.) Use for example SDelete from Microsoft / Sysinternals if needed.

If using a VMware Thin Disk and do a full format the read IOs from the Windows 2003 guest will mostly go against un-allocated parts of the thin file and the VMkernel will “fake” a reply and return just zeroes. The full format will go much faster when done in vSphere and will not expand the thin disk file.

In Windows 2008 there is a different behavior however. The full format both creates a new empty file system like all other earlier versions, but also overwrites the full disk area. In Windows 2008 we finally do what many perhaps thought was always done, that is actually erasing the old data. (Once overwritten data on a modern disk is extremely hard to recover.)

This is good, but there is one final thing to watch out for in a virtualized environment. If we are using the vSphere Thin Disk feature we have an file that to the guest OS always looks like, say, a 50 GB disk drive, but the virtual disk file is just enough big to cover all data written to it. This saves a lot of space on the typical SAN. So, what is the relation to logical formatting done inside the guest operating system? Well, since the virtual thin disk grows only when written to, it will not do well when doing a Windows 2008 or R2 normal format.

Above is the Datastore Browser view of a 50 GB thin disk, just created and given to the guest. Note the Provisioned Size is 50 GB, but actual disk usage on the SAN is only 1 MB.

And here is what happen if the administrator of the Win2008 guest does a normal format. Since the guest is writing to all sectors of the disk, the thin disk will immediately grow to the full size and negates the whole purpose of thin provisioning of disks.

So be sure to make a note to the administrators of the Windows Server guests to only use the quick format option if we want to have any use of the Thin Disks feature.

Leave a Reply

Your email address will not be published. Required fields are marked *