Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Compute Cloud
  • Getting started
    • Overview
    • Creating a Linux VM
    • Creating a Windows VM
    • Creating instance groups
  • Step-by-step instructions
    • All instructions
    • Creating VMs
      • Creating a Linux VM
      • Creating a Windows VM
      • Creating a VM from a set of disks
      • Creating a VM with disks from snapshots
      • Creating a VM from a custom image
      • Creating a VM with a GPU
      • Making a VM preemptible
    • DSVM
      • Overview
      • Creating a VM from a public DSVM image
    • Placement groups
      • Creating a placement group
      • Deleting a placement group
      • Creating a VM in a placement group
      • Adding a VM to a placement group
      • Removing a VM from a placement group
    • Images with pre-installed software
      • Creating a VM from a public image
      • Configuring software
      • Running a VM based on a public image
      • Getting a list of public images
    • Getting information about a VM
      • Getting information about a VM
      • Getting serial port's output
    • Managing VMs
      • Stopping and starting a VM
      • Attaching a disk to a VM
      • Detaching a disk from a VM
      • Moving a VM to a different availability zone
      • Moving a VM to another folder
      • Attaching a public IP address to a VM
      • Detaching a public IP address from a VM
      • Making a VM's public IP address static
      • Updating a VM
      • Changing VM computing resources
      • Deleting a VM
    • Working on VMs
      • Connecting to a VM via SSH
      • Connecting to a VM via RDP
      • Connecting to a VM via PowerShell
      • Working with Yandex Cloud from inside a VM
      • Installing NVIDIA drivers
      • Restoring access to a VM
    • Creating new disks
      • Creating an empty disk
      • Creating an empty disk with a large block
      • Creating a non-replicated disk
    • Disk management
      • Creating a disk snapshot
      • Updating a disk
      • Moving a disk to another folder
      • Deleting a disk
      • Deleting a disk snapshot
    • Disk placement groups
      • Creating a disk placement group
      • Removing a disk from a placement group
    • Creating new images
      • Preparing a disk image
      • Uploading your image
      • Creating an image from a disk
      • Creating an image from a snapshot
      • Creating an image from other custom image
    • Managing images
      • Getting a list of images
      • Deleting a disk image
    • File storage
      • Creating file storage
      • Attaching file storage to a VM
      • Detaching file storage from a VM
      • Updating file storage
      • Deleting file storage
    • Managing the serial console
      • Getting started
      • Connecting to a serial console via SSH
      • Connecting to a serial console via CLI
      • Starting your terminal in the Windows serial console (SAC)
      • Disabling access to the serial console
    • Creating instance groups
      • Creating a fixed-size instance group
      • Creating a fixed-size instance group with a network load balancer
      • Creating a fixed-size instance group with an L7 load balancer
      • Creating an automatically scaled instance group
      • Creating an instance group from a Container Optimized Image
      • Creating an instance group based on the YAML specification
    • Getting information about instance groups
      • Getting a list of instance groups
      • Getting information about an instance group
      • Getting a list of instances in a group
    • Managing instance groups
      • Editing an instance group
      • Edit an instance group based on the YAML specification
      • Configuring application health check on the VM
      • Updating a group
        • Incremental update
        • Uninterrupted updates
      • Pausing an instance group
      • Resuming an instance group
      • Stopping an instance group
      • Starting an instance group
      • Deleting an instance group
    • Dedicated hosts
      • Creating a VM in a group of dedicated hosts
      • Creating a VM on a dedicated host
  • Yandex Container Solution
  • Practical guidelines
    • Configuring NTP time synchronization
    • Running instance groups with auto scaling
    • Automatically scaling an instance group for handling messages from a queue
    • Updating an instance group under load
    • Deploying Remote Desktop Gateway
    • Transferring logs from a VM instance to Yandex Cloud Logging
  • Concepts
    • Relationship between resources
    • Virtual machines
      • Overview
      • Platforms
      • vCPU performance levels
      • Preemptible VMs
      • Network on a VM
      • Software-accelerated network
      • Live migration
      • Placement groups
      • Statuses
      • Metadata
    • Graphics accelerators
    • Disks and file storage
      • Overview
      • Disks
      • Disk snapshots
      • Non-replicated disk placement groups
      • File storage
      • Read and write operations
    • Images
    • Instance groups
      • Overview
      • Access
      • YAML specification
      • Instance template
      • Variables in an instance template
      • Policies
        • Overview
        • Allocation policy
        • Deployment policy
        • Scaling policy
      • Scaling types
      • Auto-healing
      • Updating
        • Overview
        • Allocating instances across zones
        • Deployment algorithm
        • Rules for updating virtual machines
        • Changing secondary disks in an instance template
      • Stopping and pausing an instance group
      • Statuses
    • Dedicated host
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1 to May 1, 2019
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • DiskPlacementGroupService
      • DiskService
      • DiskTypeService
      • FilesystemService
      • HostGroupService
      • HostTypeService
      • ImageService
      • InstanceService
      • PlacementGroupService
      • SnapshotService
      • ZoneService
      • InstanceGroupService
      • OperationService
    • REST
      • Overview
      • DiskPlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listDisks
        • listOperations
        • update
      • Disk
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • DiskType
        • Overview
        • get
        • list
      • Filesystem
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • HostGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listHosts
        • listInstances
        • listOperations
        • update
      • HostType
        • Overview
        • get
        • list
      • Image
        • Overview
        • create
        • delete
        • get
        • getLatestByFamily
        • list
        • listOperations
        • update
      • Instance
        • Overview
        • addOneToOneNat
        • attachDisk
        • attachFilesystem
        • create
        • delete
        • detachDisk
        • detachFilesystem
        • get
        • getSerialPortOutput
        • list
        • listOperations
        • move
        • removeOneToOneNat
        • restart
        • start
        • stop
        • update
        • updateMetadata
        • updateNetworkInterface
      • PlacementGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listInstances
        • listOperations
        • update
      • Snapshot
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • update
      • Zone
        • Overview
        • get
        • list
      • Operation
        • Overview
        • get
      • InstanceGroup
        • Overview
        • list
        • get
        • listLogRecords
        • updateFromYaml
        • updateAccessBindings
        • pauseProcesses
        • stop
        • start
        • delete
        • listInstances
        • createFromYaml
        • update
        • setAccessBindings
        • listOperations
        • create
        • listAccessBindings
        • resumeProcesses
  • Questions and answers
    • General questions
    • Virtual machines
    • Connection
    • Disks, snapshots, and images
    • Disaster recovery
    • Monitoring
    • Licensing
    • All questions on the same page
  1. Step-by-step instructions
  2. Disk management
  3. Updating a disk

