Epics@GSI Webhome

Tipps Windows Resize Raw Img File Using Virtual Box

Introduction

Following the recommendation on http://raspberrypi.stackexchange.com/questions/4943/resize-image-file-before-writing-to-sd-card:
  • e.g. to resize to 7GB, size 7000
IF EXIST input.vdi   ( "C:\Program Files\Oracle\VirtualBox\VBoxManage" closemedium disk input.vdi --delete)
IF EXIST output.vdi ( "C:\Program Files\Oracle\VirtualBox\VBoxManage" closemedium disk output.vdi --delete) 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" closemedium disk output.img 
 
REM  use without .img
set INPUT_NAME=<input> 
set OUTPUT_NAME=%INPUT_NAME%_resized 
set OUTPUT_SIZE=7000 
 
ECHO "=========================================================================" 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" convertfromraw %INPUT_NAME%.img input.vdi -format VDI --variant Standard 
ECHO "=========================================================================" 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" createhd --filename output.vdi --size %OUTPUT_SIZE% --format VDI --variant Standard 
ECHO "=========================================================================" 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" clonehd input.vdi output.vdi --existing 
ECHO "=========================================================================" 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" clonehd output.vdi output.img --format RAW 
copy output.img %OUTPUT_NAME%.img 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" closemedium disk input.vdi --delete 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" closemedium disk output.vdi --delete 
"C:\Program Files\Oracle\VirtualBox\VBoxManage" closemedium disk output.img 


-- PeterZumbruch - 24 Feb 2016
-- PeterZumbruch - 2016-02-24
Edit | Attach | Print version |  PDF | History: r6 | r5 < r4 < r3 < r2 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r4 - 2016-02-24, 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)