Skip to content

Instantly share code, notes, and snippets.

@ptheofan
Created December 5, 2019 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptheofan/ff9ab5eb99ca328e16fe2f9ba3c063f9 to your computer and use it in GitHub Desktop.
Save ptheofan/ff9ab5eb99ca328e16fe2f9ba3c063f9 to your computer and use it in GitHub Desktop.
Resize AWS EBS volume
1. First go to the console, click the volume, actions and grow it.
2. ssh to the machine
```bash
> lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 89.1M 1 loop /snap/core/8039
loop1 7:1 0 18M 1 loop /snap/amazon-ssm-agent/1480
loop2 7:2 0 89.1M 1 loop /snap/core/8213
nvme0n1 259:0 0 40G 0 disk
└─nvme0n1p1 259:1 0 40G 0 part /
# grow the partition to the new disk size (DEVICE is nvme0n1 - withought the p1)
> growpart /dev/nvme0n1 1
# Resize the partition to the new size (notice the p1 this time)
> resize2fs /dev/nvme0n1p1
# done.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment