LoginSignup
16

More than 5 years have passed since last update.

EBSの容量を大きくする

Posted at

勢いでやったけどアッサリできた。
Management Console上でほとんど完結して、
AWSのCLI Toolsとかを使ったりもしなかった。

Amazon Linux 3.2.12-3.2.4.amzn1.x86_64

  1. EC2のインスタンス止める
  2. EBSのボリュームをdetachする
  3. 対象のEBSボリュームのsnapshotをとる(8GBなら分ぐらい?
  4. snapshotを選択して"create volume"
  5. EC2のインスタンスに新しくしたEBSをattachする
  6. インスタンスを起動する
  7. sshで繋いで、"resize2fs"する

Ubuntuとかは勝手にやってくれるらしいが。

before
ec2-user@ST02> df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/xvda1             8362320   7008880   1269576  85% /
tmpfs                   869280         0    869280   0% /dev/shm
resize2fs
sudo resize2fs /dev/xvda1
after
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/xvda1            24872264   7011108  17609868  29% /
tmpfs                   869280         0    869280   0% /dev/shm

ふえたー!
後は作ったsnapshotを消したり、古いEBSを消すのは自由。

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
16