Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

The place for all kinds of software for all kinds of operating systems.

Moderator: Dposcorp

Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 6:14 pm

Can someone please PLEASE help me with this. It's very critical as I am quickly running out of hdd space cuz the repository I am downloading via SVN was WAY WAY more gigs then I could have ever expected. And I need to expand this ASAP!
Last edited by thegleek on Thu Feb 23, 2012 6:21 pm, edited 1 time in total.
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40 or more!

Postposted on Thu Feb 23, 2012 6:21 pm

I am on version 4.1.8 r75467.

Here's a quick screenshot of the Storage:

Image

Which is a little misleading since it states I have 924mb free out of 19.9gb. And it's quickly going lower and lower (free space).

Not even sure if I can stop the SVN checkout without totally fubar'n everything up.
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 6:31 pm

Does it matter that the virtual storage is set to a "differencing" setting:

Image
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 6:49 pm

I don't think you can expand it while the system is running. You'll need to shut the VM down, use VBoxManage modifyhd to resize the virtual disk, then bring the system back up and resize the filesystem.

I don't think it'll work on a differencing disk either; I believe it needs to be a dynamic VDI without differencing.

Edit: Oh, crap it looks like you're running Windows? In that case the filesystem itself probably needs to be offline to do the expansion as well, so if this is the system disk you'll probably need to attach it to another VM (or boot the VM from a virtual CD) to expand the filesystem.

Edit 2: So AFAIK you will need to kill the SVN checkout, resize your disk, and restart the checkout.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 7:04 pm

just brew it! wrote:Edit 2: So AFAIK you will need to kill the SVN checkout, resize your disk, and restart the checkout.

Yup. This sucks man. An entire day wasted! BAH! So I cancelled the SVN checkout, went to this website:

http://www.virtualbox.org/manual/ch08.h ... -modifyvdi

...and performed this command on the latest snapshot image:

snapshot image wrote:UUID: 12c87ff4-cbcf-473d-bd59-2f84215be956
Parent UUID: a81a0893-fec2-4165-bd0f-6d023218c31c
Format: VDI
Location: C:\VIRTUAL MACHINES\win2k3\Snapshots\{12c87ff4-cbcf-473d-bd59-2f84215be956}.vdi
State: created
Type: normal
Usage: win2k3 (UUID: 32026ad2-d1ea-4a6b-81aa-1197df4552d3) [snapshop_022312 (UUID: e325c6bb-395f-4ad2-ad8c-77570 1edffb6)]

Code: Select all
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd 12c87ff4-cbcf-473d-bd59-2f84215be956 --resize 40960
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!


So that didn't work. Tried it out on the base image (which hasn't changed the modified date in years!?):

base image wrote:UUID: 60343b58-92d8-4c93-a5dd-1e178260673c
Parent UUID: base
Format: VDI
Location: C:\VIRTUAL MACHINES\My Server.vdi
State: created
Type: normal
Usage: win2k3 (UUID: 32026ad2-d1ea-4a6b-81aa-1197df4552d3) [GOOD IMAGE 8-3-11 (UUID: e9fa98a5-8933-46c5-9c92-45614 06e3a8c)]

Code: Select all
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd 60343b58-92d8-4c93-a5dd-1e178260673c --resize 40960
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%


Which did the trick! Shows as 40gb now. Lemme boot the vm up to see what damage I caused...
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 7:10 pm

Just FYI, the partition table (probably) and filesystem (definitely) will still have the old size. You'll need to expand the partition and filesystem (or create a new data partition in the additional space) to make use of it.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 7:54 pm

just brew it! wrote:Just FYI, the partition table (probably) and filesystem (definitely) will still have the old size. You'll need to expand the partition and filesystem (or create a new data partition in the additional space) to make use of it.

Stressing out over this stuff. I install Acronis Partition Expert and it only see's that hdd as 20gb. There's no expanding it!

So I google-foo'd some more and found this advice:

http://rodrigoguarischi.wordpress.com/2 ... rtual-box/

And proceeded to convert the hdd into a dynamic hdd:

Image

Image

Image

And it's rebooting... (fingers crossed)
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 8:04 pm

Whoa boy... I think I'm in trouble.

Image

I have no clue what to do now. My hdd is now a dynamic disk and there's still no hope in expanding this hdd (feature is greyed out when you right click on drive C:\) :evil:

Image
Last edited by thegleek on Thu Feb 23, 2012 8:07 pm, edited 1 time in total.
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 8:07 pm

Is there any way to get back to a Basic disk? I think gparted could handle it if it is a Basic disk.

Heck, gparted is probably still worth a shot. I've never tried it on a Dynamic disk though.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 8:07 pm

just brew it! wrote:Is there any way to get back to a Basic disk? I think gparted could handle it if it is a Basic disk.

Heck, gparted is probably still worth a shot. I've never tried it on a Dynamic disk though.

Nope. No way to go back once it's dynamic. Shall I just move to India now and live in exile?
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 8:10 pm

First do this: http://mypkb.wordpress.com/2007/03/28/h ... sic-disks/

