I am trying to run zerofree
on Ubuntu 11.04 so that I can compact the VirtualBox vdi image using:
VBoxManage modifyhd Ubuntu.vdi --compact
In order to run zerofree
the disk image has be mounted as read-only. I'm following these instructions which says to use this to remount as read-only from the recovery mode (Drop to root shell prompt):
mount -n -o remount,ro -t ext2 /dev/sda1 /
But when I do this I get the error:
mount: / is busy
Any ideas on how to do this?
Follow up: Following Jari's answer and this post by running these commands resolves the issue.
service rsyslog stop
service network-manager stop
killall dhclient
telinit 1
and that solved the problem for me.