4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VirtualBox上のMintのディスクサイズを変更

Posted at

VirtualboxにMintをインストールすると、パーティションの区切り方の問題で初期設定の8GBのままだとすぐに容量が一杯になってしまいます。なので仮想ディスクのサイズを増やしてMint上でもその設定を反映させる必要があります。

VirtualBoxの仮想ディスクサイズの変更

VirtualBoxの仮想ディスクファイル.vdiをこんな感じでサイズ変更。これで最大20GBに変えれます。

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\Users\ironsand\VirtualBox VMs\Mint16Cinamon\Mint16Cinamon.vdi" --resize 20000

Gpartedでパーティションサイズを変更

からGpartedのisoファイルをダウンロードしてきて、VirtualBoxのMint16の設定→ストレージで光学ドライブにそのISOを指定して仮想マシンを再起動してGpartedを立ち上げる。

/dev/sda1を拡張したいけど/dev/sda2が邪魔でできないので配下の/dev/sda5のスワップディスクとともに削除するして、dev/sda1をswap用の500MBぐらい残して増やす。

んで、もう一度拡張倫理ドライブを作ってその下にLinux-swapディスクを作成する。んでApplyして変更を保存します。

このままだとUUIDが変更されたswapディスクがエラーを起こしてしまうのでGpartedのTerminalを使ってfstabを編集。

sudo mount /dev/sda1 /mnt
sudo vi /mnt/etc/fstab

でファイルを開いて

UUID=xxxx-xxx-xxxx-・・xxx  none  swap sw 0 0

# UUID=xxxx-xxx-xxxx-・・xxx  none  swap sw 0 0
/dev/sda5  none swap sw 0 0

な感じに変更。以上でGpartedの作業は終了なのでsudo shutdown -h nowとかで終わらせる。

Mintの立ち上げ

問題がなければ以上でMintで使えるディスクサイズが増えてるはずなので起動させて確認しましょう。

ironsand@vm-mint ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        19G  3.7G   15G  21% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           404M 1000K  403M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  964K  2.0G   1% /run/shm
none            100M  8.0K  100M   1% /run/user

ひゃほーい!

参考

【Ubuntu】Virtualbox の仮想ハードディスクの容量を増やす方法:なんでもかんでもコンピュータ:So-netブログ

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?