Then try gparted.

You didn't back this VDI up before starting by any chance, did you?

Edit: Leaving the office now, so I won't be responding to this thread again until I get home.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 8:28 pm


Ok, I'm stuck on this screen:

Image

Cuz while I'm doing this while inside the vm (windows 2003 server), it lists 2 choices for the same damn hdd!

just brew it! wrote:Then try gparted.

You didn't back this VDI up before starting by any chance, did you?

Edit: Leaving the office now, so I won't be responding to this thread again until I get home.

Ah ok. No biggie. I'll just experiment and make my life worse. And no, I did not backup the vdi before doing all this crazy stuff! lol only made a snapshot.
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 8:35 pm

Now it's really getting crazy. Choice 1 (/dev/sda/) offers this:

Image

And choice 2 (Drive C:\) offers this:

Image

WTF?
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 9:11 pm

Ugh, that sucks. If possible, try the method in step 2 of that page I linked instead?

Edit: The first TestDisk screen looks reasonable. There appear to be step-by-step instructions on what to do with TestDisk at the bottom of that same web page?

Double edit: Couldn't hurt to back up that VDI now, just in case we make matters even worse!
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 10:12 pm

just brew it! wrote:Ugh, that sucks. If possible, try the method in step 2 of that page I linked instead?

Edit: The first TestDisk screen looks reasonable. There appear to be step-by-step instructions on what to do with TestDisk at the bottom of that same web page?

Double edit: Couldn't hurt to back up that VDI now, just in case we make matters even worse!

Ok testdisk worked! we're back to a basic hdd again! I'm NEVER converting to a dynamic hdd ever again in my life!!!! ARGH!

But... When i booted into gparted... it still shows the hdd as 20gb max. no way to extended it. I'm thinking cuz it's still loading my snapshot (20gb before i did the expand).
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 10:22 pm

Do you *need* the contents of that snapshot? I think we're gonna go around in circles until we get that out of the way.

If you don't need it, I'd back up the VDI (just to be safe), and revert/delete the snapshot.

If you need the contents of the snapshot, then what you probably ought to do is create a *new* 40GB virtual disk, attach that to the VM, boot from virtual Linux CD, and use dd to image the contents of the snapshot over to the "clean" VDI. Then you can run gparted on the copy to expand the partition, then swap the copy in as the boot drive for the VM.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 10:25 pm

just brew it! wrote:Do you *need* the contents of that snapshot? I think we're gonna go around in circles until we get that out of the way.

Yes.

just brew it! wrote:If you don't need it, I'd back up the VDI (just to be safe), and revert/delete the snapshot.

Cloning the snapshot now into a standalone vm. hopefully this does the trick?

just brew it! wrote:If you need the contents of the snapshot, then what you probably ought to do is create a *new* 40GB virtual disk, attach that to the VM, boot from virtual Linux CD, and use dd to image the contents of the snapshot over to the "clean" VDI. Then you can run gparted on the copy to expand the partition.

yup. this is next in line if the clone doesn't work out.
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 10:32 pm

thegleek wrote:Cloning the snapshot now into a standalone vm. hopefully this does the trick?

It should (I think). The only potential glitch that immediately comes to mind is WPA, if Windows decides that the clone is "different" enough. We'll cross that bridge if/when we come to it...
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Thu Feb 23, 2012 11:14 pm

just brew it! wrote:
thegleek wrote:Cloning the snapshot now into a standalone vm. hopefully this does the trick?

It should (I think). The only potential glitch that immediately comes to mind is WPA, if Windows decides that the clone is "different" enough. We'll cross that bridge if/when we come to it...

IT WORKED! OMFG. the stress is over. wow. this was absolutely insane for doing something so trivial and easy.. argh!

Image

Image

Image

Image

So cloning the snapshot vdi to another 20gb base vdi. then i re-sized that vdi again to 40gb. then booted up the windows. used the above partition program. and whalla!

also, no complaints at all about windows 2003 server WPA... clone must mean clone! :-)
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Fri Feb 24, 2012 8:01 am

Glad to hear you got it sorted!

At work we futz around with WinXP 64-bit VM images (XP 64-bit is the same code base as Server 2K3) an awful lot, since most of the SW group runs Linux as their native OS but corporate IT is still geared towards WinXP 64-bit for anyone they consider a "power" user. :roll: As long as we report the number of Windows VMs we're running during their periodic MS license audit, we're legal...

I've re-sized Windows images many times before at work (both shrink and enlarge), and never had the kind of problems you encountered. I think the lesson we've learned here is that snapshots really confuse things -- in the future, if you're using a differencing disk or snapshot, make a clean clone of the image into a fresh VDI first!

Also, another tip related to disk images: When you're using VirtualBox dynamic images, VirtualBox has the ability to compress any blocks that consist of only zeros, reducing the amount of host storage used. If you've got a disk image where you've deleted a whole lot of stuff, run something to fill the unused space with zeros, then do a "VBoxManage modifyhd --compact" to reclaim the space. To zero all of the unallocated space I do something like "dd if=/dev/zero of=junk.dat bs=32768; rm junk.dat". This works in Windows too if you install Cygwin.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Sun Feb 26, 2012 10:18 pm

