Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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

share|improve this answer

Your Answer

 
discard

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.