Skip to content

Instantly share code, notes, and snippets.

@mohammad-quanit
Created August 5, 2024 18:56
Show Gist options
  • Save mohammad-quanit/fc99b6baff0e49ee07a67c4ada05925f to your computer and use it in GitHub Desktop.
Save mohammad-quanit/fc99b6baff0e49ee07a67c4ada05925f to your computer and use it in GitHub Desktop.
EBS Volumes Increase Of Running Instance
Step:1 increase the volume size from Console.
Step:2 SSH your instance
Step:3 Verify filesystem using df -h command
Step:4 To check whether the volume has a partition that must be extended, use the lsblk command to display information about the block devices attached to your instance.
Step:5 For volumes that have a partition use the growpart /dev/xvda 1 command to extend the partition. Notice that there is a space between the device name and the partition number.
Step:6 To verify that the partition reflects the increased volume size, use the lsblk command again.
Step:7 To verify the size of the file system for each volume, use the df -h command. In this example output, both file systems reflect the original volume size.
Step:8 To extend the file system on each volume, use the correct command for your file system, as follows:
[XFS file system] To extend the file system on each volume, use the xfs_growfs -d / command
If the XFS tools are not already installed, you can install them as follows.
yum install xfsprogs
[ext4 file system] To extend the file system on each volume, use the resize2fs command.
resize2fs /dev/volumename
Step:9 Again run df -h command to verify filesystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment