I have set up an Ubuntu 18.04 Server in VirtualBox. I've installed zerofree in it and want to clean things before I do my compressing and backup.
Normally, here is how it worked (in the Ubuntu 14.04 LTS server virtual machines I have):
1. Boot into recovery mode.
2. Log in
3. mount -n -o remount,ro -t ext4 /dev/sda1 /
4. zerofree -v /dev/sda1
Now, I get as far as step 3 in the 18.04 box and I get a notice that the mount point is busy.
I've tried to use "service [service-name] stop" to stop everything (rsyslog, apache2, proftpd, fail2ban, exim4, mysql). Those stopped but it still said the mount point is busy.
I've turned off and removed the swap file and changed swappiness to 0 (keep in mind in all this I did reboot to be sure changes too effect). Still getting mount point busy.
I've tried to 'killall dhclient' (one old server I had to use 'killall dhclient3') Tried both and was told those services weren't installed/found.
I've tried to do 'service network-manager stop' and was told that the service wasn't installed/found.
I've tried to do 'ps aux | grep root' but I didn't find anything (I'll post the output below).
I did do a mount | grep "sd" and found that / is mounted on /dev/sda2 so I did the 'mount -n -o remount,ro -t ext4 /dev/sda2 /' and mount point is busy (same if I do mount -n -o remount,ro /dev/sda2 /". If I try zerofree it says that the device is mounted rw and won't run.
I went into fstab (had to in order to comment out the swap file part to turn off swap) and found that the only other entry is the one for / but it starts with UUID= and a long number.
I've even tried to go into single-user mode. But no matter what I tried, the mount point is busy.
At this point, I'm stumped. Has anyone got this to work in an 18.04 server virtual machine?
Normally, here is how it worked (in the Ubuntu 14.04 LTS server virtual machines I have):
1. Boot into recovery mode.
2. Log in
3. mount -n -o remount,ro -t ext4 /dev/sda1 /
4. zerofree -v /dev/sda1
Now, I get as far as step 3 in the 18.04 box and I get a notice that the mount point is busy.
I've tried to use "service [service-name] stop" to stop everything (rsyslog, apache2, proftpd, fail2ban, exim4, mysql). Those stopped but it still said the mount point is busy.
I've turned off and removed the swap file and changed swappiness to 0 (keep in mind in all this I did reboot to be sure changes too effect). Still getting mount point busy.
I've tried to 'killall dhclient' (one old server I had to use 'killall dhclient3') Tried both and was told those services weren't installed/found.
I've tried to do 'service network-manager stop' and was told that the service wasn't installed/found.
I've tried to do 'ps aux | grep root' but I didn't find anything (I'll post the output below).
I did do a mount | grep "sd" and found that / is mounted on /dev/sda2 so I did the 'mount -n -o remount,ro -t ext4 /dev/sda2 /' and mount point is busy (same if I do mount -n -o remount,ro /dev/sda2 /". If I try zerofree it says that the device is mounted rw and won't run.
I went into fstab (had to in order to comment out the swap file part to turn off swap) and found that the only other entry is the one for / but it starts with UUID= and a long number.
I've even tried to go into single-user mode. But no matter what I tried, the mount point is busy.
At this point, I'm stumped. Has anyone got this to work in an 18.04 server virtual machine?