Vmware ESXi: vmkfstools: Extra arguments at the end of the command line.
Code:
# vmkfstools -c 5G –diskformat thin testdisk2.vmdk
Extra arguments at the end of the command line.
OPTIONS FOR FILE SYSTEMS:
Above command would contain hidden characters as shown below:
Code:
$ echo -n 'vmkfstools -c 5G –diskformat thin testdisk2.vmdk' | wc -c
50
$ echo -n 'vmkfstools -c 5G –diskformat thin testdisk2.vmdk' | xxd
00000000: 766d 6b66 7374 6f6f 6c73 202d 6320 3547 vmkfstools -c 5G
00000010: 20e2 8093 6469 736b 666f 726d 6174 2074 ...diskformat t
00000020: 6869 6e20 7465 7374 6469 736b 322e 766d hin testdisk2.vm
00000030: 646b dk
Above copy-pasted command contains two extra illegal bytes.
As seen at offset 0x10, bytes 0x11, 0x12,0x13 ( e2 8093) contain non-ascii characters (definitely not "-"). This is what breaks the vmkfstools command if it was copy-pasted from a webpage or from notepad.
It needs to be rewriten to below (looks the same, but actually it's not):
Code:
$ echo -n 'vmkfstools -c 5G -diskformat thin testdisk2.vmdk' | wc -c
48
$ echo -n 'vmkfstools -c 5G -diskformat thin testdisk2.vmdk' | xxd
00000000: 766d 6b66 7374 6f6f 6c73 202d 6320 3547 vmkfstools -c 5G
00000010: 202d 6469 736b 666f 726d 6174 2074 6869 -diskformat thi
00000020: 6e20 7465 7374 6469 736b 322e 766d 646b n testdisk2.vmdk
Now, bytes 0x11 and 0x12 represent ascii "-d", so this command will work.