> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating and resizing Compute volumes

In this article, you will learn how to create [Compute volumes](./types): disks and shared filesystems.

Boot disks are added to virtual machines (VMs) immediately. To use secondary (additional) disks and shared filesystems on VMs after you create the volumes, you need to [attach and mount them to the VMs](./use). You can [detach these volumes](./detach-volume) later, if necessary.

A VM and its volumes must be located in the same project. For more details about projects and resource hierarchy in Nebius AI Cloud, see [How resources, identities and access are managed in Nebius AI Cloud](/iam/overview).

## How to create a disk

<Tabs>
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Disks**.

    2. Click **Create disk**.

    3. On the creation page, specify a disk name.

    4. If you want to create a boot disk, select an operating system. For secondary disks, no operating system is required.

    5. Select the disk type.

    6. (Optional) Enable [data encryption](/security/encryption) if you're creating a Network SSD Non-replicated or Network SSD IO M3 disk.

       Encryption is enabled by default for Network SSD disks.

    7. Set the disk size and block size.

       Maximum size of a boot disk is 30,720 GiB (30 TiB).

    8. (Optional) Enable **Deletion protection** to prevent this disk from being accidentally deleted.

    9. Click **Create disk**.
  </Tab>

  <Tab title="CLI">
    Run the following command:

    ```bash theme={null}
    nebius compute disk create \
      --name <disk_name> \
      --source-image-family-image-family <OS_image> \
      --type network_<ssd|ssd_non_replicated|ssd_io_m3> \
      --disk-encryption-type disk_encryption_managed \
      --size-gibibytes <size> \
      --block-size-bytes <block_size> \
      --forbid-deletion
    ```

    For more information, see [Volume parameters](#volume-parameters).
  </Tab>
</Tabs>

If you created a boot disk, add it when you [create a VM](/compute/virtual-machines/manage#create-a-vm). Alternatively, you can instead [create a managed boot disk or managed secondary disks](/compute/virtual-machines/manage#creating-a-vm-and-disks-together) together with a VM in a single CLI command.

For more information about how to start using the created secondary disk, see [Attaching and mounting Compute volumes to VMs](/compute/storage/use).

## How to create a shared filesystem

<Tabs>
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Shared filesystems**.
    2. Click **Create filesystem**.
    3. On the creation page, specify a filesystem name.
    4. Set the filesystem size and block size.
    5. (Optional) Enable **Deletion protection** to prevent this filesystem from being accidentally deleted.
    6. Click **Create filesystem**.
  </Tab>

  <Tab title="CLI">
    Run the following command:

    ```bash theme={null}
    nebius compute filesystem create \
      --name <filesystem_name> \
      --type network_ssd \
      --size-gibibytes <size> \
      --block-size-bytes <block_size> \
      --forbid-deletion
    ```

    For more details about volume parameters, see [Volume parameters](#volume-parameters).
  </Tab>
</Tabs>

For more information about how to start using the created shared filesystem, see [Attaching and mounting Compute volumes to VMs](./use).

## Volume parameters

Disks and shared filesystems share almost all of their parameters, except for boot disk image which can only be set for disks.

### Metadata

**Name** (`name`): A Nebius AI Cloud resource name. It must be unique inside your tenant. Required at creation, cannot be changed after it.

### Type, encryption and size

* **Type** (`type`): The volume type. See available types of [disks](./types#disk-types) and [shared filesystems](./types#filesystem-specifications). Required at creation, and cannot be changed later.

* **Enable data encryption** (`disk-encryption-type`): Whether a volume should support [data encryption](/security/encryption). Encryption allows you to store personal and other sensitive data securely on volumes, and reduce the risk of unauthorized access.

  Use this parameter only for secondary disks of the Network SSD Non-replicated and Network SSD IO M3 types. Filesystems and Network SSD disks support encryption by default, and you cannot disable it. For more information, see [Encryption of disks](./types#encryption-of-disks).

  In the CLI, use `--disk-encryption-type disk_encryption_managed` to enable encryption.

* **Size** (`size-gibibytes`, `size-mebibytes`, `size-kibibytes` or `size-bytes`): The volume size. See requirements for sizes of [disks](./types#disk-types-comparison) and [shared filesystems](./types#filesystem-specifications) in their comparison tables. Required at creation. After creation, size can only be [increased](#how-to-resize-a-volume).

  When using the CLI, you can set the volume size in GiB, MiB, KiB or B using a respective parameter.

  Maximum size of a boot disk is 30,720 GiB (30 TiB).

* **Block size** (`block-size-bytes`): The data block size for the volume. The data stored on the volume is divided into blocks of this size on the underlying physical drives. Cannot be changed after the volume is created.

  The block size must be a power of two between 4096 bytes (4 KiB) and 131,072 bytes (128 KiB). The default value is 4096 bytes (4 KiB).

  For maximum IOPS, reads and writes to a volume should be close to its block size.

### Boot disk image

* **Boot image** (`source-image-family-image-family`): An image provided by Nebius AI Cloud to use for a boot disk. For details, see [Boot disk images for Compute virtual machines](./boot-disk-images).

### Deletion protection

* **Deletion protection** (`forbid-deletion`): Prevents the volume from being deleted. Use this parameter to protect disks and shared filesystems from accidental deletion, especially in automated environments such as CI/CD pipelines or Terraform configurations.

  Deletion protection can be enabled at creation time or changed at any time after creation. When enabled, any attempt to delete the volume fails with an error. To delete a protected volume, disable deletion protection first.

## How to resize a volume

You can increase the size of an existing disk or shared filesystem. Reducing volume size is not possible.

<Note>
  Compute supports hot resize: you can resize a disk while it is attached to a running virtual machine. For boot disks, the partition table is refreshed automatically on the next reboot. For secondary disks, you need to manually refresh the partition table and grow the filesystem after resizing.
</Note>

To resize a disk or a shared filesystem:

1. Change the volume size:

   <Tabs>
     <Tab title="Web console">
       1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Disks** or <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Shared filesystems**.

          Alternatively, go to the virtual machine where the volume is attached and find it in the **Disks** or **Shared filesystems** tab.

       2. Click the volume you want to resize and go to the **Settings** tab.

       3. In the **Parameters** section, enter the new **Size** value or use the slider to set the new size.

       4. Click **Save changes**.
     </Tab>

     <Tab title="CLI">
       1. If you haven't saved the disk or filesystem's ID when creating it, get its ID:

          ```bash theme={null}
          export DISK_ID=$(nebius compute disk get-by-name \
            --parent-id <project_ID> \
            --name <disk_name> \
            --format json | jq -r ".metadata.id")
          ```

          For a filesystem, use [nebius compute filesystem get-by-name](../../cli/reference/compute/filesystem/get-by-name) with the same parameters.

       2. Run [nebius compute disk update](../../cli/reference/compute/disk/update) for a disk, or [nebius compute filesystem update](../../cli/reference/compute/filesystem/update) for a shared filesystem, and set the new size by using one of the `--size-gibibytes`, `--size-mebibytes`, `--size-kibibytes` or `--size-bytes` parameters. Here is an example for a disk:

          ```bash theme={null}
          nebius compute disk update \
            --id $DISK_ID \
            --size-gibibytes <size>
          ```
     </Tab>
   </Tabs>

2. If you resized a secondary disk and it is currently attached to a running virtual machine, do the following:

   1. [Restart](../virtual-machines/stop-start#how-to-stop-and-start-vms-manually) this VM.

   2. [Connect](../virtual-machines/connect) to this VM.

   3. Install the `cloud-guest-utils` package that manages the disk partitions:

      ```bash theme={null}
      sudo apt-get update && sudo apt-get install -y cloud-guest-utils
      ```

   4. List disks and partitions:

      ```bash theme={null}
      lsblk --paths
      ```

      Output example:

      ```bash theme={null}
      NAME          MAJ:MIN  RM   SIZE  RO  TYPE  MOUNTPOINTS
      /dev/vda      253:0     0    10G   0  disk
      ├─/dev/vda1   253:1     0     9G   0  part  /
      ├─/dev/vda14  253:14    0     4M   0  part
      ├─/dev/vda15  253:15    0   106M   0  part  /boot/efi
      └─/dev/vda16  259:0     0   913M   0  part  /boot
      /dev/vdb      253:16    0     1M   0  disk
      /dev/vdc      253:32    0    20G   0  disk
      └─/dev/vdc1   253:33    0    10G   0  part  /mnt/disk-0
      ```

      Find the device name of the resized disk and get the name of its last partition. The secondary disk is most likely the last one in the list. Also, check the `SIZE` column: it shows that the disk size is increased, but the partition size stays the same. In this example, the required device name is `/dev/vdc`, and the partition is `/dev/vdc1`.

   5. Grow the partition to fill the disk:

      ```bash theme={null}
      sudo growpart /dev/vdc 1
      ```

      If you work with a disk that has a device name other than `/dev/vdc`, change the device name and the partition index `1` in the current command and commands below. You can get the index of the partition from its name. Only the last partition may be grown.

      <Note>
        In the commands, you can use the device ID of the disk (`/dev/disk/by-id/virtio-disk-0`) instead of the device name (`/dev/vdc`). Run the `ls /dev/disk/by-id` command to get device IDs for all disks.
      </Note>

   6. Refresh the kernel partition table for the disk and wait for the device information to be updated:

      ```bash theme={null}
      sudo partprobe /dev/vdc && sudo udevadm settle
      ```

   7. Show information about partitions and check that the size of the partition has increased:

      ```bash theme={null}
      lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT /dev/vdc
      ```

      Output example:

      ```bash theme={null}
      NAME    SIZE  TYPE  FSTYPE  MOUNTPOINT
      vdc      25G  disk
      └─vdc1   25G  part  ext4    /mnt/disk-0
      ```

   8. Grow the `ext4` filesystem on the increased partition:

      ```bash theme={null}
      sudo resize2fs /dev/vdc1
      ```

   9. Check that the filesystem size has increased:

      ```bash theme={null}
      df -hT
      ```

      Output example:

      ```bash theme={null}
      Filesystem      Type       Size   Used  Avail  Use%  Mounted on
      tmpfs           tmpfs      795M   1.1M   794M    1%  /run
      /dev/vda1       ext4        38G   3.3G    35G    9%  /
      tmpfs           tmpfs      3.9G      0   3.9G    0%  /dev/shm
      tmpfs           tmpfs      5.0M      0   5.0M    0%  /run/lock
      cloud-metadata  virtiofs   252G    16K   252G    1%  /mnt/cloud-metadata
      /dev/vdc1       ext4        25G    24K    24G    1%  /mnt/disk-0
      /dev/vda16      ext4       881M   174M   645M   22%  /boot
      /dev/vda15      vfat       105M   6.2M    99M    6%  /boot/efi
      tmpfs           tmpfs      795M    12K   795M    1%  /run/user/1001
      ```

## How to enable or disable deletion protection

<Tabs>
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Disks** or <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Shared filesystems**.
    2. Click the volume you want to update and go to the **Settings** tab.
    3. In the **Parameters** section, enable or disable **Deletion protection**.
    4. Click **Save changes**.
  </Tab>

  <Tab title="CLI">
    1. If you haven't saved the disk or filesystem's ID when creating it, get its ID:

       ```bash theme={null}
       export DISK_ID=$(nebius compute disk get-by-name \
         --parent-id <project_ID> \
         --name <disk_name> \
         --format json | jq -r ".metadata.id")
       ```

       For a filesystem, use [nebius compute filesystem get-by-name](../../cli/reference/compute/filesystem/get-by-name) with the same parameters.

    2. Run [nebius compute disk update](../../cli/reference/compute/disk/update) for a disk, or [nebius compute filesystem update](../../cli/reference/compute/filesystem/update) for a filesystem:

       ```bash theme={null}
       nebius compute disk update \
         --id $DISK_ID \
         --forbid-deletion=<true|false>
       ```
  </Tab>
</Tabs>

<Note>
  If you try to delete a volume with deletion protection enabled, the operation will fail, and you'll see the following message: `Error: rpc error: code = FailedPrecondition desc = disk cannot be deleted because forbid_deletion is set`. Disable deletion protection first, then delete the volume.
</Note>

## How to delete a volume

<Warning>
  Deleting a volume permanently removes all data stored on it. Before deleting, make sure the volume is [detached](./detach-volume) from any virtual machine.
</Warning>

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Disks** or <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26" width="16" height="16" data-path="_assets/sidebar/storage.svg" /> **Storage** → **Shared filesystems**.
    2. Open the page of the volume that you want to delete.
    3. Go to the **Settings** tab.
    4. Click **Delete disk** or **Delete filesystem**.
    5. In the window that opens, confirm the deletion.
  </Tab>

  <Tab title="CLI">
    1. Get the ID of the volume you want to delete:

       ```bash theme={null}
       nebius compute <disk|filesystem> list
       ```

    2. Delete the disk:

       ```bash theme={null}
       nebius compute disk delete <disk_ID>
       ```

    3. Delete the filesystem:

       ```bash theme={null}
       nebius compute filesystem delete <filesystem_ID>
       ```
  </Tab>
</Tabs>

## See also

* [Types of storage volumes in Compute](./types)
* [Attaching and mounting Compute volumes to VMs](./use)
