VMware Communities
mehart
Contributor
Contributor
Jump to solution

Problem with vmware-vdiskmanager

Hi guys!

I usually check my virtual drives and defragmentate them on a regular basis...

The following popped up:

Defragmentaition failed

The specified virtual disk needs repair

I looked around here and found that for Linux I need to use:

/usr/bin/vmware-vdiskmanager -R <path of the vmdk(virtual disk)>

Ok have checked and I have Debian 11 installed in the host and Yes the vmware-vdiskmanager is in /usr/bin

If I try to run the followiing:

 

/usr/bin/vmware-vdiskmanager -R /dev/sdd1/VirtualMachines/Windows/Windows 7 x64 UEFI Test/Windows 7 x64 UEFI Test.vmdk

 

 

....it comes up with this response:

 

martyn@DN-Server:~$ /usr/bin/vmware-vdiskmanager -R /dev/sdd1/VirtualMachines/Windows/Windows 7 x64 UEFI Test/Windows 7 x64 UEFI Test.vmdk
Diskname or some other argument is missing.
VMware Virtual Disk Manager - build 20089737.
Usage: vmware-vdiskmanager OPTIONS <disk-name> | <mount-point>
Offline disk manipulation utility
  Operations, only one may be specified at a time:
     -c                   : create disk.  Additional creation options must
                            be specified.  Only local virtual disks can be
                            created.
     -d                   : defragment the specified virtual disk. Only
                            local virtual disks may be defragmented.
     -k                   : shrink the specified virtual disk. Only local
                            virtual disks may be shrunk.
     -n <source-disk>     : rename the specified virtual disk; need to
                            specify destination disk-name. Only local virtual
                            disks may be renamed.
     -p                   : prepare the mounted virtual disk specified by
                            the mount point for shrinking.
     -r <source-disk>     : convert the specified disk; need to specify
                            destination disk-type.  For local destination disks
                            the disk type must be specified.
     -x <new-capacity>    : expand the disk to the specified capacity. Only
                            local virtual disks may be expanded.
     -R                   : check a sparse virtual disk for consistency and attempt
                            to repair any errors.
     -e                   : check for disk chain consistency.
     -D                   : make disk deletable.  This should only be used on disks
                            that have been copied from another product.
     -U                   : delete/unlink a single disk link.

  Other Options:
     -q                   : do not log messages

  Additional options for create and convert:
     -a <adapter>         : (for use with -c only) adapter type
                            (ide, buslogic, lsilogic). Pass lsilogic for other adapter types.
     -s <size>            : capacity of the virtual disk
     -t <disk-type>       : disk type id
     -z <level>           : compression level for -t 5. Valid range: [0,9]
                            Default: 1

  Disk types:
      0                   : single growable virtual disk
      1                   : growable virtual disk split into multiple files
      2                   : preallocated virtual disk
      3                   : preallocated virtual disk split into multiple files
      4                   : preallocated ESX-type virtual disk
      5                   : compressed disk optimized for streaming
      6                   : thin provisioned virtual disk - ESX 3.x and above

     The capacity can be specified in sectors, KB, MB or GB.
     The acceptable ranges:
                           ide/scsi adapter : [1MB, 8192.0GB]
                           buslogic adapter : [1MB, 2040.0GB]
        ex 1: vmware-vdiskmanager -c -s 850MB -a ide -t 0 myIdeDisk.vmdk
        ex 2: vmware-vdiskmanager -d myDisk.vmdk
        ex 3: vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
        ex 4: vmware-vdiskmanager -x 36GB myDisk.vmdk
        ex 5: vmware-vdiskmanager -n sourceName.vmdk destinationName.vmdk
        ex 6: vmware-vdiskmanager -k myDisk.vmdk
        ex 7: vmware-vdiskmanager -p <mount-point>
              (A virtual disk first needs to be mounted at <mount-point>)

 

Can anyone tell me what I am missing here?

I know that VirtualMachines is on /dev/sdd1...on that drive I have a folder "Windows" for Windows virtual machines and in that folder is another that is called "Windows 7 x64 UEFI Test" and the vmdk file is "Windows 7 x64 UEFI Test.vmdk" so I don't understand what is wrong with my code...

 

Martyn

 

0 Kudos
1 Solution

Accepted Solutions
RDPetruska
Leadership
Leadership
Jump to solution

You need to enclose the path/filename in quotes since there are spaces.

View solution in original post

11 Replies
RDPetruska
Leadership
Leadership
Jump to solution

You need to enclose the path/filename in quotes since there are spaces.

mehart
Contributor
Contributor
Jump to solution

Hi RDPetruska!

I was wondering about that....

Ok....thankyou for your time...

 

Martyn

0 Kudos
mehart
Contributor
Contributor
Jump to solution

Hi again!

My brain seems to have forgotten what I learnt here and I could do with an example:

I have the same problem now with a vmachine that needs fixing...

I have a similar address as before...

/usr/bin/vmware-vdiskmanager -R /dev/sdd1/VirtualMachines/Windows/Windows 7 x64 USB/Windows 7 x64 USB-000001.vmdk

The above location is shown in VMWare settings for the virtual machine "Disk File"

I just am uncertain as to where the "" should start and finish....

Can someone give me examples?

 

Much appreciated!

 

Martyn

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

As mentioned before by @RDPetruska, it's the path/file.

/usr/bin/vmware-vdiskmanager -R "/dev/sdd1/VirtualMachines/Windows/Windows 7 x64 USB/Windows 7 x64 USB-000001.vmdk"

Please consider to backup the VM's files/folder prior to running the command.

André

0 Kudos
mehart
Contributor
Contributor
Jump to solution

Sorry but that doesn't work...

I am getting the same error as before..

Disk name or some other argument is missing?

 

Martyn

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Did you double-check the path, and file name yet?

You may want to use e.g. TAB completion in the CLI to enter the path/file name, or compare it with the path/file shown in the VM's vmware.log file.

André

0 Kudos
mehart
Contributor
Contributor
Jump to solution

Well I can't see anything that is wrong.

I am adding three pics...shows my mount and where the file is...

Can you see anything?

Martyn

 

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Since you've mounted /dev/sdd1 as VirtualMachines , the command will most likely be:

/usr/bin/vmware-vdiskmanager -R "/VirtualMachines/Windows/Windows 7 x64 USB/Windows 7 x64 USB-000001.vmdk"

André

0 Kudos
mehart
Contributor
Contributor
Jump to solution

Hi

Tried that and the result is shown below....

 

Martyn

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

It looks like there's a wrong " in from to /VirtualMachines/...

André

mehart
Contributor
Contributor
Jump to solution

You are not wrong....God one feels stupid at times....

I do thank you for your patience and showing the error of my ways....lol

 

Martyn

0 Kudos