Updating a disk

Written by
Yandex Cloud
  • Changing the name and description of a disk
  • Increasing a disk's size
  • Increasing a partition

After you create a disk, you can:

  • Changing the name and description of a disk.
  • Increase disk size (available only on a stopped virtual machine).

Changing the name and description of a disk

To change the name and description of a disk:

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

Compute Cloud will start the operation to update the disk.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. View the description of the CLI's disk change command:

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

    yc compute disk list
    

    Result:

    +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
    |          ID          |     NAME     |    SIZE     |     ZONE      | STATUS |     INSTANCE IDS     |       DESCRIPTION       |
    +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
    | a7lqgbt0bb9s40tifuhc | first-disk   | 20401094656 | ru-central1-a | READY  | a7lcvu28njbhnkcteb5n |                         |
    | a7lv5j5hm1p1hppprga7 | second-disk  | 21474836480 | ru-central1-a | READY  |                      |                         |
    +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
    
  3. Select the ID or NAME of the required disk (for example, first-disk).

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

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

    Compute Cloud will start the operation to update the disk.

You can change a disk name and description with the API update method for the Disk resource.

Use the list method for the Disk resource to retrieve a list of available disks.

Increasing a disk's size

Note

You can only change the size of a disk by increasing it. You cannot reduce the size of a disk.

You can only increase the size of a disk that is not attached to a running VM. To increase the disk size, make sure that the VM is stopped.

Management console
CLI
API
  1. In the management console, select the folder where the disk is located.
  2. In the list of services, select Yandex Compute Cloud.
  3. On the Virtual machines page, stop the virtual machine (see Stop).
  4. Wait until the VM status changes to STOPPED.
  5. On the left-hand panel, select Disks.
  6. Click next to the desired disk and select Edit.
  7. Increase the disk size.
  8. Click Save changes.
    Compute Cloud will start the operation to change the disk size.
  9. When the operation finishes, go back to the Virtual machines page and restart the VM.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. View the description of the CLI's disk change command:

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

    yc compute disk list
    

    Result:

    +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
    |          ID          |     NAME     |    SIZE     |     ZONE      | STATUS |     INSTANCE IDS     |       DESCRIPTION       |
    +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
    | a7lqgbt0bb9s40tifuhc | first-disk   | 20401094656 | ru-central1-a | READY  | a7lcvu28njbhnkcteb5n |                         |
    | a7lv5j5hm1p1hppprga7 | second-disk  | 21474836480 | ru-central1-a | READY  |                      |                         |
    +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
    
  3. Stop the VM with the disk you want to update. To do this, select the ID of the VM:

    yc compute instance stop --id a7lcvu28njbhnkcteb5n
    
  4. Select the ID or NAME of the required disk (for example, first-disk).

  5. Specify the size (for example, 32 GB) in the disk change command:

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

    Compute Cloud will launch the operation to change the disk size.

  6. Run the VM:

    yc compute instance start --id a7lcvu28njbhnkcteb5n
    

You can increase the disk size by using the API update method for the Disk resource.

Use the list method for the Disk resource to retrieve a list of available disks.

To stop or start a VM, use the stop and start methods for the Instance resource.

Increasing a partition

After increasing the disk size, you also need to increase its partition and file system. For boot disks, this should be done automatically.

If the disk partition doesn't increase or you're increasing the size of a non-boot disk, do this manually:

Linux
Windows
  1. Connect to the VM via SSH:

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

    lsblk
    

    Command output:

    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    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
    

    Disk partitions are listed in the NAME column.

  3. Check and restore the file system:

    sudo e2fsck -f /dev/vdb1
    

    Command output:

    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. Change the partition size:

    sudo growpart /dev/vdb 1
    

    Where:

    • /dev/vdb is the name of the device.
    • 1 is the partition number, so it's separated by a space.

    Command output:

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

    sudo resize2fs /dev/vdb1
    

    Where:

    • dev/vdb1 is the name of the partition.

    Command output:

    Resizing the filesystem on /dev/vdb1 to 16776955 (4k) blocks.
    The filesystem on /dev/vdb1 is now 16776955 (4k) blocks long.
    
  6. Make sure that the partition increased:

    lsblk
    

    Command output:

    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    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
    
  1. Connect to the Windows VM using RDP.

  2. In the search bar, type diskmgmt.msc to perform a search by system and start the found snap-in.

  3. In the Disk Management window that opens, select the desired disk. Open the context menu and select Extend volume...

  4. Enter a new partition volume and confirm the action.

  5. Make sure that the partition increased.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • Changing the name and description of a disk
  • Increasing a disk's size
  • Increasing a partition