Expanding the (OS-)disk - Windows & Linux

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!


How to request (OS-)disk expansion?

  1. Contact your CST member via a ticket. Choose your organization and request for a change. Please let us know:
    1. As with anything that incurs costs: permission of the accountable (this will be checked).
    2. The workspace name.
    3. On which VM you want to have the disk expanded and the OS (Windows/Linux).
  2. The CST member will contact you with advice on either increasing the OS-disk or putting an extra disk in place.
  3. In case of OS-disk expansion: the expansion will be carried out and confirmed by anDREa's own Support Team member.


How to configure the disk to use the expanded volume?

Prerequisite: Workspace Accountable or Priviledged member role

Windows

  1. After confirmation, you as Owner of a workspace has to perform a couple of simple steps listed below (~5 mins):
    1. Connect to the VM.
    2. Go to the Startmenu and search for Server Manager
    3. Right click on Server Manager and click on Run as administrator.
    4. On the left side, click on File and Storage Services (red square).

    1. Click on Volumes (blue square).
    2. Right click on the disk that was expanded (in this case C:).
    3. Click on Extend volume (green square).


    1. Fill in the size that you have requested and press OK.
    2. 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
  1. Login to your VM and start by checking how much space you have: 
$ df -h
  1. Here you can see the current diskspace and distribution of the partitions:

  1. Change your partition table of disk sda.
    1. (Based on the partition you see highlighted above, partition distribution might look different to you)
    2. Beware: in the command below, refer to the disk (sda) and not to the partition (sda2)
$ sudo fdisk /dev/sda
  1. If your units are not yet in sectors, press " u "
  2. 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. 
  1. Delete the /dev/sda2 partition by running in this order:
    1. " d ", <enter>
    2. " 2 ", <enter>
  2. Now create a new partition by running in this order:
    1. n ", <enter>
    2. " p ", <enter>
    3. " 2 ", <enter>
      1. p stands for primary partition and 2 for the partition 2 (if you deleted another partition, select here partition you deleted.
  3. 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)
  1. Write the partitions by running " w " <enter>
  2. Reboot the system (if you are using PuTTY or X2GO you might need to start a new session):
$ sudo reboot
Resize filesystem
$ sudo xfs_growfs /dev/sda2
You can verify that your disk was resized:
$ df -h

/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 ...