AWS EC2のディスク容量を増やした時の作業ログ

AWSでEC2のディスク容量を増やした時の作業ログ

作業内容は以下

SnapShotの作成

Volumeの作成

Volumeのデタッチ&アタッチ

Server Restart

管理画面からInstancesを選択

f:id:loosefingers:20160808203314p:plain

変更対象のinstanceIdを控えておきましょう。SnapShot作成の時に必要になります。

Volumesを選択

f:id:loosefingers:20160808203459p:plain

Attachment informationが先ほどのInstanceと同じVolumeを選択する。 f:id:loosefingers:20160808210913p:plain

SnapShotの作成

f:id:loosefingers:20160808203924p:plain

作成したSnapShotからVolumeを作成します。 f:id:loosefingers:20160808204205p:plain

Volumeのデタッチ&アタッチ

まず、対象となるInstanceはStopしておく必要があります。 (※Teminateではないので必ずご注意をInstanceが消えてしまいます。。)

f:id:loosefingers:20160808204711p:plain

変更対象となるVolumeをデタッチします、その後あたらしいVolumeをアタッチします。

f:id:loosefingers:20160808204618p:plain

:/dev/sda1 

この時、Deviceを適切に設定する必要がありました。 f:id:loosefingers:20160808205948p:plain

適切にDeviceが設定されていない場合は以下のようなエラーが発生。

Invalid value '******' for instanceId. Instance does not have a volume attached at root (/dev/sda1)

Instanceの起動

Instanceをstartさせる。