At CloudSigma our infrastructure provides unbundled resources which gives a lot of flexibility. It means you can increase a drive’s size as you need to. The problem for the most people is however that when the drive size is increased at the infrastructure layer in the cloud, the filesystem is not expanded automatically and you have to do this manually which takes time and is inconvenient.
For this reason we have implemented a script in our pre-installed Windows OS library images which checks the drive size on every boot and expands the filesystem to fit the actual size. To take advantage of this and other little neat time saving tricks just use our Windows images available from the drives library.
In this blog post we share with you how the script works and is built so you can implement this against any Windows systems you might have including those you may have uploaded yourself.
Create script commands file
- In the directory
C:\Windows\Setupcreate a subdirectory called
Scriptsif it doesn’t already exist.
- Enter the following commands into a new blank text file:
- In the directory
select disk 0
select partition 2
- Save and close the file
diskpart.txtin the directory
Create executable batch file
Next we create an executable batch file, that will automatically run the script on every boot and apply the script.
- Add the following commands to a new text file:
diskpart /s C:\Windows\Setup\Scripts\diskpart.txt
del /Q /F C:\Windows\System32\Sysprep\unattend.xml
del /Q /F C:\Windows\Panther\unattend.xml
- Save the file with filename
DiskExtension.batin the directory:
(Depending on the text editor you are using, ensure that for
Save as typeyou select as
All Filesand not
Text Documents (*.txt))
Disable warning pop-up alerts
If you wish to disable the warning pop-up alerts that run on every boot up of the server (i.e. “Are you sure to run this script?”), please follow the steps below:
- Go to
Control Panel -> User -> Change User Account Control settings
- Move the scroll bar to the bottom position labelled
Never notify me
We hope you find this script useful and happy computing in our infrastructure!