Expanding the (OS-)disk - Windows & Linux
Why expand the OS-disk?
In a Virtual Machine (VM), the OS-disk is where the Operating System (OS; for instance Windows or Linux) is installed but also encompasses your general desktop and other folders (basically anything on the C:-drive). It is always recommended to store your data on the Z:-disk, as this is the fileshare that everyone in the workspace can access. Moreover, data on the Z-disk is snapshotted (backup of all the changes compared to the previous day) every evening, whereas data on the OS-disk is not being snapshotted.
However, you might have noticed that fileshares (in this case the Z:-disk) can be very slow. Unpacking .zip files is way faster if you transfer it to your desktop (= part of the C-disk). Another example is loading heavy images such as CT scans into software. This is way faster when done from your desktop. The C-disk size is 127 GB (on Windows; 16 GB on Linux) by default and there has to be enough space for the OS. In some cases it is therefore desired to increase the size of the OS-disk or to gain access to an extra data disk.
Disks can be increased in size but not decreased!
These steps will be performed only by the Accountable and Privileged Member of the Workspace.
In order to up-size the (OS)disk, the Virtual Machine must be deallocated!
- Log in to your Workspace
- Click on the three dots on the Virtual Machine that you want to perform the up-size (OS)disk
- Select Up-Size OS Disk
A pop-up window will appear where you can select the new size of your (OS)disk, along with the pricing details-
During the selection of the disk the prices are now shown as well:
After selecting the disk size, check the Confirm Up-Size box and Up-Size to save the changes.
Read below on how to configure the disk to use the expanded volume!
As a self-service, you can expand data disks up to 2TB.
If a disk is 4 TiB or less, you should deallocate your VM and detach the disk before expanding it beyond 4 TiB. If a disk is already greater than 4 TiB, you can expand it without deallocating the VM and detaching the disk.
How to request (OS-)disk expansion more than 2Tb?
- Contact your Research Support member via a ticket. Choose your organization and request for a change. Please let us know:
- As with anything that incurs costs: permission of the accountable (this will be checked).
- The workspace name.
- On which VM you want to have the disk expanded and the OS (Windows/Linux).
- The Research Support member will contact you with advice on either increasing the OS-disk or putting an extra disk in place.
For Research Support Member
- Detach a data disk for resizing above 2TB
Please note that when you replace the OS Disks on a virtual machine (VM) and later delete the VM without properly cleaning up the disk, the old disk remains. This leftover disk can cause deployment failures if you try to create a new VM with the same server name.
Prerequisite: Workspace Accountable or Priviledged member role Windows
- After confirmation, you as Owner of a workspace has to perform a couple of simple steps listed below (~5 mins):
- Connect to the VM.
- Go to the Startmenu and search for Server Manager.
- Right click on Server Manager and click on Run as administrator.
- On the left side, click on File and Storage Services (red square).
- Click on Volumes (blue square).
- Right click on the disk that was expanded (in this case C:).
- Click on Extend volume (green square).
- Fill in the size that you have requested and press OK.
- The C-disk is now expanded to the requested volume.
Linux
After confirmation, you as Owner of a workspace has to perform partition and filesystem resizing of your Linux VM.
The instructions below are only required for Linux CentOS machines, for Linux Ubuntu machines you only need to restart your VM.
Resizing the partitions
- Login to your VM and start by checking how much space you have:
- Here you can see the current diskspace and distribution of the partitions:
- Change your partition table of disk sda.
- (Based on the partition you see highlighted above, partition distribution might look different to you)
- Beware: in the command below, refer to the disk (sda) and not to the partition (sda2)
- If your units are not yet in sectors, press " u "
- Press " p " to view the partition details. Pay attention to starting and ending sectors.
This will not delete any data, it will only alter the partition table
If you are not sure which partition you should delete, please ask before trying because deleting the "wrong" partition can lead to a dysfunctional Linux VM.
- Delete the /dev/sda2 partition by running in this order:
- " d ", <enter>
- " 2 ", <enter>
- Now create a new partition by running in this order:
- " n ", <enter>
- " p ", <enter>
- " 2 ", <enter>
- p stands for primary partition and 2 for the partition 2 (if you deleted another partition, select here partition you deleted.
- Check that starting sector value is the same as in partition details above (this is usually by default the same value so you can just press enter)
- Write the partitions by running " w " <enter>
- Reboot the system (if you are using PuTTY or X2GO you might need to start a new session):
Resize filesystem
$ sudo xfs_growfs /dev/sda2
You can verify that your disk was resized:
/dev/sda2 is now resized to 32G.
Related Articles
Extra data disk request & initialization - Windows & Linux
Introduction The Z-drive (fileshare) is rather slow compared to a managed disk such as the C-drive. Although expansion of the C-drive is possible, it is good to keep in mind that the Operating System (OS) is also installed on the C-drive. It is not a ...
Windows-OSDS/1.0.0 Open Source Data Science
Windows-OSDS/1.0.0 Open Source Data Science VM template This template has been discontinued, it is not up-to-date anymore. Please contact your local Support Team member for institute-specific VM templates. OS Windows Server 2019 Web browsers Chrome ...
Windows-Base 1.0.5
OS Windows Server 2019 Browsers Microsoft Edge Chrome Utilities Notepad++ 7-Zip
Linux VMs
On the myDRE platform different types of Linux virtual machines (VMs) are available. CentOS 7.5 (is reaching its end of life) Ubuntu 20 (for GPU usage) Ubuntu 22 By default, Linux VMs have no connection to the outside world, so cannot be directly ...
Windows VMs
Introduction Read below how you can connect to the VM from different Operating Systems (OS, e.g. Windows, MacOS, Linux). An Azure virtual machine (VM) gives you the flexibility of virtualization without having to buy and maintain the physical ...