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?

Google Cloud Compute Engineインスタンスのディスクサイズを変更する方法

Posted at

eve-ngを触っていた際に途中でディスク容量が足らなくなりディスクサイズ変更して対処したのでその方法をメモ

1.ディスクサイズ変更

「Compute Engine」→ 「ストレージ/ディスク」→選択して編集→サイズを変更して保存

2.パーティション拡張

sudo growpart /dev/sda 1
sudo resize2fs /dev/sda1

こんな感じ

root@eve:# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             91G     0   91G   0% /dev
tmpfs            19G   18M   19G   1% /run
/dev/sda1       146G  118G   28G  81% /

root@eve:# growpart /dev/sda 1
CHANGED: partition=1 start=227328 old: size=314345439 end=314572767 new: size=524060639 end=524287967
root@eve:# resize2fs /dev/sda1
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old_desc_blocks = 19, new_desc_blocks = 32
The filesystem on /dev/sda1 is now 65507579 (4k) blocks long.

root@eve:# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             91G     0   91G   0% /dev
tmpfs            19G   18M   19G   1% /run
/dev/sda1       243G  118G  125G  49% /

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?