LoginSignup
1
0

More than 5 years have passed since last update.

VirtualBoxの仮想HDD追加

Posted at

VirtualBoxの仮想HDD追加の備忘録です。

手順

仮想HDD追加を実施するには、追加したいVMを電源オフ状態にしておくこと。じゃないと、ストレージ追加の設定がVirtualBox上行えなかった。

VirtualBox上での作業

追加するVMのストレージ設定画面を開きます。
「コントローラー: SATA」を選択すると右のほうにHDD追加ボタンHDD追加アイコンがでるので、それをクリックします。

rapture_20190116222616.png

「新規ディスクの作成」をクリックします。

rapture_20190116222728.png

自分の場合は、デフォルトの「VDI」を選択して次へ。

rapture_20190116222842.png

可変サイズ/固定サイズは、自分の場合は、固定サイズを選択し、次へ。

rapture_20190116223019.png

仮想ディスクイメージのファイル名と、サイズを設定し、作成を押下。

rapture_20190116223217.png

少し待つとディスクが作成された。

rapture_20190116223405.png

最後に、上記画面で「OK」を押下。(これしないと反映されなかった。)

Terminalで確認

ディスクが追加されているか確認します。

fdisk -l

Disk /dev/sda: 21.8 GB, 21832744960 bytes, 42642080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x000abc3e

デバイス ブート      始点        終点     ブロ
ック   Id  システム
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    42641407    20271104   8e  Linux LVM

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト


Disk /dev/mapper/centos-root: 18.6 GB, 18601738240 bytes, 36331520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト


Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト

上記だと、パーティションが作成されていない/dev/sdbが追加されたディスクになります。

あとは、fdiskとかlvmでよしなにパーティション作成や拡張作業をすればOK。

参考サイト

1
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
1
0