Just wanted to give ya'll a final update on how LARGE the repository I was dealing with (no way of knowing beforehand - i guess! bah):

Image

^ That's the total size of the REPO folder I downloaded... Good thing I -did- stop it and increased it by +20gb, eh?
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Sun Feb 26, 2012 10:37 pm

So (if you don't mind saying) WTF is this repository anyway? It's too small to be a copy of the repository of a mainstream Linux distro, and too big to be pretty much anything else!

And you couldn't have done this by attaching a 2nd virtual data drive to the VM?
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Mon Feb 27, 2012 1:20 am

just brew it! wrote:So (if you don't mind saying) WTF is this repository anyway? It's too small to be a copy of the repository of a mainstream Linux distro, and too big to be pretty much anything else!

Haha.. it's the repo of my new position within my same company... Guess some folk really don't know how to "manage" a proper repo. Also, going from the luxurious TFS down to the pitiful and lowly SVN is quite backwards, but oh well.

I also notice they have 10-20 branches of the same software, but different QA revisions, man this is messy!

just brew it! wrote:And you couldn't have done this by attaching a 2nd virtual data drive to the VM?

Nah, what fun is that? I prefer single partitions for everything Windows-related. In linux-land, i prefer multiples.
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Mon Feb 27, 2012 6:52 am

SVN's actually not bad; it's what we use where I work. Are you at least using the TortoiseSVN Windows shell extension?
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Mon Feb 27, 2012 8:25 am

Wish I found this thread earlier, this is so easy to fix (albeit time consuming and takes a few different attempts to figure out the best solution)
Add a second virtual disk of desired size.
Load up an ISO as a virtual DVD / CD of Ghost / Acronis True Image / CloneZilla.

Clone small virtual disk 1 to larger virtual disk 2 - watch HDD thrash for 30 minutes.
Disable old virtual disk 1, make virtual disk 2 the only disk.

Done.
AbRASiON
Gerbil Team Leader
 
Posts: 274
Joined: Tue Mar 18, 2003 8:06 pm

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Mon Feb 27, 2012 8:49 am

AbRASiON wrote:Wish I found this thread earlier, this is so easy to fix (albeit time consuming and takes a few different attempts to figure out the best solution)
Add a second virtual disk of desired size.
Load up an ISO as a virtual DVD / CD of Ghost / Acronis True Image / CloneZilla.

Clone small virtual disk 1 to larger virtual disk 2 - watch HDD thrash for 30 minutes.
Disable old virtual disk 1, make virtual disk 2 the only disk.

Done.

Yeah, that's more or less the conclusion I arrived at about 8 posts back. :wink:

Problem was, he'd already gone and converted to a dynamic disk, and some partition management tools get confused by that (though I imagine Acronis and Ghost can probably deal with it).
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37964
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Mon Feb 27, 2012 10:18 am

just brew it! wrote:SVN's actually not bad; it's what we use where I work. Are you at least using the TortoiseSVN Windows shell extension?

yup! TortoiseSVN along with VisualSVN for MSVS2010. :-)
thegleek
Darth Gerbil
Gold subscriber
 
 
Posts: 7367
Joined: Tue Jun 10, 2003 11:06 am
Location: Detroit, MI

Re: Expand Oracle's VirtualBox hdd from 20gb to 40gb+!

Postposted on Mon Feb 27, 2012 10:38 am

AbRASiON wrote:Wish I found this thread earlier, this is so easy to fix (albeit time consuming and takes a few different attempts to figure out the best solution)
Add a second virtual disk of desired size.
Load up an ISO as a virtual DVD / CD of Ghost / Acronis True Image / CloneZilla.

Clone small virtual disk 1 to larger virtual disk 2 - watch HDD thrash for 30 minutes.
Disable old virtual disk 1, make virtual disk 2 the only disk.

Done.



I was thinking the same thing last night; that I wish I would have seen this thread sooner.
I always keep software from multiple vendors for drive copying, imaging and partitioning, cause I never know how many steps or what software it will take to achieve the result I am after.

I usually start with a pristine image, restore that to something, then start playing. I am sure gleek knows this as well, but knowing him, I know he likes to live on the wild side and take chances, which is why there was no VDI back up, no back up image, and full steam ahead with converting to dynamic disk. :)

Sometimes the disk clone wont work, which is another reason why i start out with that option.
Making a image will usually work, in which case I make the image, and then restore it to the new disk ( hardware or virtual disc).
During the restore I select the use all disk option so the image fills up the new disk.
Sometimes that wont work, so I restore to the same size, and use a partition tool to expand the partition.

Glad it worked out for you gleek.
Dposcorp
Minister of Gerbil Affairs
Silver subscriber
 
 
Posts: 2417
Joined: Thu Dec 27, 2001 7:00 pm
Location: Detroit, Michigan


Return to General Software

Who is online

Users browsing this forum: Bing [Bot] and 3 guests