Compacting VDI file problem - mount: / is busy

Discussions related to using VirtualBox on Windows hosts.

Compacting VDI file problem - mount: / is busy

Postby abcuser » 31. Oct 2009, 20:25

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
abcuser
Volunteer
 
Posts: 558
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows XP

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

Postby Perryg » 31. Oct 2009, 22:24

You can try mpacks program CloneVDI Tool and see if it works. That way you can tell if it might be the encryption.
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Postby abcuser » 1. Nov 2009, 08:31

Perryg, I tried with ColoneVDI tool and it works fine, image compacted successfully.
Thanks.
abcuser
Volunteer
 
Posts: 558
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows XP

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

Postby lucasn » 30. Jun 2010, 03:11

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 :)
lucasn
 
Posts: 1
Joined: 30. Jun 2010, 03:05
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: ubuntu

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

Postby dendi_zg » 26. Jul 2010, 11:11

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.
dendi_zg
 
Posts: 5
Joined: 3. Apr 2009, 15:05
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Windows XP

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

Postby mpack » 26. Jul 2010, 22:00

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).
mpack
Site Moderator
 
Posts: 27892
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

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

Postby abcuser » 27. Jul 2010, 17:18

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).
abcuser
Volunteer
 
Posts: 558
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows XP

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

Postby mpack » 28. Jul 2010, 12:06

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.
mpack
Site Moderator
 
Posts: 27892
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

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

Postby abcuser » 4. Aug 2010, 19:21

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.
abcuser
Volunteer
 
Posts: 558
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows XP

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

Postby mpack » 5. Aug 2010, 14:23

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.
mpack
Site Moderator
 
Posts: 27892
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: Alecsis and 34 guests