Sut i ymestyn y Ubuntu Linux n anawdd choeten cathrena rhaniad gwraidd yn VirtualBox?

Os ydych yn rhedeg allan o le mewn Ubuntu Linux yn VirtualBox, yna bydd angen i chi gynyddu maint disg caled ac yna ail-maint y rhaniad. The following will show you how to do this.

Mae gen i Ubuntu VM sydd â maint disg caled o 8GB. I want to increase the size to 16Gb.

Sut i ymestyn y Ubuntu Linux n anawdd choeten cathrena rhaniad gwraidd

  1. Sicrhewch fod eich VM ei ddiffodd.
  2. Ewch i'r archa 'n barod ac yn mynd i'r cyfeiriadur gosod VirtualBox. The default location usually is C:\Program Files\Oracle\VirtualBox
  3. Yn y archa 'n barod fynd i mewn:
    VBoxManage modifyhd "Ac:\VirtualBox VMs\Ubuntu 14.04.3\Ubuntu 14.04.3.vdi” --resize 16000
  4. Edrychwch ar y maint yn y GUI VirtualBox. The size should have changed.
    Sut i ymestyn y Ubuntu Linux n anawdd choeten cathrena rhaniad gwraidd 2
  5. Nawr bod y ddisg galed VirtualBox wedi newid y rhaniad angen ei newid i mewn Ubuntu fel y gellir ei ddefnyddio. In order to resize the partition use the gparted live CD which can be downloaded from yma
  6. Ar ôl ei lawrlwytho rhowch y ffeil GParted ISO i mewn i'r un CD gyriant VM a thiciwch y blwch CD byw. Start the VM booting into the CD drive.
  7. Unwaith GParted wedi sodlau, dylech fod yn gallu gweld eich rhaniadau yn ogystal â'r rhaniad a ddyrannwyd heb ei.
    Resize Hard Disk Drive partition of Ubuntu Linux in VirtualBox using GParted
  8. Dde chlecia y rhaniad sy'n cael ei nythu o dan y rhaniad estynedig gyda'r pv system ffeiliau lvm2 a deactivate y rhaniad.
  9. Dewiswch y rhes estynedig a chliciwch ail-maint / symud. 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. Cliciwch ar y botymau yn berthnasol i achub y newidiadau.
  12. Shutdown the VM and remove the GParted CD
  13. Start the VM to boot up the Ubuntu install
  14. Disgiau rhedeg gan ddefnyddio'r chwiliad Ubuntu
    Resize Hard Disk Drive partition of Ubuntu Linux in VirtualBox using GParted
    Gallwch weld bod y maint disg caled wedi cynyddu ond nid yw'r gofod yn cael ei ddefnyddio gan y cysawd ffeiliau Ubuntu. The root partition is only using 6.1gb of space. Mae angen i ni redeg gorchymyn i ddweud wrth Ubuntu i ddefnyddio'r gofod hwn. Gwnewch nodyn o'r gyfrol rhesymegol ar gyfer y rhaniad gwraidd. In this tutorial it is /dev/ubuntu-vg/root.
  15. Terfynell Agored a deipio 'r yn canlyn archa yn lle'r enw cyfrol rhesymegol gyda eich pen eich hun:
    sudo lvextend -L13.385G / dev / ubuntu-VG / gwraidd
    Mae'r uchod yn defnyddio'r -L paramedr sy'n dweud Ubuntu maint y rhaniad rhesymegol mewn gigabeit. 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. Nawr rydym wedi gosod y maint mae angen i ni ddweud wrth Ubuntu i fynd yn ei flaen ac ail-maint ei. Type the following to do this:
    sudo resize2fs / dev / ubuntu-VG / gwraidd
  17. Nawr edrychwch ar y cyfleustodau disgiau. 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