modifyhd doesn't work properly

Discussions related to using VirtualBox on Windows hosts.

modifyhd doesn't work properly

Postby coleriv » 28. Dec 2011, 17:17

Hi to everybody.

It's my first post here and, unfortunately, it's for a problem. I use VB 4.1.6 on Win7 and the guest OS is WinXP. Today I've changed the dimension of the HD, from 6Gb to 10Gb using this command:
Code: Select all   Expand viewCollapse view
VBoxManage modifyhd WinXP_Shrew.vdi --resize 10240


After this, in the details of the VM I see the disk is exactly 10Gb, but in the guest OS, using a partition manager tool, I see always a 6Gb HD. :(

Any idea?
coleriv
 
Posts: 3
Joined: 28. Dec 2011, 16:10
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win XP

Re: modifyhd doesn't work properly

Postby mpack » 28. Dec 2011, 17:55

The "modifyhd --resize" command only changed the disk size, not the partition size. Use the gparted live CD - or other partition manager if you already have one - to resize the partition to fill the new drive.

Note also that the resize command cannot enlarge a drive that includes snapshots.

You probably would have found the CloneVDI tool (see sticky at top of this forum) easier to use. It could have done drive and partition enlargement in the same step.
mpack
Site Moderator
 
Posts: 30060
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: modifyhd doesn't work properly

Postby coleriv » 28. Dec 2011, 18:24

Hi mpack. First of all I give you my compliments for your tool; be sure I'm going to use it the next time I need! :mrgreen:

I'm doing some try and your answer is the confirmation I expected: it's not possible to resize "snapshotted" drive. :(
I think they should specify this restriction in the manual... :?

However I've still some doubt. I suspected that resizing could have some problem with a drive the included snapshots, so, before proceding, I deleted all snapshots (I had 2). This should have merged all modifications, shouldn't it? After this, in the vdi manager I expected to find only 1 UUID for my drive. On the contrary, there were 2 UUID and, after having detached and attached again the drive (a try to find my hidden 4Gb) I lost all modifications and my OS was in the "after installation" status, but the drive was now 10Gb big! Moreover, in the vdi manager, I found a new UUID, so 3 in all. This behaviour is driving me crazy. :evil:

So, how can I merge the 2 UUID to get my original drive?
coleriv
 
Posts: 3
Joined: 28. Dec 2011, 16:10
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win XP

Re: modifyhd doesn't work properly

Postby mpack » 29. Dec 2011, 13:17

I will say right up front: now that you have been messing with it, it may not be possible to recover your mods. After you deleted all your visible snapshots, you were left with the base VDI plus a "current state" VDI in the snapshot folder. For the current state to be valid, the base VDI it relies on has to be frozen. By deattaching and reattaching the drive you forced the VM to unfreeze and use the base VDI... if you booted up the VM then you almost certainly caused the base VDI to be modified, corrupting the data the current state relies on.

If the data was perfect then you would simply need to use the CloneVDI tool to clone the current state VDI. This would produce a merged standalone clone containing the latest data.

However. All we know is that the drive might be corrupted. The level of corruption is unknown. You can go ahead and use CloneVDI as suggested, and see where you are. If you can get it to boot then run "chkdsk/f" on the drive to look for corruption. If you can't get it to boot then hook up the clone drive to another Windows VM and chkdsk the drive from the other VM.

No promises.
mpack
Site Moderator
 
Posts: 30060
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: modifyhd doesn't work properly

Postby coleriv » 29. Dec 2011, 15:10

Hi mpack, thanx for your answers and your willingness. I thought that after deleting the snapshots I would have got a consistent vdi, with all modifications merged. And, actually, it worked in this way. Only after the detach/attach I got the surprise. :?

Well, I'm going to test your tool to see what happens. I'll make you know.

Bye and thanx again!
coleriv
 
Posts: 3
Joined: 28. Dec 2011, 16:10
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Win XP


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 39 guests