Page 1 of 1

Compacting VDI file problem - mount: / is busy

PostPosted: 31. Oct 2009, 20:25
by abcuser
Hi,
I would like to compact VDI file on Ubuntu 9.10 guest running on top of Windows XP sp3 host using VirtualBox 3.0.10.

I have followed tutorial (written by me :? ) about compacting VDI files: http://wiki.virtualbox.org/page/User:Abcuser/compactVDI, but when I execute command: mount -n -o remount,ro -t ext2 /dev/sda1 /
I get error message: "mount: / is busy".

This instructions were working fine on previous version of Ubuntu and VirtualBox - but I have upgraded both the same day, so I don't know which one is causing the problem. :|

Any idea what is wrong? By the way, during install of Ubuntu I have selected to encrypt my home directory - is this source of the problem now?
Regards

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 31. Oct 2009, 22:24
by Perryg
You can try mpacks program CloneVDI Tool and see if it works. That way you can tell if it might be the encryption.

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 1. Nov 2009, 08:31
by abcuser
Perryg, I tried with ColoneVDI tool and it works fine, image compacted successfully.
Thanks.

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 30. Jun 2010, 03:11
by lucasn
I ran into the same problem with Ubuntu. I managed to get the root disk remounted read-only by:

* Hit 'esc' during boot and select the 'recovery mode' option
* Choose the 'root' option to 'Drop to a root shell prompt'
Code: Select all   Expand viewCollapse view
service rsyslog stop
service network-manager stop
killall dhclient

* Now the
Code: Select all   Expand viewCollapse view
mount -n -o remount,ro -t ext3 /dev/sda1 /
command works for me

Hope that might help anyone else who stumbles onto this page from a search :)

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 26. Jul 2010, 11:11
by dendi_zg
I had similar problem and found a not very good, but working workaround.

1. Copy VDI file and set it a new ID.
2. Add copied VDI to virtual disks and than to VM as second disk.
3. Run Ubuntu, go to telinit 1 state
4. Mount slave readonly (no remount) and run zerofree on that mounted second disk.
(in my case master VDI was sda1, but when I added second disk, master became sdb1 and slave sda1).

I tried the solution with filling free space with zeroes using "dd", but it made my disk grow to its full size, and compact for some reason didn't work. Not very practical with 60G and larger disks. :-)

Hope it helps someone.

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 26. Jul 2010, 22:00
by mpack
dendi_zg wrote:Hope it helps someone.

Well your efforts are appreciated, but better advice was given already in this thread. CloneVDI would do in a few minutes what your method undoubtedly takes considerably (like about x10) longer to do. Your method would be one of last resort, eg. if the guest was anything other than Dos/Win98(FAT), Windows(NTFS) or Linux(EXT).

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 27. Jul 2010, 17:18
by abcuser
mpack wrote:Your method would be one of last resort...

I agree with you that CloneVDI is excellent tool, I like it very much. But CloneVDI only works on Windows hosts. I know WINE can be used on Linux (I have tried this option and it works just fine without any problem) but one of administrators in our company forbid to install Wine on Linux host, so the only option is 10-times more time consuming task... It would be nice if this CloneVDI application would work on Linux host without any additional install of software like Wine. You know installing Wine to run CloneVDI in hard disk usage is in 100 : 1 (or even more, haven't checked out).

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 28. Jul 2010, 12:06
by mpack
abcuser wrote:It would be nice if this CloneVDI application would work on Linux host without any additional install of software like Wine

Not much chance of that - it's a Win32 application, and that's all there is to it.

I don't understand your employers reluctance to install Wine: I bet he has no problem with installing other GUI platforms - so basically it's a "not invented here" sulk with absolutely no rational basis. I feel no desire to cater for that kind of stupidity.

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 4. Aug 2010, 19:21
by abcuser
mpack wrote:I don't understand your employers reluctance to install Wine
They are afraid to bring viruses to Linux box. It probably can't hurt Linux, but can help spreading worms & viruses to other Windows machines.

One other solution (that I have already used) is to copy vdi file from Linux box to Windows box, do a compacting with CloneVDI file and copy it back to Linux box. This can be time consuming and can be done only with virtual machines that are not needed to be up 24/7.

Re: Compacting VDI file problem - mount: / is busy

PostPosted: 5. Aug 2010, 14:23
by mpack
abcuser wrote:One other solution (that I have already used) is to copy vdi file from Linux box to Windows box

Well, another solution of course is to run CloneVDI inside a Windows VM, compacting VDIs accessed in a shared folder. I would look to using VirtIO networking for the best possible performance.