Page 1 of 1
[URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 10:40
by MarkoSiroki
Dear Sirs and Madams!
I've created .vdi image of Windows 7 Ultimate, hosted on Windows 7 Ultimate. I needed a lost of extra space in .vdi image because I am migrating some database to mysql server. I've resized this .vdi image from 400gb to 800gb with
vboxmanager modifyhd --reisize 800000 command and it worked fine. But now I cannot boot image, because I get following error:
A disk read error occured! Press Ctrl+Alt+Delete to restart!
In .vdi image I have 4 months of hard work, because database to be migrated to mysql server is huge and I desperatly need heelp! I HOPE I DID NOT LOOSE ANY DATA!!!
Plese help me and sincerely yours,
Marko
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 12:22
by mpack
How could you lose data? You said this was just an image of another disk, itself a migration of another database, right?
Anyway, the most common mistake here is to apply "modifyhd --resize" in a VM that uses snapshots - that will not work.
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 12:41
by MarkoSiroki
mpack wrote:How could you lose data? You said this was just an image of another disk, itself a migration of another database, right?
Anyway, the most common mistake here is to apply "modifyhd --resize" in a VM that uses snapshots - that will not work.
My host system is Windows 7 Ultimate (64 bit). I was forced to build virtual box with Windows 7 Ultimate (32 bit) - guest system - because of ODBC drivers, which do not support 64 bit version. I do NOT use snapshots, I just wanted to resize .vdi image (Windows 7 Ultimate 32bit) like several times before (I had been doing resize of win732bit several times because mysql database inside virtualbox grew and grew). Now, after last resize, I got error from first post. How do I boot resized Windows 7 32 bit image, i.e., how do I get rid of error, described from first post?
Sincerely,
Marko
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 15:42
by mpack
I'm afraid I don't know how that error was caused by the resize command, if snapshots were not involved. I'm assuming it was working as a VirtualBox VM before the resize?
Anyway, there are no magic answers: the only way I know to fix corruption like this is to restore from a backup.
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 15:53
by MarkoSiroki
mpack wrote:I'm afraid I don't know how that error was caused by the resize command, if snapshots were not involved. I'm assuming it was working as a VirtualBox VM before the resize?
Anyway, there are no magic answers: the only way I know to fix corruption like this is to restore from a backup.
Baaaaad news! I think I know how did I cause this error: In --resize parameter I have given by mistake value 800000 (800gb), but I had only 560000 (560 gb) free. Could --compact option help?
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 16:05
by mpack
MarkoSiroki wrote:I think I know how did I cause this error: In --resize parameter I have given by mistake value 800000 (800gb), but I had only 560000 (560 gb) free. Could --compact option help?
That would not cause a problem. Setting the drive size to larger than the host partition size may not be ideal, but in fact is only a problem if you then proceed to fill the virtual drive to breaking point. But in that case the drive would have been working after the resize, whereas your original post said that the failure was immediate following the resize.
No, I don't see how compaction would help here.
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 17:10
by MarkoSiroki
mpack wrote:MarkoSiroki wrote:I think I know how did I cause this error: In --resize parameter I have given by mistake value 800000 (800gb), but I had only 560000 (560 gb) free. Could --compact option help?
That would not cause a problem. Setting the drive size to larger than the host partition size may not be ideal, but in fact is only a problem if you then proceed to fill the virtual drive to breaking point. But in that case the drive would have been working after the resize, whereas your original post said that the failure was immediate following the resize.
No, I don't see how compaction would help here.
Ok, I agree, but it is strange virtual box opens .vdi file and in its settings screen (shortcut Ctrl+S) under Storage section I have Virtual Size set to 810 GB and 330 GB set to Actual Size, could this be a problem?
And if I try to reduce size of image with --resize option, I get following error:
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!
Sincerely,
Marko
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 17:33
by mpack
MarkoSiroki wrote:Ok, I agree, but it is strange virtual box opens .vdi file and in its settings screen (shortcut Ctrl+S) under Storage section I have Virtual Size set to 810 GB and 330 GB set to Actual Size, could this be a problem?
No, it is normal for a dynamically allocated type VDI to have an actual size less than its maximum size, in fact that's why the feature exists, i.e. so that simulated empty disk space need not take up actual host disk space. Only fixed type VDIs have actual size == maximum size, and those can't be resized so don't apply here. Unless 330GB is the host partition size then I don't see how any of this can be your problem.
MarkoSiroki wrote:And if I try to reduce size of image with --resize option, I get following error:
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage.exe: error: Resize hard disk operation for this format is not implemented yet!
As explained in the user manual, "modifyhd --resize" can only be used to expand (not shrink) the disk capacity.
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 17:38
by mpack
Incidentally, was the VDI file ever located on a FAT32 formatted drive? As you know, FAT32 has a 4GB file size limit, so manipulating a VDI while it's located on a FAT partition could potentially have all sorts of unfortunate consequences. One would hope that the software gracefully refuses to do anything silly... but I wouldn't bet on it.
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 4. Sep 2012, 18:16
by MarkoSiroki
mpack wrote:Incidentally, was the VDI file ever located on a FAT32 formatted drive? As you know, FAT32 has a 4GB file size limit, so manipulating a VDI while it's located on a FAT partition could potentially have all sorts of unfortunate consequences. One would hope that the software gracefully refuses to do anything silly... but I wouldn't bet on it.
Nope, I double checked target filesystem before creating .vdi image cca. 4 months ago. It was ntfs file system. I will now try to copy while image to newly bought hdd (1 terabyte, which was formatted with NTFS filesystem by me 30 min ago) and then retry resize operation, it will have enough space for resizing image and will then report.
Re: [URGENT]Cannot boot .vdi image after resize[URGENT]
Posted: 5. Sep 2012, 09:33
by MarkoSiroki
I managed to save the data!
It seems when I passed to big size parameter to modifyhd, the windows got corrupted. In failed .vdi then I've assigned second drive (GParted LiveCD) and through this tool I've managed to access ntfs partition and copy it as new .vdi image to new disk without OS. How do I apply os to this new .vdi image without destroying data?