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'm trying to use zerofree, which seems to be the answer for this: How to reduce VM size?

I have successfully umounted /dev/sda1, and zerofree worked fine, releasing ~37gb.

But I can't seem to umount or remount as read only /dev/mapper/mypc-root, it says:

umount: / is busy

or

mount: / is busy

The commands used were:

$ umount /dev/mapper/mypc-root
$ mount -no remount,ro -t ext2 /dev/mapper/mypc-root /

I'm in single user mode, entered it with 'init 1'.

The guest SO is Ubuntu 12, with encrypted LVM and home.

Any ideas?

share|improve this question

3 Answers 3

You could follow this post: http://unix.stackexchange.com/questions/42015/mount-is-busy-when-trying-to-mount-as-read-only-so-that-i-can-run-zerofree

In my case I did not want to worry with killing processes. Since I had two virtual machines in my VirtualBoX I mounted the disk of the VM i needed to compress on my other VM and zerofree it from that machine.

share|improve this answer

You can run the following command until it stops, then delete the created file.

dd if=/dev/zero of=/zero

This will create a file containing NUL bytes in the root directory that will use almost the entire free disk space.

(not useful on a virtual machine disk that pretends to have more space available than it actually has)

share|improve this answer

/ can't be unmounted from the system, as / is in use (thus the message you see) by the system itself.

You will need to do this procedure from a Live-CD.

share|improve this answer
3  
It cannot be unmounted, but it can be remounted read-only if there are no open files in write mode open. –  Michael Mar 27 '13 at 10:56

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.