VMware Communities
parkernathan
Contributor
Contributor

Shrinking a Fedora 14 Hard Drive

How can one shrink a dynamically-expanding hard drive on Fedora 14 (64 Bit Edition)? I know how to run the shrink tools on Windows, but not sure on Fedora.

Thanks!

Tags (1)
0 Kudos
7 Replies
WoodyZ
Immortal
Immortal

By default Fedora 14 uses LVM and Ext4 and this is not yet supported by Shrink in VMware Tools so the workaround is to zero out the free space and then shutdown, not suspend, the Virtual Machine and then use Disk Cleanup from the Virtual Machine Hard Disks Settings.  Note: The Virtual Machine cannot have Snapshots for this to work.

I use to use dd and rm but have now been using the following command in a Terminal as root from both '/' and '/boot':

cat /dev/zero > wipefile; rm -f wipefile

NOTE: Usual caveats apply!  Also make sure User Data is backed up separate and apart from the Virtual Machine as well as the Virtual Machine itself before preforming disk level operations such as this.  Also ensure adequate free disk space on Host to preform disk level operations such as this.  If using monolithic disks you need no less then the size of the .vmdk plus some additional free space for overhead.  If using split disks you need 2 GB plus some additional free space for overhead.

Message was edited by: WoodyZ

0 Kudos
parkernathan
Contributor
Contributor

So basically I just go to Terminal, su to root, then run your below command?

0 Kudos
WoodyZ
Immortal
Immortal

So basically I just go to Terminal, su to root, then run your below command?

Yes however reread my original reply as I edited it after you replied.

Also you need to run that command in both '/' and '/boot' as they are two separate volumes.

0 Kudos
parkernathan
Contributor
Contributor

Excellent! After that, do I need to run some form of shrink disk on the host side to compress the volume? I knew how to do it in Fusion 2, but I'm not sure in Fusion 3.

Thanks!

0 Kudos
WoodyZ
Immortal
Immortal

After that, do I need to run some form of shrink disk on the host side to compress the volume?

Regardless of how one chooses to shrink a disk, shrinking a disk it always a two step process.  First the free space is zeroed out and then the disk is rewritten and Shrink from VMware Tools handles both processes however when not using VMware Tools it has to be done separately and the second step is done with the Virtual Machine shutdown and in my original reply in this thread I've already told you what needs to be done so I suggest you again reread it.

The part that explicitly address your question is"... then use Disk Cleanup from the Virtual Machine Hard Disks Settings."

0 Kudos
parkernathan
Contributor
Contributor

That's right. I overlooked the part about Disk Cleanup. I was thinking back to the Fusion 2 days when it was called something else. Great to know! I've zeroed out the space already, and I'll run Disk Cleanup now!

0 Kudos
parkernathan
Contributor
Contributor

It worked! Slimmed my VM down quite a bit! Thanks for your help!

0 Kudos