0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EC2のEBS拡張

0
Last updated at Posted at 2020-10-07

EC2のEBSのボリュームを拡張する話です。

[]$ df -h
ファイルシス   サイズ  使用  残り 使用% マウント位置
devtmpfs         2.0G     0  2.0G    0% /dev
tmpfs            2.0G   92K  2.0G    1% /dev/shm
tmpfs            2.0G  448K  2.0G    1% /run
tmpfs            2.0G     0  2.0G    0% /sys/fs/cgroup
/dev/xvda1       100G   27G   74G   27% /
tmpfs            395M     0  395M    0% /run/user/40503

パーティションを拡張する

[]$ sudo growpart /dev/xvda 1
CHANGED: partition=1 start=4096 old: size=209711071 end=209715167 new: size=314568671 end=314572767

[]$ sudo xfs_growfs /dev/xvda1
meta-data=/dev/xvda1             isize=512    agcount=51, agsize=524159 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1 spinodes=0
data     =                       bsize=4096   blocks=26213883, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 26213883 to 39321083

結果

[togo-ma@diva-dev-ap01-al2 ~]$ df -h
ファイルシス   サイズ  使用  残り 使用% マウント位置
devtmpfs         2.0G     0  2.0G    0% /dev
tmpfs            2.0G   92K  2.0G    1% /dev/shm
tmpfs            2.0G  448K  2.0G    1% /run
tmpfs            2.0G     0  2.0G    0% /sys/fs/cgroup
/dev/xvda1       150G   27G  124G   18% /
tmpfs            395M     0  395M    0% /run/user/40503
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?