ralphrmartin
Member
Seems I posted my tip in the wrong forum! Repeated here, where it really should be; only tested on MacOS X host but ought to work anywhere:
Here is a tip which might be helpful to people using Linux guest operating systems.
Eventually, with use, your expanding virtual hard disk will grow quite a lot bigger than the amount of data on it. This is how to reduce the disk back down to a small size. There are 2 steps
(1) Within Linux, you need to zero all free blocks. This can be done as follows:
Install the "zerofree" package using whatever package manager is appropriate for your flavour of Linux.
Boot your Linux VM in single user mode.
Type the following commands (which switch to level 1, so we can remount the disk as read-only, check the disk before zeroing the free blocks, then finally remount the disk as read-write and shutdown).
init 1
mount -n -o remount,ro -t ext3 /dev/hda1 /
fsck.ext3 -f /dev/hda1
zerofree /dev/hda1
mount -o remount,rw -t ext3 /dev/hda1 /
shutdown -h now
(2) Within your Parallels application, choose your virtual machine, click on the disk's configuration tab, and under advanced, choose "compact".
You can now reboot your Linux VM, with its streamlined disk.
Here is a tip which might be helpful to people using Linux guest operating systems.
Eventually, with use, your expanding virtual hard disk will grow quite a lot bigger than the amount of data on it. This is how to reduce the disk back down to a small size. There are 2 steps
(1) Within Linux, you need to zero all free blocks. This can be done as follows:
Install the "zerofree" package using whatever package manager is appropriate for your flavour of Linux.
Boot your Linux VM in single user mode.
Type the following commands (which switch to level 1, so we can remount the disk as read-only, check the disk before zeroing the free blocks, then finally remount the disk as read-write and shutdown).
init 1
mount -n -o remount,ro -t ext3 /dev/hda1 /
fsck.ext3 -f /dev/hda1
zerofree /dev/hda1
mount -o remount,rw -t ext3 /dev/hda1 /
shutdown -h now
(2) Within your Parallels application, choose your virtual machine, click on the disk's configuration tab, and under advanced, choose "compact".
You can now reboot your Linux VM, with its streamlined disk.