Step 4: Extend the file system - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Step 4: Extend the file system

Once the data volume enters the optimizing state, you can use file system-specific commands to extend the file system to the new, larger size.

For more information about extending the file system, see Extend a Linux file system after resizing a volume.

To extend the file system

  1. In the Amazon EC2 console, on the EC2 Dashboard, choose Instances, and select tutorial-volumes.

  2. To connect to your instance, choose Connect, ensure EC2 Instance Connect is selected, and then choose Connect.

  3. In the terminal window, use the following command to get the size of the file system.

    [ec2-user ~]$ df -hT

    The following example output shows that the file system size of the data volume /dev/nvme1n1 is 8 GB. In the previous procedure, you increased the data volume size to 16 GB. Now you need to extend the file system to take advantage of the added storage.

    
                       Display of file systems showing data volume file system size has not been increased.
  4. Use the following command to extend the XFS file system that is mounted on the /data mount point.

    [ec2-user ~]$ sudo xfs_growfs -d /data
  5. Use the following command again to verify that the file system has been extended.

    [ec2-user ~]$ df -hT

    The following example output shows that the file system size of /dev/nvme1n1 is the same as the data volume size.

    
                       Display of file systems showing data volume file system size has been increased.