Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Updating a disk
      • Configuring disk snapshot schedules
      • Moving a disk to a different folder
      • Moving a disk to a different availability zone
      • Encrypting a disk
      • Getting information about a disk
      • Configuring disk access permissions
      • Deleting a disk
    • Viewing operations with resources
  • Yandex Container Solution
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Changing the disk name and description
  • Increasing the disk size
  • Increasing the size of a Linux disk partition
  1. Step-by-step guides
  2. Managing a disk
  3. Updating a disk

Updating a disk

Written by
Yandex Cloud
Updated at May 5, 2025
  • Changing the disk name and description
  • Increasing the disk size
  • Increasing the size of a Linux disk partition

After creating a disk, you can:

  • Change the disk name and description.
  • Increase the size of your disk, even if it is attached to a running VM.

Changing the disk name and descriptionChanging the disk name and description

To change the name and description of a disk:

Management console
CLI
API
  1. In the management console, select the folder where you want to update a disk.
  2. In the list of services, select Compute Cloud.
  3. In the left-hand panel, select Disks.
  4. Click next to the disk and select Edit.
  5. Edit the disk name and description.
  6. Click Save changes.

Compute Cloud will initiate disk updating.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for updating a disk:

    yc compute disk update --help
    
  2. Request a list of available disks:

    yc compute disk list
    

    Result:

    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    |          ID          |     NAME     |    SIZE     |       ZONE        | STATUS |     INSTANCE IDS     | PLACEMENT GROUP | DESCRIPTION |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    | a7lqgbt0bb9s******** | first-disk   | 20401094656 |   ru-central1-a   | READY  | a7lcvu28njbh******** |                 |             |
    | a7lv5j5hm1p1******** | second-disk  | 21474836480 |   ru-central1-a   | READY  |                      |                 |             |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    
  3. Select ID or NAME of the disk, e.g., first-disk.

  4. Specify the name and description in the disk update command:

    yc compute disk update first-disk \
      --new-name updated-disk \
      --description "Updated disk via CLI"
    

    Compute Cloud will initiate disk updating.

To change the name or description of a disk, use the update REST API method for the Disk resource or the DiskService/Update gRPC API call.

To request a list of available disks, use the list REST API method or the DiskService/List gRPC API call.

Increasing the disk sizeIncreasing the disk size

Note

You can only increase the size of a disk. Reducing it is not supported.

You can increase the disk size even on a running VM.

Management console
CLI
Terraform
API
  1. In the management console, select the folder containing the disk.

  2. In the list of services, select Compute Cloud.

  3. In the left-hand panel, select Disks.

  4. Click next to the disk and select Edit.

  5. Increase the disk size.

  6. Click Save changes.

    Compute Cloud will initiate disk resizing.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for updating a disk:

    yc compute disk update --help
    
  2. Request a list of available disks:

    yc compute disk list
    

    Result:

    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    |          ID          |     NAME     |    SIZE     |       ZONE        | STATUS |     INSTANCE IDS     | PLACEMENT GROUP | DESCRIPTION |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    | a7lqgbt0bb9s******** | first-disk   | 20401094656 |   ru-central1-a   | READY  | a7lcvu28njbh******** |                 |             |
    | a7lv5j5hm1p1******** | second-disk  | 21474836480 |   ru-central1-a   | READY  |                      |                 |             |
    +----------------------+--------------+-------------+-------------------+--------+----------------------+-----------------+-------------+
    
  3. Select ID or NAME of the disk, e.g., first-disk.

  4. Specify the size, e.g., 32 GB, in the disk update command:

    yc compute disk update first-disk \
      --size 32
    

    Compute Cloud will initiate disk resizing.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

Warning

You can increase the disk size using Terraform without recreating the VM if the disk is specified in the manifest as a separate yandex_compute_disk resource.

If the disk is specified under initialize_params in the yandex_compute_instance resource, the VM will be recreated when increasing the disk size using Terraform. To increase the size of such a disk without recreating the VM, use the management console, CLI, or API.

  1. In the Terraform configuration file, define the parameters of the resources you want to create:

    # Creating a disk
    
    resource "yandex_compute_disk" "first-disk" {
      name     = "<disk_name>"
      type     = "<disk_type>"
      zone     = "<availability_zone>"
      size     = "<disk_size>"
      image_id = "<image_ID>"
    }
    
    # Creating a VM
    
    resource "yandex_compute_instance" "vm-lamp" {
      name        = "<VM_name>"
      platform_id = "standard-v3"
      zone        = "<availability_zone>"
    
      resources {
        core_fraction = <vCPU_performance_level>
        cores         = <number_of_vCPUs>
        memory        = <RAM_in_GB>
      }
    
      boot_disk {
        disk_id = yandex_compute_disk.first-disk.id
      }
    
      network_interface {
        subnet_id          = "<subnet_ID>"
        nat                = true
        security_group_ids = [<security_group_ID>]
      }
    
      metadata = {
        user-data = "#cloud-config\nusers:\n  - name: <username>\n    groups: sudo\n    shell: /bin/bash\n    sudo: 'ALL=        (ALL) NOPASSWD:ALL'\n    ssh_authorized_keys:\n      - <SSH_key_contents>"
      }
    }
    
  2. Create the resources:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

  3. To increase the disk size, make the following changes to the configuration file:

    resource "yandex_compute_disk" "first-disk" {
      ...
      size = "<new_disk_size>"
    }
    

    Where size is the new size for the disk.

  4. Apply the changes:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

    This will increase the disk size. You can check the disk size and settings using the management console or this CLI command:

    yc compute disk get <disk_name>
    

