手順メモ
EC2に接続されてるボリュームをAWS管理画面上から拡張
管理画面で実行
今回は8GB -> 30GB に拡張
現状をdf
# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 992M 56K 992M 1% /dev
tmpfs 1001M 0 1001M 0% /dev/shm
/dev/xvda1 7.8G 7.5G 173M 98% /
lsblk で確認
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 30G 0 disk
└─xvda1 202:1 0 8G 0 part /
growpart実行
growpart - extend a partition in a partition table to fill available space
# growpart /dev/xvda 1
# growpart /dev/xvda 1
CHANGED: disk=/dev/xvda partition=1: start=4096 old: size=16773086,end=16777182 new: size=62910430,end=62914526
resize2fs で拡張実行
# resize2fs /dev/xvda1
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/xvda1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/xvda1 is now 7863803 (4k) blocks long.
dfで確認
# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 992M 56K 992M 1% /dev
tmpfs 1001M 0 1001M 0% /dev/shm
/dev/xvda1 30G 7.5G 22G 26% /
完了