Extending File Systems

Last updated: 2021-04-28 15:23:05

    Overview

    This document describes how to extend a file system after logging in to the CVM instance. This method is suitable for scenarios where the file system is directly created without partitioning the cloud disk.

    Directions

    1. Run the following command to determine the file system type.
      df -ihT
      
    • The following result shows an EXT file system.
    • The following result shows a XFS file system.
    1. Use the file system-specific command to extend the file system.
    • Taking /dev/vdb as an example, run the following command to extend an EXT file system:
      resize2fs /dev/vdb
      
      If the following command output is returned, the expansion is successful.
    • Taking /dev/vdc as an example, run the following command to extend an XFS file system:
      xfs_growfs /dev/vdc
      
      If the following command output is returned, the expansion is successful.
    1. Run the following command to view the disk space of the file system.
      df -h