Wednesday, September 24, 2008

VCB basic usage - VM mount with mountVm

The full backup of virtual machine vcb-backup was finished and we have its virtual disk available locally now. We can backup it directly or we can access its filesystem and backup selected filesystem structure only (e.g. we want to backup some application data only).

The virtual disk and the whole virtual machine is available in the c:\mnt\vcb-backup\ directory. It contains everything what we might require for its restoration (VMX and VMDK configuration files, NVRAM states and so on). This screenshot figures its content:

The virtual disk path is available from the output of vcbmounter command:
c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk
To browse the filesystem, we will mount it with the mountvm command:
mountvm -cycleId -d c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk \
c:\vcb-backup
The successful execution of it will produce messages like these:
Opened disk: c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk
Proceeding to analyze volumes
Done mounting
Volume 1 mounted at c:\vcb-backup\digits\1 (mbSize=12291 fsType=NTFS )
Volume 1 also mounted on c:\vcb-backup\letters\C
A virtual machine disk represents an image of x86 harddisk with own MBR and partition table. Our disk contains only one partition with NTFS filesystem linked with drive letter C. Each such a letter is mounted under the directory which we specified with -d option (again, the directory is created on demand and it can't exist before). In our scenario, we have c:\vcb-backup\letters.

We are able to traverse the filesystem now and backup its particular files or directories. When we are finished, we will have to unmount it:
mountvm -u c:\vcb-backup
If the mounted filesystem isn't busy, the command will print these messages (otherwise it will end with an error):
Unmounted c:\vcb-backup\digits\1\ (formatted)
Deleted directory c:\vcb-backup\digits\1\
Deleted directory c:\vcb-backup\digits
Deleted directory c:\vcb-backup\letters\C\
Deleted directory c:\vcb-backup\letters
Deleted directory c:\vcb-backup
Finally, let's make a summary of virtual machine full backup steps:
  1. we need to identify the machine (vcbvmname)
  2. we need to export its virtual disk (vcbmounter -t fullvm)
  3. optionally, we might need to mount its filesystem (mountvm)
  4. backup the exported disk
  5. backup the mounted filesystem if mounted
  6. unmount the filesystem if mounted (mountvm -u)
That's all for now. Any question or suggestions are welcome.

No comments: