Yuav ua li cas mus cuag cov Ubuntu Linux hard disk drive paus muab faib nyob rau hauv VirtualBox?

Yog hais tias koj yuav khiav tawm ntawm qhov chaw nyob rau hauv Ubuntu Linux nyob rau hauv VirtualBox ces koj yuav tau kom cov hard disk loj thiab ces rov loj muab faib rau. The following will show you how to do this.

Kuv muaj ib tug Ubuntu VM uas muaj ib tug hard disk luaj li cas ntawm 8GB. I want to increase the size to 16Gb.

Yuav ua li cas mus cuag cov Ubuntu Linux hard disk drive paus muab faib

  1. Xyuas kom tseeb tias koj VM yog switched.
  2. Mus rau qhov hais kom ua kom sai thiab mus rau lub VirtualBox installation directory. The default location usually is C:\Program Files\Oracle\VirtualBox
  3. Nyob rau hauv qhov hais kom ua sai li sai tau nkag mus rau:
    VBoxManage modifyhd "Thiab:\VirtualBox VMs\Ubuntu 14.04.3\Ubuntu 14.04.3.vdi” --resize 16000
  4. Xyuas qhov luaj li cas nyob rau hauv lub VirtualBox GUI. The size should have changed.
    Yuav ua li cas mus cuag cov Ubuntu Linux hard disk drive paus muab faib 2
  5. Tam sim no hais tias cov VirtualBox hard disk tau hloov lub muab faib yuav tsum tau hloov nyob rau hauv Ubuntu li hais tias nws yuav siv tau. In order to resize the partition use the gparted live CD which can be downloaded from no
  6. Thaum downloaded ntxig rau GParted ISO ntaub ntawv mus rau hauv tib lub VM CD tsav thiab zuam nyob CD checkbox. Start the VM booting into the CD drive.
  7. Thaum GParted tau booted koj yuav tsum tau saib koj cov partitions li zoo raws li lub un-faib muab faib.
    Resize Hard Disk Drive partition of Ubuntu Linux in VirtualBox using GParted
  8. Txoj nyem qhov muab faib uas yog nested nyob rau hauv lub ncua muab faib nrog cov ntaub ntawv lvm2 pv thiab deactivate muab faib rau.
  9. Xaiv lub ncua kab thiab nias cov re-loj / txav. Drag the arrow right to the end.
    Resize Hard Disk Drive partition of Ubuntu Linux in VirtualBox using GParted-2
  10. Select the partition that is nested under the extended partition with the file system lvm2 pv and click the re-size/move button. Drag the arrow right to the end.
  11. Nias lub khawm thov kom txuag tau tus hloov.
  12. Shutdown the VM and remove the GParted CD
  13. Start the VM to boot up the Ubuntu install
  14. Khiav disks los ntawm kev siv cov Ubuntu nrhiav
    Resize Hard Disk Drive partition of Ubuntu Linux in VirtualBox using GParted
    Koj yuav pom tau tias cov hard disk loj tau ntau zog tab sis qhov chaw no tsis yog raug siv los ntawm cov Ubuntu filesystem. The root partition is only using 6.1gb of space. Peb yuav tsum tau khiav ib tug hais kom qhia rau Ubuntu siv qhov chaw no. Ua ib daim ntawv ntawm cov zajlus kom ntim rau cov hauv paus hniav muab faib. In this tutorial it is /dev/ubuntu-vg/root.
  15. Qhib davhlau ya nyob twg thiab ntaus cov nram qab no hais kom ua hloov cov zajlus kom ntim lub npe nrog rau koj tus kheej:
    sudo lvextend -L13.385G / dev / ubuntu-VG / hauv paus
    Qhov saum toj no siv cov parameter -u uas qhia Ubuntu qhov luaj li cas ntawm cov zajlus kom muab faib nyob rau hauv gigabytes. Change the size to your needs. The above command can be run as many times as you need so don’t worry about making a mistake.
  16. Tam sim no peb muaj teeb qhov luaj li cas peb yuav tsum tau qhia rau Ubuntu mus tom ntej thiab re-loj nws. Type the following to do this:
    sudo resize2fs / dev / ubuntu-VG / hauv paus
  17. Tam sim no saib lub disks hluav taws xob. The size of the root logical volume should now have increased. Ubuntu is now using the extra disk space that we had increased in VirtualBox.
    Resize Hard Disk Drive partition of Ubuntu Linux in VirtualBox using GParted