vzvol icon indicating copy to clipboard operation
vzvol copied to clipboard

vzvol fails with spaces in import filename

Open hcw70 opened this issue 6 years ago • 1 comments

When doing:

root@nvidion:~# vzvol -t virtualbox -s 120GB -u hcw -v Win7_64bitVBox --import ~hcw/VirtualBox\ 

i get

VMs/Win7/Win7\ 64\ bit.vdi 
Testing to ensure zvol was created
Testing to ensure zvol exists
Now importing /home/hcw/VirtualBox VMs/Win7/Win7 64 bit.vdi to /dev/zd0
This will DESTROY all data on /dev/zd0
Do you want to continue? [y/N]?y
Beginning import...
dd: nicht erkannter Operand »VMs/Win7/Win7“
„dd --help“ liefert weitere Informationen.
Error occurred in function vzvol_import_img
Exiting

This seems to be caused by spaces in the path to my .vdi file.

Can be fixed in vzvol_import.sh by quoting the dd arguments:

VZVOL_IMPORT_CMD="dd if=\"${IMPORTIMG}\" of=${ZVOL_IMPORT} status=progress"

hcw70 avatar Sep 14 '18 07:09 hcw70

Thanks for noticing this! I didn't even consider spaces.

RainbowHackerHorse avatar Nov 02 '18 09:11 RainbowHackerHorse