You can increase the disk size by using the update REST API method for the Disk resource or the DiskService/Update gRPC API call.

To request a list of available disks, use the list REST API method or the DiskService/List gRPC API call.

To change the size of the boot disk, restart the VM.

Increasing the size of a Linux disk partitionIncreasing the size of a Linux disk partition

After increasing the disk size, you also need to increase the size of its partitions and file systems. For boot disks, this happens automatically after you restart the VM.

You can also increase the size of any VM disk without restarting the VM. The workflow depends on the file system of the disk partition in question:

ext4
xfs
  1. Connect to the VM over SSH:

    ssh <username>@<VM_public_IP_address>
    
  2. See the disks attached to the VM:

    lsblk
    

    Result:

    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    vda    252:0    0  25G  0 disk
    ├─vda1 252:1    0   1M  0 part
    └─vda2 252:2    0  25G  0 part /
    vdb    252:16   0  64G  0 disk
    └─vdb1 252:17   0  32G  0 part /data
    

    Disk partitions are listed under NAME. If the MOUNTPOINTS column contains a value for the partition you need, it means the partition is mounted.

  3. (Optional) Check and recover the file system.

    Note

    Skip this step if you want to increase the root partition.

    1. Unmount the disk:

      sudo umount /data
      

      Where /data is the partition mount point.

    2. Check and recover the file system:

      sudo e2fsck -f /dev/vdb1
      

      Result:

      e2fsck 1.44.1 (24-Mar-2018)
      Pass 1: Checking inodes, blocks, and sizes
      Pass 2: Checking directory structure
      Pass 3: Checking directory connectivity
      Pass 4: Checking reference counts
      Pass 5: Checking group summary information
      /dev/vdb1: 11/2097152 files (0.0% non-contiguous), 143890/8388352 blocks
      
  4. Resize the partition:

    sudo growpart /dev/vdb 1
    

    Where:

    • /dev/vdb: Device name.
    • 1: Partition number, which must be separated by a space.

    Result:

    CHANGED: partition=1 start=2048 old: size=67106816 end=67108864 new: size=134215647,end=134217695
    
  5. Resize the file system:

    sudo resize2fs /dev/vdb1
    

    Where dev/vdb1 is the partition name.

    Result:

    Resizing the filesystem on /dev/vdb1 to 16776955 (4k) blocks.
    The filesystem on /dev/vdb1 is now 16776955 (4k) blocks long.
    
  6. If you unmounted the partition to perform a file system check, remount it:

    sudo mount /dev/vdb1 /data
    
  7. Make sure the partition size has increased:

    lsblk
    

    Result:

    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    vda    252:0    0  25G  0 disk
    ├─vda1 252:1    0   1M  0 part
    └─vda2 252:2    0  25G  0 part /
    vdb    252:16   0  64G  0 disk
    └─vdb1 252:17   0  64G  0 part /data
    
  1. Connect to the VM over SSH:

    ssh <username>@<VM_public_IP_address>
    
  2. See the disks attached to the VM:

    lsblk
    

    Result:

    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    vda    252:0    0  25G  0 disk
    ├─vda1 252:1    0   1M  0 part
    └─vda2 252:2    0  25G  0 part /
    vdb    252:16   0  64G  0 disk
    └─vdb1 252:17   0  32G  0 part /data
    

    Disk partitions are listed under NAME. Partition mount points are displayed under MOUNTPOINTS.

  3. Run this command:

    sudo growpart /dev/vdb 1
    

    Where:

    • /dev/vdb: Device name.
    • 1: Partition number, which must be separated by a space.

    Result:

    CHANGED: partition=1 start=2048 old: size=67106816 end=67108864 new: size=134215647,end=134217695
    
  4. Change the file system size:

    sudo xfs_growfs /data -d
    

    Where:

    • /data: Mount point of the partition whose size you need to increase.
    • -d: Parameter for increasing partition size.

    Result:

    meta-data=/dev/vdb1              isize=512    agcount=4, agsize=655360 blks
             =                       sectsz=4096  attr=2, projid32bit=1
             =                       crc=1        finobt=1, sparse=1, rmapbt=0
             =                       reflink=1    bigtime=0 inobtcount=0
    data     =                       bsize=4096   blocks=2621440, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
    log      =internal log           bsize=4096   blocks=2560, version=2
             =                       sectsz=4096  sunit=1 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    data blocks changed from 2621440 to 11796219
    
  5. Make sure the partition size has increased:

    lsblk /dev/vdb
    

    Result:

    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    vdb    252:16   0  64G  0 disk
    └─vdb1 252:17   0  64G  0 part /data
    

Was the article helpful?

Previous
Recovering a disk from an image
Next
Configuring disk snapshot schedules
© 2025 Direct Cursus Technology L.L.C.