All Products
Search
Document Center

:Resizing a disk when an instance fails to start

Last Updated:Oct 31, 2025

If a Linux Elastic Compute Service (ECS) instance cannot start and has been diagnosed to have a disk with high inode or space usage, you can use the instance health diagnostics feature to perform troubleshooting.

Prerequisites

  • Instance Health Diagnostics has identified that a disk on the ECS instance has high inode or space usage.

  • The ECS instance and its resources meet the following conditions.

    Resource

    Conditions

    Instance

    • The instance is an I/O optimized instance.

    • The following instance types are not supported: ecs.ebmc4.8xlarge, ecs.ebmhfg5.2xlarge, and ecs.ebmg5.24xlarge.

    Disk

    • The disk is in the In Use state.

    • The disk is an enterprise SSD (ESSD), a standard SSD, or an ultra disk.

    • After you renew a subscription instance and downgrade its configurations, you cannot resizing the subscription disks of the instance for the remainder of the current billing cycle.

    • The new capacity of the disk cannot exceed the maximum capacity allowed for its category. For more information, see Limits of Elastic Block Storage.

    Important

    A disk that uses the Master Boot Record (MBR) partition format cannot be resized to 2 TiB or larger. To resizing an MBR disk to a capacity greater than 2 TiB, create a disk larger than 2 TiB, format it to use the GUID Partition Table (GPT), and then copy the data from the MBR disk to the new GPT disk. For more information about how to format a GPT partition, see Partition and format a data disk larger than 2 TiB.

Background

Problem description: A Linux instance cannot start because the inode or space usage of a disk on the instance is high.

Cause: The disk has insufficient capacity and must be resized.

Note

Run the df -Th command to check the space usage of the disk. Run the df -i command to check the inode usage of the disk.

You can use a repair disk provided by the instance health diagnostics feature or use an intermediate instance to resize the disk. For more information, see Use a repair disk to resize the disk or Use an intermediate instance to resize the disk.

Use a repair disk to resize the disk

You can use a repair disk provided by the instance health diagnostics feature to resize the abnormal disk of the instance.

  1. Create a snapshot of the target disk in the console. For more information, see Create a snapshot.

  2. Resizing the target disk in the console. For more information, see Expand the capacity of a disk.

  3. Connect to the faulty Linux ECS instance.

    When a repair disk is attached to the ECS instance, you can use only Virtual Network Computing (VNC) to connect to the instance. For more information, see Connect to an instance by using VNC.

  4. Run the following command to view the disks attached to the instance:

    fdisk -lu

    In the command output, find the device names of disks in the /dev/vd* format, such as /dev/vda, /dev/vdb, and /dev/vdc.

    The following figure shows an example of three partitions: the system disk partition (/dev/vda1) and two data disk partitions (/dev/vdb1 and /dev/vdc1).查看云盘分区情况

    No.

    Partition

    Description

    /dev/vda1

    The system disk, where System is a Linux partition, is an MBR partition.

    /dev/vdb1

    The data disk, where System is a Linux partition, is an MBR partition.

    /dev/vdc1

    The data disk, where System is a GPT partition, is a GPT partition.

    Note

    If the disk capacity shown in the command output has not increased, the resizing failed. For example, if a 40 GiB disk still shows a capacity of Disk /dev/vda: 42.9 GB, restart the instance in the ECS console.

  5. Run the following command to check the file system type of the existing partition.

    df -Th

    image

  6. Run the following command to resize a partition:

    growpart /dev/vda 1

    This example shows how to resize the system disk partition. A space is required between /dev/vda and 1. To resize other partitions, modify the command as needed. The following figure shows the command output.growpart

  7. On the ECS instance, resizing the file system based on the file system type.

    • To resize an ext* file system, such as ext4, run the following command:

      Resizing the file system of the system disk partition /dev/vda1.

      resize2fs /dev/vda1    

      Resizing the file system of the data disk partition /dev/vdb1.

      resize2fs /dev/vdb1          
      Note

      /dev/vda1 and /dev/vdb1 are partition names. Modify them as needed.

    • To resize an xfs file system, run the following command to resize the file system of the data disk partition /dev/vdc1.

      xfs_growfs /media/vdc
      Note

      /media/vdc is the mount point of /dev/vdc1. Modify it as needed.

    • To resize a btrfs file system, run the following command:

      btrfs filesystem resize max /mountpoint
      Note

      /mountpoint is the mount point of the data disk. Modify it as needed.

  8. Run the following command to check the resizing result.

    df -Th

    The following figure shows the command output.

    查看扩容结果

    After the resizing is complete, verify that your data is intact.

    • If the resizing is successful and the applications on the ECS instance run as expected, the process is complete.

    • If the resizing fails, use the snapshot that you created to restore the disk.

  9. After the disk is resized, exit the repair environment and check the state of the instance.

    1. Go to the Instance Health Diagnosis tab of the Troubleshooting page in the ECS console to detach the repair disk and start the instance.

    2. Connect to the instance and view the capacity of the resized disk.

Use an intermediate instance to resize the disk

Alternatively, you can detach the abnormal disk from the Linux instance, select another Linux instance within the same region as an intermediate instance, and then attach the disk to the intermediate instance.

  1. Detach the abnormal disk from the Linux instance. For more information, see Detach the system disk or Detach a data disk.

  2. Attach the disk to an intermediate Linux instance. For more information, see Attach a data disk.

  3. Resizing the disk on the intermediate instance. For more information, see Expand the capacity of a disk.

  4. After the disk is resized, detach it from the intermediate Linux instance. For more information, see Detach a data disk.

  5. Attach the disk back to the original Linux instance. For more information, see Detach or attach a system disk or Attach a data disk.

  6. Connect to the instance and view the capacity of the resized disk.