Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nosmall/ff96acbaf75aecbdd046b4319a188152 to your computer and use it in GitHub Desktop.
Save nosmall/ff96acbaf75aecbdd046b4319a188152 to your computer and use it in GitHub Desktop.
Extend a Linux file system after resizing a volume

Extend a Linux file system after resizing a volume

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

# Check whether the volume has a partition. Use the lsblk
sudo lsblk
# Extend the partition. Use the growpart
sudo growpart /dev/sda 1 --dry-run

# Verify that the partition has been extended.
sudo lsblk
df -hT
# [Ext4 file system] Use the resize2fs.
# lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/sda1

# Verify that the partition has been extended.
sudo lsblk
df -hT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment