> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/storage/block-storage/how-tos/resize-a-volume.md).

# Resize a volume

You can resize a volume while it's still attached to a virtual machine.

***

Before you can resize a volume, it must be attached to a VM. After the volume is resized, you must extend the partition and filesystem on it to utilize the new space. This operation is done from inside the operating system.

## Resize the volume using the control panel

Navigate to **Storage → Block storage**. Click on the volume you want to resize.

Click **Actions** and select **Resize volume**. (Also note down the **WWN**; you'll need it later to expand the partition on the volume. You'll find the WWN under ***Attachment*** in the screenshot below.)

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FTbixBPQAThJvnuH5mu1a%2Fblock-storage-resize1.png?alt=media&amp;token=84b6a6f4-f202-426c-81a9-d04332061dbc" alt=""><figcaption></figcaption></figure>

A new dialog box opens where you increase the size by dragging the slider. Once you are satisfied with the new size, click **Update**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FgVB7DE3NpcP7QF0CzQMF%2Fblock-storage-resize2.png?alt=media&amp;token=b2fba9b3-b3bc-4f2e-967d-a62fb7a44070" alt=""><figcaption></figcaption></figure>

## Resize the volume using the API

It's also possible to resize the volume using the [API](https://docs.glesys.com/platform/control-panel/api.md), instead of the control panel. To resize the volume using the API, use the [blockstorage/resize](https://github.com/GleSYS/API-docs/wiki/API-Documentation#blockstorageresize) endpoint.

## Resize the partition and filesystem

Now that the volume is resized, you also have to expand the partition and filesystem in the operating system to utilize the new space.

{% tabs %}
{% tab title="Linux" %}
In Linux, you first need to grow the partition using `growpart`, then extend the filesystem using `resize2fs`.

These tools are pre-installed on most Linux distributions on Glesys. If `growpart` is not available, it can be installed using `sudo apt install cloud-guest-utils` in Debian and Ubuntu, or `sudo dnf install cloud-utils-growpart` in AlmaLinux.

Start by confirming that the volume has been increased, and confirm the WWN and the path.

<pre data-title="Command and output. Command is highlighted."><code><strong>lsblk -o NAME,FSTYPE,WWN,MOUNTPOINTS,SIZE
</strong>NAME    FSTYPE  WWN                MOUNTPOINTS   SIZE
sda             0x305b0264d59532e7                20G
├─sda1  ext4    0x305b0264d59532e7 /            19.9G
├─sda14         0x305b0264d59532e7                 3M
└─sda15 vfat    0x305b0264d59532e7 /boot/efi     124M
sdb             <a data-footnote-ref href="#user-content-fn-1">0x3fa0d41402141ef7                60G</a>
└─sdb1  ext4    <a data-footnote-ref href="#user-content-fn-2">0x3fa0d41402141ef7 /mnt/volume1   30G</a>
sr0                                                2K
sr1     iso9660                                   60K

<strong>df -h /mnt/volume1/
</strong>Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1        30G  5.5M   <a data-footnote-ref href="#user-content-fn-3">30G   1% /mnt/volume1</a>
</code></pre>

The first step is to grow the partition with `growpart`. Here we'll use the WWN to make sure we are working on the correct volume. As we can see in the NAME column above, it's the first—and only—partition on the disk. Note that we specify the partition with a single digit after the path.

<pre><code><strong>sudo growpart /dev/disk/by-id/wwn-0x3fa0d41402141ef7 1
</strong>CHANGED: partition=1 start=256 old: size=7864031 end=7864286 new: size=15728351 end=15728606
</code></pre>

Another check with `lsblk` confirms that the partition has grown to the size of the volume.

<pre data-title="Command and output. Command is highlighted."><code><strong>lsblk -o NAME,FSTYPE,WWN,MOUNTPOINTS,SIZE
</strong>NAME    FSTYPE  WWN                MOUNTPOINTS   SIZE
sda             0x305b0264d59532e7                20G
├─sda1  ext4    0x305b0264d59532e7 /            19.9G
├─sda14         0x305b0264d59532e7                 3M
└─sda15 vfat    0x305b0264d59532e7 /boot/efi     124M
sdb             0x3fa0d41402141ef7                60G
└─sdb1  ext4    <a data-footnote-ref href="#user-content-fn-4">0x3fa0d41402141ef7 /mnt/volume1   60G</a>
sr0                                                2K
sr1     iso9660                                   60K

</code></pre>

However, the filesystem is still just 30GiB.

<pre data-title="Command and output. Command is highlighted."><code><strong>df -h /mnt/volume1/
</strong>Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1        <a data-footnote-ref href="#user-content-fn-5">30G  5.5M   30G</a>   1% /mnt/volume1
</code></pre>

The last step is to resize the filesystem to match the partition.

<pre data-title="Command and output. Command is highlighted."><code><strong>sudo resize2fs /dev/disk/by-id/wwn-0x3fa0d41402141ef7-part1
</strong>resize2fs 1.47.2 (1-Jan-2025)
Filesystem at /dev/disk/by-id/wwn-0x3fa0d41402141ef7-part1 is mounted on /mnt/volume1; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 8
The filesystem on /dev/disk/by-id/wwn-0x3fa0d41402141ef7-part1 is now 15728351 (4k) blocks long.
</code></pre>

Another check with `df` confirms that the filesystem has now also grown to use the entire volume.

<pre data-title="Command and output. Command is highlighted."><code><strong>df -h /mnt/volume1/
</strong>Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1        <a data-footnote-ref href="#user-content-fn-6">59G  5.5M   59G</a>   1% /mnt/volume1
</code></pre>

{% endtab %}

{% tab title="Windows Server (GUI)" %}
Start a PowerShell terminal and run the following command (search for ***Terminal*** or ***PowerShell*** in the Start menu).&#x20;

Execute `Get-Disk` and look for the WWN shown in the control panel and match it to a disk.

<pre data-title="Command and output. Command is highlighted."><code><strong>Get-Disk | Select-Object Number, FriendlyName, UniqueId
</strong>
Number FriendlyName       UniqueId
------ ------------       --------
     0 GLESYS LOCAL DISK  34CE12CC9399D6F5
     2 GLESYS REMOTE DISK 33BA36AC4069C5C4
     1 GLESYS REMOTE DISK 3A7FD683CB796B39
</code></pre>

In this example, disk number 2 matches the WWN from the control panel.

Open **Computer Management** by searching for it in the Start menu.

Once inside Computer Management, select **Disk Management** under **Storage**. Right-click on the first partition on the disk from the previous step (in this example, disk 2). Select **Extend Volume**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FTXLKCRW4TZREmVCwUweG%2Fwindows-server-2025-extend-volume.png?alt=media&amp;token=9ceb5aee-e89b-4798-bb6c-8a52d9ac9541" alt=""><figcaption></figcaption></figure>

When the wizard starts, click **Next**.&#x20;

In the next dialog window, leave the size as-is. This will use the entire space on the volume. Click **Next**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FyM7zh62nnLAosImv9E4P%2Fwindows-server-2025-extend-volume1.png?alt=media&amp;token=13bb0d92-f675-4e3f-a426-84476182c32a" alt=""><figcaption></figcaption></figure>

On the last step, you'll see a summary. Click **Finish** to extend the partition if everything looks alright.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FOMWRpaoj2JJaz4SJsqW5%2Fwindows-server-2025-extend-volume2.png?alt=media&amp;token=0b240529-6c08-4d45-8237-386f6a5e3752" alt=""><figcaption></figcaption></figure>

This partition is now extended to use the entire volume, as shown in the **Disk Management** tool. There is no free space after the partition. You can also verify that the drive under **This PC** is the correct size.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2F2XWTnjsqD0sUbjcLizww%2Fwindows-server-2025-extend-volume3.png?alt=media&amp;token=ef73a3df-84cd-44a0-936b-2d7e68d3e45a" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Windows Server (PowerShell)" %}
Start a PowerShell terminal and run the following command (search for ***Terminal*** or ***PowerShell*** in the Start menu).

To make sure Windows sees the new space on the volume, start by refreshing the storage cache.

<pre data-title="Command"><code><strong>Update-HostStorageCache
</strong></code></pre>

Execute `Get-Disk` as below. Look for the WWN shown in the control panel and match it to a disk. Make sure that the disk recognizes the new extended size. In this example, the disk has been resized to 120GiB (disk2, in this example).

<pre data-title="Command and output. Command is highlighted."><code><strong>Get-Disk | Select-Object Number,FriendlyName,UniqueId,Size
</strong>
Number FriendlyName       UniqueId                 Size
------ ------------       --------                 ----
     0 GLESYS LOCAL DISK  34CE12CC9399D6F5  32212254720
     2 GLESYS REMOTE DISK 33BA36AC4069C5C4 128849018880
     1 GLESYS REMOTE DISK 3A7FD683CB796B39  85899345920
</code></pre>

List the partitions on the disk matching the WWN (in our example, disk 2).

<pre data-title="Command and output. Command is highlighted."><code><strong>Get-Disk -Number 2 | Get-Partition
</strong>

   DiskPath: \\?\scsi#disk&#x26;ven_glesys&#x26;prod_remote_disk#5&#x26;83f7dc4&#x26;0&#x26;000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

PartitionNumber  DriveLetter Offset                                        Size Type
---------------  ----------- ------                                        ---- ----
1                           24576                                     15.98 MB Reserved
2                F           16777216                                  99.98 GB Basic
</code></pre>

In this example, partition number 2 with the drive letter **F** is the one we want to expand (since it's the only "real" partition on the disk).

To expand the partition to utilize all the new space, you first have to get the maximum supported size of the partition and save that value to a variable. Then, you use that variable to expand the partition to its maximum value. Make sure you use the correct drive letter in the commands below.

<pre data-title="Two commands."><code><strong>$max = (Get-PartitionSupportedSize -DriveLetter F).SizeMax
</strong><strong>Resize-Partition -DriveLetter F -Size $max
</strong></code></pre>

Confirm that the partition has grown to the size of the volume.

<pre data-title="Command and output. Command is highlighted."><code><strong>Get-Disk -Number 2 | Get-Partition
</strong>

   DiskPath: \\?\scsi#disk&#x26;ven_glesys&#x26;prod_remote_disk#5&#x26;83f7dc4&#x26;0&#x26;000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

PartitionNumber  DriveLetter Offset                                        Size Type
---------------  ----------- ------                                        ---- ----
1                           24576                                     15.98 MB Reserved
2                F           16777216                                 119.98 GB Basic
</code></pre>

Everything has worked out. The partition has grown to roughly 120GiB.
{% endtab %}
{% endtabs %}

[^1]: The volumes have been increased to 60GiB.

[^2]: But the partition is still only 30GiB.

[^3]: The filesystem on the partition is still only 30G.

[^4]: The partition is now the same size as the volume.

[^5]: The filesystem is still just 30G.

[^6]: The filesystem has now grown to use the entire volume and partition.
