InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

AWS and EC2

  • AWS benefits
  • Broken sudoers file
  • EBS and reliability/durability
  • EC2 api tools on Ubuntu
  • How to extend disk (EBS) size on Amazon Linux
  • Install wordpress AWS Classic Ubuntu
  • Linux instance on AWS Classic
  • Mysql access
  • Mysql service and micro instance
  • Route53 as DNS
  • Upgrade Linux micro instance to small
  • ssh automation
 
  • Home
  • > Tutorials
  • > AWS and EC2

How to extend disk (EBS) size on Amazon Linux

on Feb 26, 2025

Steps to extend disk (EBS) on Amazon Linux 2 without a downtime. The following instructions are for hypervisor type nitro based instances.

  • Create a snapshot of the volume in case something goes wrong.
  • Wait to make sure volume state is in optimizing or completed state.
  • Extend the volume size to desired value (e.g. 10 GiB to 20 GiB)
  • Check volume partition using lsblk. The partition size should be less than the volume size.
    sudo lsblk
    NAME          MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    nvme0n1       259:0    0  10G  0 disk 
    ├─nvme0n1p1   259:1    0  10G  0 part /
    └─nvme0n1p128 259:2    0   1M  0 part
  • Extend the partition number using growpart. The command will need partition number. e.g. in
    nvme0n1p1 partition number is number after p.
    sudo growpart /dev/nvme0n1 1
  • Verify that the partition number has been extended using lsblk command again. New size will show 20G when increasing from 10G to 20G.
  • Get the name, size, type, and mount point for the file system that you need to extend. Use the df -hT command
    df -hT
    Filesystem     Type      Size  Used Avail Use% Mounted on
    devtmpfs       devtmpfs  957M     0  957M   0% /dev
    tmpfs          tmpfs     975M     0  975M   0% /dev/shm
    tmpfs          tmpfs     975M  436K  974M   1% /run
    tmpfs          tmpfs     975M     0  975M   0% /sys/fs/cgroup
    /dev/nvme0n1p1 xfs        10G  9.0G   1G  90% /
    tmpfs          tmpfs     195M     0  195M   0% /run/user/1001
  • For xfs filesystem, use the xfs_growfs command and specify the mount point of the file system that you noted in the previous step
    sudo xfs_growfs -d /
  • Use df -hT to ensure the new size is available to use (20G instead of 10G in our example)

Suggested posts:

  1. Linux rsync tutorial
  2. Linux – command to check swap size
  3. How to locally override website domain (or hostname) to IP mapping
  4. Linux yum quick tutorial
  5. Amazon Linux 2 install apache 2.4
  6. PHP echo – comma (,) vs dot (.) performance benchmarks
  7. How to fix a broken sudoers file on AWS/EC2 Linux
  8. Linux – how to run a command as different user
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Amazon Linux 2, AWS and EC2, Linux
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress