Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been trying to use zerofree to reduce the size of my VM.

It worked fine for one filesystem, but the other was mounted on / so it wouldn't let me.

Then I figured I could use the 'recovery mode', and it worked.

But zerofree never ends. I let it run for an hour, but I think it wasn't doing a thing. After stopping it, no space had been released.

Any thoughts?

share|improve this question

Use the -v option. I found it useful. It shows some progress.

share|improve this answer

According to the man page, zerofree won't work on read+write (rw) mounted filesystems (/ is typically mounted as rw); it requires the volume to be unmounted or mounted as read-only (ro). Two options are available:

  1. Create a "zerofree dedicated VM", where you can dedicate to zerofree other VM images; then attach the disk to that vm but do not mount or boot from it!! Leave it unmounted for zerofreeing it. Remember to deattach the disk image at VM shutdown.
  2. On the same VM, boot a Linux kernel from a virtual/real disc, so that the root filesystem is on the RAM instead of being your disk to be zerofreed. Install zerofree and apply it to the disk image.

Hope I'd helped you!

And, I as usually say, sorry if I'd made a mistake on my writing as English is not my mother tongue.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.