All Products
Search
Document Center

Simple Application Server:Extend a data disk

Last Updated:Jan 30, 2024

You can extend a data disk if the available space of the data disk on your simple application server is insufficient to meet your business requirements. This topic describes how to extend a data disk on a simple application server.

Prerequisites

A data disk is mounted to your simple application server. The data disk is partitioned and formatted. For more information, see Attach a data disk and Partition and format a data disk.

Step 1: Create a snapshot

Warning

Extending a data disk may cause data loss. We recommend that you create a snapshot for a data disk to back up the data before you extend the data disk.

  1. Log on to the Simple Application Server console.

  2. In the left-side navigation pane, click Servers.

  3. On the Servers page, find the server for which you want to create a snapshot and click the server ID in the server card.

  4. Click the Disk tab.

  5. Click Create Snapshot in the Actions column of the data disk.

  6. In the Create Snapshot dialog box, check the disk information, enter a name for the snapshot, and then click Confirm.

Step 2: Extend the data disk

  1. Log on to the Simple Application Server console.

  2. In the left-side navigation pane, click Servers.

  3. Click the server ID in the card of the server whose data disk you want to extend.

  4. Click the Disk tab.

  5. In the upper-left corner of the page that appears, click Extend Data Disk.

  6. In the Precautions dialog box, read the precautions and click Data Disk Operations.

  7. Verify the current configurations and expiration time of the disk, and select a data disk size next to Data Disk.

    The data disk can be extended to up to 16,380 GB.

    Important

    Data disks can only be extended. The value of the selected data disk size must be greater than the value of the original data disk size.

  8. Select the relevant agreements and click Buy Now.

    Follow the on-screen instructions to pay the order.

  9. Connect to the simple application server to extend the partitions and file systems on the data disk.

Extend the partition and file system on the data disk of a Linux server

In this example, the data disk is extended from 40 GB to 60 GB.

Note

The default device name of the data disk on the simple application server is /dev/vdb.

  1. Connect to the Linux server.

    For more information, see Connect to a Linux server.

  2. Run the following commands to switch to the root user:

    sudo su root
  3. View the disk and partition of the server.

    1. Run the following command to view the information of the disk:

      fdisk -lu

      Extending the data disk does not affect the size of the system disk. The following figure shows only the information of data disk /dev/vdb. adElements in the preceding figure:

      • The squared area that is marked by 1: indicates the data disk size to be reached after data disk /dev/vdb is extended.

      • The squared area that is marked by 2: The information below Device indicates that the partition name of the data disk is /dev/vdb1. The information below System indicates that the partition type of the data disk is a GUID Partition Table (GPT).

    2. Run the following command to view the information of the partition:

      df -Th

      The default file system type of data disk partition /dev/vdb1 on the simple application server is ext4. The command output shows that the file system of the data disk partition remains 40 GB in size, as shown in the following figure. You must extend the partition and file system to extend the data disk.da

  4. Extend the partition.

    1. Run the following command to install the gdisk utility.

      If the partition is in the GPT format, you must perform this step. If the partition is in the Master Boot Record (MBR) format, skip this step.

      yum install gdisk -y
    2. Run the following command to install the growpart utility.

      The commands that are used to install the growpart utility vary based on the operating system of your simple application server.

      • If the server runs CentOS 7 or later, run the following command:

        yum install -y cloud-utils-growpart
        Note

        CentOS 8 has reached its end of life (EOL). If your simple application server runs a CentOS 8 operating system, change the CentOS 8 repository address.Simple Application Server For more information, see Change CentOS 8 repository addresses.

      • If the server runs Debian 9 or later, or Ubuntu 14 or later, run the following commands in sequence.

        Run the following command to update the software repository:

        apt-get update

        Run the following command to install cloud-guest-utils:

        apt-get install -y cloud-guest-utils
    3. Run the following command to extend the partition.

      Note

      Use a space to separate /dev/vdb and 1 in the command.

      growpart /dev/vdb 1

      A command output similar to the following one is returned.

      [root@iZbp1h6se7u09oqdmea**** admin]# growpart /dev/vdb 1
      CHANGED: partition=1 start=2048 old: size=83881984 end=83884032 new: size=125827038 end=125829086

      If an error occurs when the command is run, you can troubleshoot the issue. For more information, see Step 1: Resize a disk to extend its capacity.

  5. Extend the file system.

    The default file system type of data disk partition /dev/vdb1 on the simple application server is ext4. This step describes how to extend an ext4 file system.

    1. Run the following command to extend the file system:

      resize2fs /dev/vdb1
    2. Run the following command to check whether the file system is extended:

      df -Th

      If the file system is 60 GB in size, as shown in the following figure, the file system is extended. dadAfter you extend the data disk, check whether the actual size of the data disk is the same as expected.

      • If the business programs on the server run as expected, the data disk is extended.

      • If the business programs on the server do not run as expected, the data disk is not extended. Use the snapshot that you created in Step 1 to roll back the disk. For more information, see Create a snapshot.

Extend the file system on the data disk of a Windows server

In this example, a simple application server that runs a Windows Server 2012 R2 64-bit operating system is used. The data disk is extended from 40 GB to 60 GB.

  1. Connect to the Windows server whose data disk you extended in the Simple Application Server console.

    For more information, see Connect to a Windows server.

  2. In the lower-left corner of the Windows desktop, right-click the 开始 icon and click Disk Management.

    磁盘管理

  3. In the Disk Management dialog box, choose Action > Rescan Disks to view the unallocated disk size.

    adad

    Disk 1 is the data disk.

  4. Right-click the blank space in the Disk 1 section and select Extend Volume...

    add

  5. In the Extend Volume Wizard dialog box, use the default settings to extend the volume.

    The new space is automatically added to the original volume, as shown in the following figure.add

    After you extend the data disk, check whether the actual size of the data disk is the same as expected.

    • If the business programs on the server run as expected, the data disk is extended.

    • If the business programs on the server do not run as expected, the data disk is not extended. Use the snapshot that you created in Step 1 to roll back the disk. For more information, see Create a snapshot.