vdi verkleinern

Allgemeine Diskussionen über den Einsatz von VirtualBox.
Post Reply
yew5
Posts: 2
Joined: 24. Mar 2020, 12:56

vdi verkleinern

Post by yew5 »

Hi

arbeite mit VB v5.2.22
Host-System: MacOS 10.12.6 und Guest-System Win XP, Win7 und Win10 … fast alle vdi auf externen USB-Sticks

Da letztens der Platz für das Win7 System zu klein war (ca 40 GB) und ich auf dem USB-Stick (128 GB) eine vdi gelöscht hatte, war zusätzlicher Platz frei, den ich auf die letzten beiden vdi (XP und Win7) verteilen wollte.

Vergrößern der vdi …..
VBoxManage modifyhd --resize 71000 /Volumes/VirtualBox/VirtualBox/Win\ 7\ 64bit/Win\ 7\ 64bit.vdi

hat ja geklappt und konnte den zusätzlichen Platz der vdi zuteilen

Systemsteuerung > System und Sicherheit > Verwaltung > Computerverwaltung > Datenträgerverwaltung

Nach der Aktion wurde mir allerdings bewußt, dass die neue vdi jetzt ca 69,34 GB hatte, sollten aber eigentlich nur 60 GB sein.
Statt resize 71000 hätten es 61000 sein sollen, hab also der vdi zu viel Speicher zugewiesen.


Jetzt war ich also dran, die vdi wieder zu verkleinern

VBoxManage modifyhd /Volumes/VirtualBox/VirtualBox/Win\ 7\ 64bit/Win\ 7\ 64bit.vdi --compact
bwz
VBoxManage modifyvdi --compact /Volumes/VirtualBox/VirtualBox/Win\ 7\ 64bit/Win\ 7\ 64bit.vdi

und die Änderung in der Datenverwaltung haben zwar soweit geklappt, aber in VB wird mit unter Massenspeicher SATA-Port 0 immer noch die Win7 vdi (normal 69,34 GB) angezeigt, obwohl unter Win7 der lokale Datenträger mit 59,9 GB angezeigt wird.

Warum zeigt mir VB noch immer den alten Wert an? Lässt sich das korrigieren oder spielt das keine Rolle, weil der Datenträger in Win7 den Wert korrekt anzeigt?


Gruß yew5
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: vdi verkleinern

Post by scottgus1 »

While Resize makes the maximum size of the drive larger, Compact does not make the maximum size of the drive smaller. Compact only erases portions of the virtual drive file on the host storage that are no longer used by the guest OS, so the drive file can temporarily be smaller. The maximum size still remains, and the drive will fill up again.

However, if you shrink the partition inside the guest OS, the guest OS will only write data to the maximum size of the partition. So the drive file will not get any bigger than the partitions will let it get.

Inside the guest that was Resized to 71000, adjust the main partition so all the partitions take up no more than 61000. You might need to compact again, but the drive file will now not get any bigger than 61000.
yew5
Posts: 2
Joined: 24. Mar 2020, 12:56

Re: vdi verkleinern

Post by yew5 »

Hi scottgus1

sorry for my late answer .... and thanks for your reply


Da ich nach dem "verkleinern" keine Fehler feststellen konnte und bisher ohne Probleme damit gearbeitet habe, lasse ich das System, bzw. die vdi so wie sie ist


Gruß yew5
Post Reply