Hi,
I've been looking for reducing my virtual disk image that contains a ReiserFS 3 partition, without any luck: none of the proposed methods from Parallels led to actually shrink down the image file. Compressing the hard disk image from the VM configuration/hard drive/Compact page took a long time, but the resulting image file ended up with the same size as before compressing the disk.
This is too bad, as my image file was about 6.5GB while the actual disk content (df command from the guest OS) was only about 1.55GB in my environment.
I nevertheless find a quite simple way to reduce the image file size from Linux: I've simply duplicated the image file from the guest OS, that is copy all the Linux files in a new virtual expanding hard drive (so that the new image file contains only the existing file and is not overloaded with empty space) and get rid of the original virtual hard disk.
The resulting image file is only 1.6GB (to be compared to the original 6.5GB image file):
1. From Parallels VM configuration, create a new self-expanding hard drive (IDE 1:1 in my config). I've used a 8000MB hard drive, put it should work with any size, as long as the resulting virtual disk can contain all your original disk data.
2. Boot the guest OS (Linux), then from the Linux prompt
3. Create the partition table on the new hard drive:
fdisk /dev/hdd
so that it looks like your original hard drive (/dev/hda on most configurations)
4. Format the partition(s) on the new hard drive with the same filesystems as the original hard drive. I only have one partition (/) on my original hard drive. Your mileage may vary.
5. Mount the new partition
mount /dev/hdd1 /mnt
6. Copy the original partition content to the new partition
cd /mnt; (cd /; tar cf - --one-file-system) | tar xvf -
7. Re-install the boot loader on the new partition
grub-install --recheck --root-directory=/mnt hd2
hd2 means /dev/hdd on my machine, check the result of the grub-install command if you've installed the new virtual hard drive on another IDE port. Note that if your Linux distribution is using LILO, lilo must be used instead of grub.
8. Unmount /mnt. You may want to repeat step 5 and 6 for other partitions, and initialize any swap partition if you have any on the new hard drive
9. Shutdown linux, then the VM
shutdown -h now
10. Remove the newly created virtual hard drive from the VM configuration, and replace the original virtual hard drive with the new one.
11. Restart the VM. The new virutal hard drive should boot. Once you've checked that everything works as it used to be with the original virtual hard disk, you can get rid of this image.
If you cannot boot from your new virtual disk image, you can simply restart the whole procedure (or give up ;-)): your original virtual disk image has not been modified, and you can still boot your Linux environment from it.
HTH.