Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
userspace:diskpart_-_dynamic_system_partition_resize [2015/09/17 19:38]
larsg
userspace:diskpart_-_dynamic_system_partition_resize [2015/09/23 13:40]
larsg
Line 1: Line 1:
 ====== Resize system partition dynamically,​ based on size needed ====== ====== Resize system partition dynamically,​ based on size needed ======
  
-   * created by LarsG [[algee2005@gmail.com]] 2015/09/17+   * created by LarsG [[lars.gruenheid{at}civitec.de]] 2015/09/17
  
    * tested under windows 7    * tested under windows 7
    * tested under winst 4.11.5.13    * tested under winst 4.11.5.13
  
-In case you want your system partition to only use the amount of diskspace required by the applications you install, +In case you want your system partition to only use the amount of diskspace required by the system and the applications you install,
 you can use the following code to extend your system partition dynamically before installing your software. you can use the following code to extend your system partition dynamically before installing your software.
  
Line 15: Line 14:
  
 If you want use this, you should consider adopting further measures to prevent possible hickups - f.e. move profiles to another partition, configure your applications to store their data on another partition, prevent write access for users on the system partition. ​ If you want use this, you should consider adopting further measures to prevent possible hickups - f.e. move profiles to another partition, configure your applications to store their data on another partition, prevent write access for users on the system partition. ​
-take care ;) +Take care ;)
  
  
-Integrate the following code into your installation script, and change the value of $MinimumFreeSpace$ to the amount of MB required by the software to install; 1 GB equals **1024**, like given as example below. 
  
 +Integrate the following code into your installation script, and change the value of ''​$MinimumFreeSpace$''​ to the amount of MB required by the software to install; 1 GB equals ''​1024'',​ like given as example below.
  
 <code winst> <code winst>
-[Actions]+[actions]
 defVar $MinimumFreeSpace$ ​ defVar $MinimumFreeSpace$ ​
 set $MinimumFreeSpace$ = "​1024"​ set $MinimumFreeSpace$ = "​1024"​
Line 30: Line 28:
  comment "Not enough free space left, trying to extend volume %SystemDrive% by " + $MinimumFreeSpace$ + " MB."  comment "Not enough free space left, trying to extend volume %SystemDrive% by " + $MinimumFreeSpace$ + " MB."
  execwith_resize_volume diskpart /s  execwith_resize_volume diskpart /s
- comment "​Exitcode:​ " + getLastExitCode 
  if not ( hasMinimumSpace( "​%SystemDrive%",​ $MinimumFreeSpace$ + " MB" ) )  if not ( hasMinimumSpace( "​%SystemDrive%",​ $MinimumFreeSpace$ + " MB" ) )
  logError "​Failed to resize volume, cancel installation"​  logError "​Failed to resize volume, cancel installation"​
Line 42: Line 39:
 <code winst> <code winst>
 [execwith_resize_volume] [execwith_resize_volume]
-SELECT ​volume %SystemDrive% +select ​volume %SystemDrive% 
-EXTEND ​size=$MinimumFreeSpace$+extend ​size=$MinimumFreeSpace$
 </​code>​ </​code>​
  
-This script assumes you install software on your system partition. Otherwise, you need to replace any occurance of %SystemDrive% within my code with the drive letter of your desired partition.+This script assumes you install software on your system partition. Otherwise, you need to replace any occurance of ''​%SystemDrive%'' ​within my code with the drive letter of your desired partition.
 f.e. extract it like this: f.e. extract it like this:
  

QR Code
QR Code userspace:diskpart_-_dynamic_system_partition_resize (generated for current page)