You are here: GSI Wiki>Epics Web>DevelopersCorner>WindowsTricksTips (revision 1)EditAttach
Epics@GSI Webhome

Windows Tricks Tips



Resize Raw Img File Using VirtualBox

Following the recommendation on
  • e.g. to resize to 15.5GB, approx. size 15500
set VBOXMANAGE="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
   echo %VBOXMANAGE% does not exist ... exiting)
	IF EXIST input.vdi   ( %VBOXMANAGE% closemedium disk input.vdi --delete)
	IF EXIST output.vdi ( %VBOXMANAGE% closemedium disk output.vdi --delete) 
	IF EXIST output.img (%VBOXMANAGE% closemedium disk output.img)
	REM  use without .img
	set /p INPUT_NAME="Enter input file name without .img: "; 
	set OUTPUT_NAME=%INPUT_NAME%_resized 
	set /p OUTPUT_SIZE="Enter Size (MB) (e.g. 15000): "  
	ECHO "=========================================================================" 
	%VBOXMANAGE% convertfromraw %INPUT_NAME%.img input.vdi -format VDI --variant Standard 
	ECHO "=========================================================================" 
	%VBOXMANAGE% createhd --filename output.vdi --size %OUTPUT_SIZE% --format VDI --variant Standard 
	ECHO "=========================================================================" 
	%VBOXMANAGE% clonehd input.vdi output.vdi --existing 
	ECHO "=========================================================================" 
	%VBOXMANAGE% clonehd output.vdi output.img --format RAW 
	copy output.img %OUTPUT_NAME%.img 
	%VBOXMANAGE% closemedium disk input.vdi --delete 
	%VBOXMANAGE% closemedium disk output.vdi --delete 
	%VBOXMANAGE% closemedium disk output.img 

-- WikiGuest - 1970-01-01

-- PeterZumbruch - 18 Nov 2015
-- PeterZumbruch - 2015-11-18
Edit | Attach | Print version |  PDF | History: r2 < r1 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r1 - 2015-11-18, PeterZumbruch
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)