0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

oracle cloud infrastructure(OCI)でブートボリュームを拡張する手順

Last updated at Posted at 2024-10-09

目次

はじめに

OCIで新しいインスタンスを作成した際、初期のストレージ容量では不足する場合があります。この記事では、ディスクとパーティションのサイズを拡張する手順について説明します。

手順1: ボリュームのサイズ変更

  1. OCIコンソールにログインし、拡張したいブート/ブロックボリュームを選択します。
    image.png
  2. 「編集」をクリックし、「初期ボリュームサイズ」の項目に希望する新しいサイズを入力します。
    image.png
  3. ニーズがなければ、他がディフォルトで「変更を保存」をクリックし、OS側でパーティションの拡張を行います。
    image.png
パーティションの拡張手順(コマンド)

image.png

以下のコマンドをインスタンス上で実行します:

sudo dd iflag=direct if=/dev/oracleoci/oraclevda of=/dev/null count=1
echo “1” | sudo tee /sys/class/block/`readlink /dev/oracleoci/oraclevda | cut -d’/’ -f 2`/device/rescan

手順2: パーティションの拡張

#lsblkコマンドを実行し、デバイス名を確認します。
lsblk

sudo /usr/libexec/oci-growfs

#すべてが正常に完了した場合、lsblkを再度実行して、パーティションが拡張されたことを確認します。
lsblk

手順2.1: OCI-Utils追加情報

しかし、この手順をうまく完了できない場合、例えばoci-growfsがない場合は、以下をご覧ください。

追加: oci-growfsがないの対処法

ここでは、行うべき追加手順を説明します:

以下のコマンドを実行してください:

git clone https://github.com/oracle/oci-utils.git
cd oci-utils
python3 ./setup.py build
sudo python3 ./setup.py install
# the following will expand your volume(s)
sudo ./libexec/oci-growfs

確認

以下のコマンドで確認します。

lsblk
df -h
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?