Virtual Disk Driver for Windows NT platform. Copyright (C) 2003-2005 Ken Kato (chitchat-lj@infoseek.jp) http://chitchat.at.infoseek.co.jp/vmware/vdk.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA The GNU General Public License is also available from: http://www.gnu.org/copyleft/gpl.html This program owes a great deal to Bo Brantén's 'ntifs' project and 'filedisk' program (http://www.acc.umu.se/~bosse/). This program simply could not happen without his great works. INTRODUCTION ============ This is a Virtual Disk Driver (VDK) Version 3 for Windows NT / 2000 / XP. I have received some reports that it also works on Windows 2000 Server. With VDK you can mount a VMware virtual disk to your Windows hosts and use them as another disk drive attached to your system. VDK can open the following VMware virtual disk types for both read-only and read-write access: - VMware 2.x Plain Disks (*.pln). - VMware 2.x / 3.x Virtual Disks (*.dsk, *.vmdk). - VMware 2.x / 3.x REDO log files based on both Plain Disks and Virtual Disks. - VMware 2.x / 3.x differential / nested Virtual Disks (which actually are renamed REDO logs), based on both Plain Disks and Virtual Disks. There is no limitation on the nesting level. - VMware 4.x Flat virtual disks (both split and monolithic). - VMware 4.x Sparse virtual disks (both split and monolithic). - VMware 4.x REDO log files (which actually are the same thing as split-sparse virtual disks) and differential / nested virtual disks (ditto). VDK allows you to use these types of virtual disks with minor errors, such as timestamp mismatch, sequence number mismatch, etc. (VDK simply ignores those errors, it does not fix them.) VDK can also open the following types of virtual disks. - Raw sector image which you can create with regular disk dump tools such as Linux dd command. - Non-partitioned disk image, such as floppy image, removable disk image, and dd image of one partition. (This is not actually a type of virtual disk, but rather how the virtual disk is formatted.) In this case, the whole image is treated as a single partition. VDK is also capable of creating REDO log files which VMware can use. This means that VDK can open virtual disks in undoable mode, then you can commit the changes using VMware, or discard the changes by simply deleting created REDO log files. VDK cannot use the following virtual disks for the time being, but I'm planning to implement them: - Any disk types with serious errors. VDK cannot use the following disk types, and I have no intention of implementing them: - Raw Disks for any version of VMware. - REDO log files for Raw Disks. In this text, the term "Virtual Disk" (with capitals) specifically means growable virtual disk created with VMware 2.x / 3.x, whereas "virtual disk" (in lower case) is used in more generic sense as opposed to "physical disk". I know it's kind of confusing, but I just couldn't come up with more suitable terms. WARNING & LIMITATIONS ===================== The VMware virtual disk format and structure on which VDK was developed is entirely the result of my *personal* investigation. Absolutely no official information is provided by VMware, Inc. or any other resources. Please note that there is ABSOLUTELY NO WARRANTY and be sure to use it AT YOUR OWN RISK. You must have administrative privileges to use the VDK. This is becuase Windows does not allow non-administrative users to manipulate hard disk volumes. VDK is a *disk* driver, not a file system driver, therefore you can only access partitions which your Windows host can recognize. For example, you cannot access ext2 partitions on virtual drives unless you have a 3rd party ext2 file system driver installed on your Windows system (See NOTES below for more information). VDK does not communicate with Windows 2000/XP Mount Manager. Therefore: - Disk Management Console (partition manipulation and mount point configuration) does not recognize the VDK virtual drives. Most of third party utilities, such as PartitionMagic, should work. - Disk Defragment utility does not recognize the VDK virtual drives. Third party defrag utility, such as Diskeeper, works file. - Graphical mode of Check Disk may not work. Sometimes it works and sometimes it doesn't for me, though I couldn't figure out the pattern so far. (command line chkdsk.exe works fine). VDK does not handle GPT partitioned disk (I don't really know what it is. All I know is that it's a new type of partition table.) Also, I suspect that you cannot use Windows NT Fault Tolerant Volumes (mirror, stripe, volume set, etc) or Windows 2000/XP Dynamic Volumes on virtual drives. I simply don't know because I've never used them. TO DO ===== - Allow non-administrative users to use the program. - Better compatibility with Win2K/XP (PnP support, Mount Manager support, etc). - GUI front end program. - Virtual disk error correction. - Virtual disk type conversion. FILES ===== vdk.sys Virtual Disk kernel-mode Driver. vdk.exe Virtual Disk Driver control program (console). README.TXT Explanation of the Virtual Disk Driver (this file). COPYING.TXT GNU GENERAL PUBLIC LICENSE Version 2. INSTALL ======= Place VDK.SYS and VDK.EXE into a directory on a local drive. Then use VDK.EXE to install the driver (VDK.SYS) onto the system. Read the following sections for more information. If you have previous version of VDK.SYS installed on your system, you don't usually need to uninstall the previous driver from the system. You can just stop the old driver, replace the driver file, and restart the driver. !!! NOTE !!! Device drivers cannot be started from a network drive. Make sure that at least the driver file (VDK.SYS) is placed on a local drive. UNINSTALL ========= Use VDK.EXE to remove the driver entry from the system registry. Then delete VDK.SYS and VDK.EXE from the local drive. VDK.EXE REFERENCE ================= VDK.EXE is a command line front end program to control the Virtual Disk Driver (VDK.SYS). SYNTAX: VDK.EXE command [command specific options...] COMMANDS: INSTALL Install the Virtual Disk Driver. REMOVE Uninstall the Virtual Disk Driver. START Start the Virtual Disk Driver. STOP Stop the Virtual Disk Driver. DRIVER Print Virtual Disk Driver status. DISK Set the initial number of Virtual Disk devices. CREATE Create a new Virtual Disk device. DELETE Delete a Virtual Disk device. VIEW Print disk image files information. OPEN Open disk image files as a virtual drive. CLOSE Close disk image files. LINK Assign a drive letter to a partition. ULINK Remove a drive letter from a partition. IMAGE Print opened image file information. HELP Print command help. All commands and options are case insensitive. VDK INSTALL =========== Install the Virtual Disk Driver. SYNTAX: VDK.EXE INSTALL [driver] [/AUTO] OPTIONS: driver Specifies the path to the Virtual Disk Driver file (VDK.SYS). Default is VDK.SYS in the same directory as VDK.EXE. (Note: *NOT* current working directory.) /AUTO Configures the driver to start at the system startup. (Note: this option does not start the driver after installation is completed.) By default the driver has to be started manually. Device drivers cannot be started from network drives. Make sure to place VDK.SYS on a local drive. VDK REMOVE ========== Uninstall the Virtual Disk Driver. SYNTAX: VDK.EXE REMOVE OPTIONS: NONE This command removes the Virtual Disk Driver entries from the system registry, but does not delete the driver file from the drive. If the driver is running, this command closes all image files and stops the driver before removing it from the system. VDK START ========= Start the Virtual Disk Driver. SYNTAX: VDK.EXE START OPTIONS: NONE If the driver is not already installed, this command attempts to install it with the default options. VDK STOP ======== Stop the Virtual Disk Driver. SYNTAX: VDK.EXE STOP OPTIONS: NONE This command closes all image files before stopping the driver. The driver cannot be stopped if virtual drives are used by any other programs. VDK DRIVER ========== Print Virtual Disk Driver status. SYNTAX: VDK.EXE DRIVER OPTIONS: NONE This commands prints the following information: Driver file path Driver file version Driver start type (AUTO/MANUAL) Current running state Number of disk devices VDK DISK ======== Set the initial number of virtual disks. SYNTAX: VDK.EXE DISK number OPTIONS: number Number of virtual disks between 1 and 22. The default value is 4. This command sets the number of virtual disk devices created when the driver is started. If the driver is already running, this value takes effect the next time the driver is started. VDK CREATE ========== Create a new virtual disk device. SYNTAX: VDK.EXE CREATE OPTIONS: NONE This commands creates a new virtual disk device. The created disk has the highest disk number. VDK DELETE ========== Delete a virtual disk device. SYNTAX: VDK.EXE DELETE OPTIONS: NONE This command deletes a virtual disk device with the highest disk number. A disk cannot be deleted if an image is opened, or any process is using it. Disk #0 cannot be deleted (there must exist at least one disk device). VDK VIEW ======== Print disk image information. SYNTAX: VDK.EXE VIEW image [/SEARCH:path] OPTIONS: image Path to the image to print the information. /SEARCH:path Specifies a path to search the image file (and related files). The specified path has the highest priority in the searching order, and searched even before the explicit paths in the command line, descriptor files and virtual disk files. This command prints the following information for the specified image: Virtual disk capacity (in 512 byte sectors) Number of files composing the image Type, capacity and path of each component file Size and type of each partition in the image VDK OPEN ======== Open a disk image as a virtual drive. SYNTAX: VDK.EXE OPEN disk# image [/RW | /WB | /UNDO | /UNDO:path] [/SEARCH:path] [/P:part#] [/L:drive] OPTIONS: disk# Specifies the virtual disk number. This must be the first parameter. '*' means the first available disk, and if all existing disk is busy a new virtual disk is created. image Specifies the path to the disk image file. This must be the second parameter. See IMAGE TYPES section below for more information /RW Open the image in Read-Write mode. /WB Open the image in Write-Block mode. /UNDO | /UNDO:path Creates a REDO log for the image and open in Read-Write mode. If you specify a path, the REDO log is created in the specified directory. /P:part# Specifies a partition number to set a drive letter. Drive letters can be set/removed later with LINK/ULINK commands. By default, drive letters are assigned to all mountable partitions. /L:drive Specifies drive letters to assign to partitions. By default, the first available drive letter is used. /SEARCH:path Specifies a path to search the image file (and related files). The specified path has the highest priority in the searching order, and searched even before the explicit paths in the command line, descriptor files and virtual disk files. Only one of /RW, /WB and /UNDO can be used at a time. When none of these is specified, the image is opened in Read-Only mode. See ACCESS MODES section below for more information about these options. VDK CLOSE ========= Close a disk image. SYNTAX: VDK.EXE CLOSE disk# VDK.EXE CLOSE drive OPTIONS: disk# Specifies the target virtual disk number. '*' means all existing virtual disks. drive Specifies one of drive letters of partitions on the target disk. /Q Suppresses prompting and fails the operation when an error has occured. /F Suppresses prompting and forces the image to close even if an error has occured. Make sure that other programs are not using any partitions on the drive before closing the image. Generally, the image should not be closed while the virtual drive is used by any processes. Although you can force to close the image by answering to do so when asked or by using the /F option, you should be aware that to forcibly closing an image may lead to loss of data or unexpected behavior of the operating system. VDK LINK ======== Assign a drive letter to a partition. SYNTAX: VDK.EXE LINK disk# part# [drive] OPTIONS: disk# Specifies the target virtual disk number. part# Specifies the target partition number. drive Specifies a drive letter to assign. By default, the first available drive letter is used. You cannot assign more than one drive letters to one partition. You cannot assign a drive letter already used for another volume. Use IMAGE command to see partition numbers and the current drive letter assignment. With usual (partitioned) virtual disks, the first partition on the disk is partition 1, the second is partition 2, and so on. Unlike Linux, partition numbers for primary partitions and logical partitions are not distinguished -- logical partition number starts just after the last primary partition and can be any number from 1. Partition 0 represents the whole disk (like /dev/hda, /dev/hdb, /dev/sda, etc. in Linux) and you should not assign a drive letter to it. You can assign a drive letter, but file system drivers cannot access the partition, because it is not formatted in any file system. It is just like you don't usually mount /dev/hda in Linux. Non-partitioned virtual disks (such as floppy image and removable disk image) only have partition 0, and a drive letter is to be assigned to this partition. Again, it is like mounting /dev/fd0 in Linux. VDK ULINK ========= Remove a drive letter from a partition. SYNTAX: VDK.EXE ULINK disk# part# VDK.EXE ULINK drive OPTIONS: disk# Specifies the target virtual disk number. part# Specifies the target partition number. drive Specifies the drive letter to remove. This command can remove drive letters of virtual disk drives only. Use IMAGE command to see partition numbers and the current drive letter assignment. Closing a virtual disk automatically unlinks all drive letters assigned to partitions on the virtual disk. VDK IMAGE ========= Print current virtual disk image information. SYNTAX: VDK.EXE IMAGE [disk#] VDK.EXE IMAGE [drive] OPTIONS: disk# Specifies the target virtual disk number. drive Specifies one of drive letters of partitions on the target disk. This command prints the following information for the target disk: Virtual disk access mode Virtual disk capacity (in 512 byte sectors) Number of files composing the virtual disk Type, capacity and path of each component file Drive letter, size and type of each partition on the virtual disk When target is not specified, information for all drives are printed. VDK HELP ======== Print VDK.EXE command help. SYNTAX: VDK.EXE HELP [command] OPTIONS: command Specifies a VDK.EXE command to display help. Following commands can be specified: INSTALL REMOVE START STOP DRIVER DISK CREATE DELETE VIEW OPEN CLOSE LINK ULINK IMAGE HELP If not specified, the general help is printed. IMAGE TYPES =========== You can use virtual disks on both local and network drives. VIEW and OPEN commands accept the following path expressions: relative paths [