vzvol
vzvol copied to clipboard
vzvol fails with spaces in import filename
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"
Thanks for noticing this! I didn't even consider spaces.