Skip to main content

Create and manage volume

The following describes how to manage volumes and snapshots attached to VM instances in the Virtual Machine service.

Create volume

You can create a new volume.

  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.

  2. Select the Volume menu, then click the [Create volume] button.

  3. In the pop-up window, enter the information, then click the [Create] button.
    Image. Create volume Create volume

    CategoryDescription
    NameEnter the name of the volume
    DescriptionDescription of the volume
    TypeType of the volume
    - Only the SSD type is supported
    SizeSize of the volume
    - Linux family: Can be created with a size from 1 to 16,384 GB
    - Windows family: Can be created with a size from 1 to 2,048 GB
    Maximum IOPSMaximum IOPS based on the configured volume size
    - 3,000 IOPS to 16,000 IOPS
    Availability zoneAvailability zone where the volume will be created

View volume list and basic information

You can view the list of running volumes and the basic information of each volume.

  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.

  2. In the Volume menu, check the list of currently running volumes.

    Image Volume list

    CategoryDescription
    NameName of the volume
    IDUnique ID of the volume
    StatusStatus of the volume
    - For more information about volume status, see Volume states
    Connected instanceConnected instance
    - Click the instance name to go to the detail page of that instance
    Mount pointConnected mount point
    TypeType of the volume
    SizeSize of the volume
    Snapshot schedule IDSnapshot schedule ID connected to the volume
    Availability zoneAvailability zone where the volume was created
    Created atDate and time when the volume was created

View volume details

You can check and manage detailed information of the volume and snapshot information created from the selected volume.

  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.
  2. In the Volume menu, select the volume for which you want to view detailed information.
  3. Check the information on the volume detail page.

View volume by instance

You can check the volume information connected to an instance.

  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.
  2. In the Instance menu, select the instance for which you want to check volume information.
  3. In the Volume tab of the instance detail page, check the volume information of that instance.

Modify volume

You can modify the settings of a volume.

  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.
  2. In the Volume menu, select [⋮] button > Modify for the volume you want to modify.
    • When modifying the volume size, only a value larger than the existing volume size can be entered in 1GB units. After expanding the volume size, refer to Extend file system to update the size of the file system.
  3. Configure the volume in the pop-up window, then click the [Modify] button.

Attach volume

A newly created volume is in the Available state and is not connected to an instance. To use the volume properly, you must attach the volume to the instance in the console and then connect the volume as a device according to the guide for each operating system.

Attach from console

The following describes how to attach a volume to an instance.

  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.
  2. In the Volume menu, select [⋮] button > Attach for the volume to attach to the instance.
  3. In the pop-up window, enter the information, then click the [Save] button.
caution
  • The number of resources that can be attached to a single instance, such as network interfaces, volumes, and GPUs, is limited and cannot exceed that number. The total number of attachable resources differs by instance family. If attaching an additional network interface or volume fails, reduce the number of attached resources and try again.
info

When attaching a volume to an instance, if you enable the Delete with instance option, the connected volume can also be deleted when the instance is deleted.

Attach volume on linux

In a Linux environment, access the instance through SSH and configure the file system and mount point.

  1. You can use the lsblk command to check whether the volume attached in the console is correctly connected as a device.

    • Example: Run the lsblk command and check that the newly created 8G volume is connected as /dev/vdb.
    lsblk command (check device attachment)
    ubuntu@volume-attach-1:~$ lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda 252:0 0 20G 0 disk /boot
    vdb 252:16 0 8G 0 disk
  2. Use the file -s command to check the file system type. If data is output, the device does not have a file system.

    file -s command (check file system type)
    ubuntu@volume-attach-1:~$ sudo file -s /dev/vdb
    /dev/vdb: data
  3. If there is no file system, use the mkfs -t command to create a file system.

    mkfs -t command (when there is no file system)
    ubuntu@volume-attach-1:~$ sudo mkfs -t xfs /dev/vdb
    meta-data=/dev/vdb isize=512 agcount=4, agsize=65536 blks
    = sectsz=512 attr=2, projid32bit=1
    = crc=1 finobt=1, sparse=1, rmapbt=0
    = reflink=1
    data = bsize=4096 blocks=262144, 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=512 sunit=0 blks, lazy-count=1
    realtime =none extsz=4096 blocks=0, rtextents=0
  4. Check that the file system was created successfully.

    file -s command (check file system creation)
    ubuntu@volume-attach-1:~$ sudo file -s /dev/vdb
    /dev/vdb: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
  5. Use the mkdir command to create a mount point directory for the volume.

    • The mount point is the location where files are read and written after the volume is mounted.
    mkdir command (create mount point directory)
    ubuntu@volume-attach-1:~$ sudo mkdir -p /data/vdb
  6. Use the mount command to connect the directory created in the previous step and the volume.

    mount command (connect directory and volume)
    ubuntu@volume-attach-1:~$ sudo mount /dev/vdb /data/vdb
  7. Use the lsblk command to check whether the file system and mount point have been applied correctly.

    lsblk command (check file system and mount point application)
    ubuntu@volume-attach-1:~$ sudo lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda 252:0 0 20G 0 disk /boot
    vdb 252:16 0 8G 0 disk /data/vdb
  8. To keep the connected volume after a system reboot, first check the UUID of the device.

    lsblk command (check UUID of device)
    ubuntu@volume-attach-1:~$ lsblk -o +UUID
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT UUID
    vda 252:0 0 20G 0 disk /boot 876da551-d737-4350-9cd9-bb3fc9069bff
    vdb 252:16 0 1G 0 disk /data/vdb 2d332f0b-1771-4b83-bd5c-7e9d1cc91ed2
  9. Use the checked UUID to add the following content to the /etc/fstab file.

    Keep connected volume after system reboot
    UUID=2d332f0b-1771-4b83-bd5c-7e9d1cc91ed2 /data/vdb  xfs  defaults,nofail  0  2

Attach volume on linux(xfs)

For instances created with OS images that use the xfs file system, such as CentOS Stream 8 and Rocky Linux 8, after creating and restoring a snapshot of the root volume, a problem may occur where the restored snapshot cannot be attached to the same instance because of duplicate UUIDs. To use the volume normally, proceed with the following steps.

  1. First mount the file system by using the nouuid option.

    • If you use it temporarily, this procedure alone can resolve the issue.
    mount command (mount and nouuid option)
    [centos@centos-stream-8 test]$ sudo mount -t xfs -o nouuid /dev/vdb1 /home/centos/test
  2. Unmount it.

    umount command (unmount)
    [centos@centos-stream-8 test]$ sudo umount /dev/vdb1
  3. Regenerate the UUID.

    • For a permanent solution, you must proceed to this step.
    xfs_admin command (regenerate uuid)
    [centos@centos-stream-8 test]$ sudo xfs_admin -U generate /dev/vdb1
    Clearing log and setting UUID
    writing all SBs
    new UUID = ff714d9b-8c90-40e2-9e2f-12623220e1cf
  4. Set the newly generated UUID on the restored snapshot volume.

    xfs_admin command (update UUID)
    [centos@centos-stream-8 test]$ sudo xfs_admin -U ff714d9b-8c90-40e2-9e2f-12623220e1cf /dev/vdb1
    Clearing log and setting UUID
    writing all SBs
    new UUID = ff714d9b-8c90-40e2-9e2f-12623220e1cf
  5. Mount the restored snapshot again to the instance mount point.

    mount command (remount)
    [centos@centos-stream-8 test]$ sudo mount /dev/vdb1 /home/centos/test

Attach on windows

In a Windows environment, connect to the instance through Remote Desktop, then initialize the disk and assign the volume.

  1. Enter Start > Run or press the WIN + R shortcut.

  2. In the Run window, enter diskmgmt.msc, then click the [Confirm] button or press Enter.

  3. In Disk Management, select the newly added disk, then right-click it and select Online to switch it online. Image. Windows 1 Switch to online

  4. Select the newly added disk, right-click it, then select Initialize disk. When selected, the Initialize disk pop-up window appears.

    Image. Windows 2 Initialize disk

  5. Check the newly added disk, select the GPT partition table, then click the [Confirm] button.

    • To connect a disk larger than 2TB, you must select the GPT partition table.

    Image. Windows 3 Select GPT partition table

  6. Select the initialized disk, right-click it, then select New simple volume. When selected, the New simple volume wizard pop-up window appears. Image. Windows 4 New simple volume

  7. Run the New simple volume wizard. Image. Windows 5 New simple volume wizard

  8. In the New simple volume wizard, follow the instructions to select volume size, drive letter assignment, and format options, then finish to complete the volume attachment. Image. Windows 6 Complete new simple volume wizard

Detach volume

You can detach a volume that is no longer in use.

info
  • The root volume used as the OS area in an instance cannot be detached.
  • If you attempt to detach a volume while the instance is in the running (Active) state, you must first unmount that volume from the instance before proceeding. For safe volume detachment, it is recommended to stop the instance and then detach the volume.
  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.
  2. In Volume tab > Volume list, select [⋮] button > Detach for the volume to detach.
  3. In the pop-up window, check the volume and instance to detach, then click the [Detach] button.

Expand volume

You can expand the size of a volume.

info
  • After expanding the volume size, you must also expand the file system size by using file system-related commands.
     ㄴ You can start file system expansion after the volume status changes to Extending.
  • To apply the new volume QoS after expanding the volume size, the following actions are required depending on the volume type.
     ㄴ For a root volume, perform instance Shelve and then instance Start (unshelve).
     ㄴ For an additional volume, perform volume Detach and then volume Attach.
  1. Go to Compute > Beyond Compute Service > Virtual Machine in the KakaoCloud console.
  2. Click the Volume menu, then select [⋮] button > Modify volume for the volume to expand.
  3. In the pop-up window, enter the size to expand in Size, then click the [Save] button.

Extend file system

To store data in the additional disk space after expanding the volume size, the user must directly access the instance and update the size of the file system and partition. After the user expands the size of the volume, the process of expanding the file system size by using file system and partition-related commands in the instance is as follows. However, the required procedure may differ depending on the file system and partition configuration of the user instance.

The partition table format and file system type by OS provided by KakaoCloud are as follows.

OS nameVersionRoot volume partition table formatFile system
Ubuntu20.04GPT              ext4
Ubuntu22.04GPText4
Ubuntu24.04GPText4
CentOS Stream9MBRxfs
Rocky Linux8.10MBRxfs
Rocky Linux9.4MBRxfs
Alma Linux8.10GPTxfs
Alma Linux9.4GPTxfs
Windows2019MBRntfs
Windows2022MBRntfs
info

Even if you change the file system or partition, the data in the volume is not modified or deleted. However, before changing the file system and partition, it is recommended to back up volumes storing important data so that changes can be reverted if necessary.

The following is the system expansion procedure that can be applied to ext4 and xfs, the most widely used Linux file systems. In the following Linux example, if there is an instance with a 50GB root volume created in advance by the user, it explains how to expand the volume, increase the root volume of the instance to 80GB, and then expand the partition and file system.

Step 1. Connect instance

In the terminal, run instance connection by using the ssh command. For more information about the connection process, see Create and connect instance.

Step 2. Check partition and file system information

  1. Use the lsblk and df commands to check the partition and file system information to expand.

    • Example: Looking at the partition information before expanding the volume, you can check that the 50G root volume is connected with the device name /dev/vda, and the 30G non-root volume is connected as /dev/vdb. The root volume device /dev/vda has a 50G partition named vda1.
    lsblk command (before volume expansion)
    ubuntu@volume-test:~$ sudo lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda 252:0 0 50G 0 disk
    ├─vda1 252:1 0 49.9G 0 part /
    ├─vda14 252:14 0 4M 0 part
    └─vda15 252:15 0 106M 0 part /boot/efi
    vdb 252:16 0 30G 0 disk /data
  2. After expanding the size of the root volume, run the lsblk command to check the expanded root volume.

    • Example: After expanding the size of the root volume to 80G and running the lsblk command, you can check that the size of the /dev/vda device has expanded to 80G, but the size of the vda1 partition remains unchanged at 50G.
    lsblk command (after volume expansion)
    ubuntu@volume-test:~$ sudo lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda 252:0 0 80G 0 disk
    ├─vda1 252:1 0 49.9G 0 part /
    ├─vda14 252:14 0 4M 0 part
    └─vda15 252:15 0 106M 0 part /boot/efi
    vdb 252:16 0 30G 0 disk /data
  3. If you run the df command, you can check the file system type of the volumes connected to the instance.

    • Example: You can check that the size of the /dev/vda1 partition is still 50G and that it uses ext4.
    df command
    ubuntu@volume-test:~$ sudo df -Th
    Filesystem Type Size Used Avail Use% Mounted on
    ...
    /dev/vda1 ext4 49G 1.5G 47G 3% /
    ...
    /dev/vdb ext4 30G 45M 28G 1% /data

Step 3. Expand partition

  1. Use the growpart command to expand the partition size to the maximum size.
    • Example: Run the growpart command to expand the vda1 partition size.
    Expand partition size
    ubuntu@volume-test:~$ sudo growpart /dev/vda 1
  2. After expansion, run the lsblk command to check the size of the expanded partition.
    • Example: After expansion, run the lsblk command and check that the vda1 partition size has been expanded to 80G.
    Check after partition expansion
    ubuntu@volume-test:~$ lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda 252:0 0 80G 0 disk
    ├─vda1 252:1 0 79.9G 0 part /

Step 4. Extend file system

You can store data in the expanded space by extending the file system.
The command differs depending on the file system type.

  1. If you use ext4, use the resize2fs command. If you use xfs, use the xfs_growfs command.

    sudo resize2fs /dev/vda1
  2. Check the expanded file system with the df command. After completing file system expansion, you can store data in the additional disk space without restarting the instance.

    • Run the df command and check that the /dev/vda1 file system has been expanded to 80G.
    df command (after file system expansion)
    ubuntu@volume-test:~$ df -Th
    Filesystem Type Size Used Avail Use% Mounted on
    /dev/vda1 ext4 78G 1.6G 76G 2% /
    ...
    /dev/vdb ext4 30G 45M 28G 1% /data
    ...

Delete volume

You can delete a volume that is no longer in use.

  1. Go to KakaoCloud console > Compute > Beyond Compute Service > Virtual Machine.
  2. Select the Volume menu, then click the [Delete volume] button located at the top right.
  3. In the pop-up window, enter the information, then click the [Delete] button.
caution
  • Deleted volumes cannot be recovered.
  • If you enable the Delete with instance option when attaching a volume to an instance, the connected volume is also deleted when the instance is deleted.