[AWS] How to expand disk space on Amazon linux

Big flow

① Expand the volume size from the AWS EC2 console (2) Expand the disk capacity (partition) in Amazon Linux

① Expand the volume size from the AWS EC2 console

EC2 Instance → Volume → Action → Change Volume In my case, I changed the specified volume size from 8GB to 12Gb.

reference Request EBS Volume Changes https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/requesting-ebs-volume-modifications.html

(2) Expand the disk capacity (partition) in Amazon Linux

Confirm that the setting of ① is reflected by the lsblk command.

python


# lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT   
xvda    202:0    0  12G  0 disk   
┗xvda1   202:1    0   8G  0 part

※ xvda ・ ・ ・ device name xvda1 ・ ・ ・ Represents partition number 1 of xvda

Since the volume size is 12G and the partition size is 8G, it is necessary to expand it.


Change partition size Install because you need a partition size extension package called gworpart

python


# yum install cloud-utils-growpart

Check if there is a grow part in the package list

python


# rpm -qa | grep cloud
cloud-utils-growpart-0.31-2.amzn2.noarch

Expand partition size with growpart command and reboot

python


# growpart /dev/xvda 1
# reboot

Make sure that the first partition of xvda is extended to 12G

python


# lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 
xvda    202:0    0  12G  0 disk 
┗xvda1  202:1    0  12G  0 part /


Recommended Posts

[AWS] How to expand disk space on Amazon linux
[AWS EC2] How to install Maven on Amazon Linux 2
How to build a Python environment on amazon linux 2
How to install wkhtmltopdf (Amazon Linux2)
How to install VMware-Tools on Linux
[AWS EC2] Settings you want to do on Amazon Linux 2
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
How to install aws-session-manager-plugin on Manajro Linux
How to display emoji on Manjaro Linux
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
How to install packages on Alpine Linux
How to install php7.4 on Linux (Ubuntu)
[2020 version] How to install Python3 on AWS EC2
How to install Camunda Modeler on Manjaro Linux
How to build Java environment on Ubuntu (Linux)
How to access the contents of a Linux disk on a Mac (but read-only)
How to use C216 Audio Controller on Arch Linux
How to install Linux on a 32bit UEFI PC
How to allow nologin users to log in on Linux
How to set layer on Lambda using AWS SAM
AWS EC2 2nd SSH connection to EC2 Instance (Amazon Linux2)
How to install git on Linux such as EC2
[Tips] How to use iPhone as webcam on Linux
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
Monitor disk usage on Linux
How to register on pypi
Put jenv on Amazon Linux
Install tomcat 5.5 on Amazon Linux.
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
A memo on how to easily prepare a Linux exercise environment
[For beginners] How to use for statements on Linux (variables, etc.)
Launch NEM Symbol testnet node on AWS EC2 (Amazon Linux2)
How to create an ISO file (CD image) on Linux
Install Python Pillow on Amazon Linux
How to make AWS Lambda Layers when running selenium × chrome on AWS Lambda
I tried to create an environment of MkDocs on Amazon Linux
Easy copy to clipboard on Linux
Install oracle java8 on amazon linux2
How to install mysql-connector-python on mac
Notes on how to use pywinauto
How to install graph-tool on macOS
How to install pycrypto on Windows
View disk usage on personal Linux
How to deploy django-compressor on Windows
Install pyenv on EC2 (Amazon Linux)
Notes on how to use featuretools
How to install OpenCV on Mac
How to run matplotlib on heroku
How to install MBDyn (Linux Ubuntu)
How to display PDF resolution and detailed information on Linux (pdfinfo)
How to install PyPy on CentOS
How to use homebrew on Debian
How to get all traffic through VPN with OpenVPN on Linux
Misunderstanding on how to connect cnn
How to install TensorFlow on CentOS 7
Introducing Amplify to Amazon Linux 2 AMI
[Note] Install Imagick on Amazon Linux2
Notes on how to use doctest
Run docker-compose on Amazon Linux2 on ARM64
Introduce Python 3.5.2 environment on Amazon Linux