You can expand the storage capacity of DeviceMapper if you find the disk space insufficient. This topic describes how to expand the storage capacity of DeviceMapper on a node that runs sandboxed containers.

Background information

DeviceMapper is used to store the root file systems (RootFS) of sandboxed containers. When you configure a worker node, you may find it difficult to estimate the data disk size that you need. Insufficient disk space limits the number of pods that can be created on the node.

DeviceMapper stores all RootFS of sandboxed containers on a node. It has the same storage capacity as the data disk of the node. Logical Volume Manager (LVM) is a tool for volume management. You can run LVM commands to expand the capacity of DeviceMapper.

  1. Log on to the ACK console.
  2. In the left-side navigation pane, click Clusters.
  3. Click the name of the target cluster. The Basic Information page appears. In the left-side navigation pane, click Nodes.
    Nodes page
  4. On the Nodes page, click the ID of the ECS instance that needs storage expansion. The Instance Details page appears. In the left-side navigation pane, click Disks.
  5. Find the disk that you want to expand and choose More > Resize Disk in the Actions column.

    The following example shows how to expand a disk from 200 GiB to 500 GiB.

    Expand a disk
  6. In the Resizing Method column, select the Resize Online check box, and then select the ECS Service Terms check box.
  7. After the expansion is complete, log on to the target node and run the lsblk command to check whether the expansion is successful.
    For more information about how to log on to an ECS instance, see Connection methods.
    As shown in the following figure, the capacity of disk vdb is now expanded from 200 GiB to 500 GiB. The capacity of the logical volume (LV) is still 191 GiB, among which 9 GiB is reserved for the volume group (VG) and for storing LVM metadata.result
  8. Run the following commands to expand the capacity of the logical volume.
    # pvresize ${disk path}  This command expands the PV. After the PV is expanded, the VG will be automatically expanded.
    pvresize /dev/vdb
    # lvextend  This command adjusts the capacity of the logical volume.
    lvextend -l +100%FREE vg0/mythinpool
    The data disk is now expanded to 500 GiB.resize