VirtualBox crashes after increasing the storage size

Discussions about using Linux guests in VirtualBox.
Post Reply
whimsical1987
Posts: 6
Joined: 6. Apr 2013, 08:43

VirtualBox crashes after increasing the storage size

Post by whimsical1987 »

I cannot start my Ubuntu after expanding the harddisk. Installed the Ubuntu 12.04 with 30GB space and I ran out of space, so I used gparted live to expand the disk space. After doing that my partition table got corrupted I guess and I am not able to boot to my environment. VirtualBox keeps crashing, after several attempts, finally Ubuntu boots in read-only mode. I am not sure how to fix this. Please help me.

Code: Select all

sudo LANG=C sfdisk -d /dev/sda > sfdisk.txt
# partition table of /dev/sda
unit: sectors


/dev/sda1 : start=     2048, size= 67102720, Id=83, bootable
/dev/sda2 : start= 67104768, size= 16781312, Id= 5
/dev/sda3 : start=        0, size=        0, Id= 0
/dev/sda4 : start=        0, size=        0, Id= 0

Code: Select all

Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.


sfdisk: ERROR: sector 67104768 does not have an msdos signature

Code: Select all

sudo LANG=C fdisk -lu
sudo: unable to open /var/lib/sudo/portaldev/2: Read-only file system
Warning: invalid flag 0x0000 of partition table 5 will be corrected by w(rite)


Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00020bb7


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    67104767    33551360   83  Linux
/dev/sda2        67104768    83886079     8390656    5  Extended
Attachments
Capture.PNG
Capture.PNG (36.46 KiB) Viewed 4545 times
VBox.log
(66.12 KiB) Downloaded 12 times
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: VirtualBox crashes after increasing the storage size

Post by loukingjr »

I don't know if anyone can help you fix the problem but you can't use GParted to resize a virtual drive.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox crashes after increasing the storage size

Post by mpack »

As Lou says, gparted is a guest tool, it can't be used to affect host files, which is what is required to increase capacity. It looks as if you've somehow managed to corrupt the disk - if indeed the crash is related.

In any case, a VM log file might be helpful. See Minimum information needed for assistance.
whimsical1987
Posts: 6
Joined: 6. Apr 2013, 08:43

Re: VirtualBox crashes after increasing the storage size

Post by whimsical1987 »

I followed the instructions from this post viewtopic.php?f=6&t=46814

I attached VBox.log in my original post, let me know if you need anything more. Thanks !
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: VirtualBox crashes after increasing the storage size

Post by loukingjr »

whimsical1987 wrote:I followed the instructions from this post viewtopic.php?f=6&t=46814

I attached VBox.log in my original post, let me know if you need anything more. Thanks !
The post you followed says to resize the .vdi first, then use GParted to expand the partition.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
whimsical1987
Posts: 6
Joined: 6. Apr 2013, 08:43

Re: VirtualBox crashes after increasing the storage size

Post by whimsical1987 »

Sorry, for not being clear. I resized the .vdi disk file to 40Gb and then used gparted to resize the unallocated space.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: VirtualBox crashes after increasing the storage size

Post by loukingjr »

whimsical1987 wrote:Sorry, for not being clear. I resized the .vdi disk file to 40Gb and then used gparted to resize the unallocated space.
ahhh, that's different. :) in GParted all you should have had to do is drag the partition to fill up the unused space. I've only done it a few times but it always worked for me. did you try and move any partitions or type in a new size?
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox crashes after increasing the storage size

Post by mpack »

whimsical1987 wrote:I attached VBox.log in my original post
Oh, so you did. I couldn't see the wood for the trees.

You should have looked in the "Howto" area of this site, specifically Howto: Resize a Virtual Drive. Then you might have known that you absolutely must not attempt to resize a drive if you've used snapshots, which it appears (according to the log) that you have. Actually, the thread you referenced also mentions this.
whimsical1987
Posts: 6
Joined: 6. Apr 2013, 08:43

Re: VirtualBox crashes after increasing the storage size

Post by whimsical1987 »

ahhh, that's different. :) in GParted all you should have had to do is drag the partition to fill up the unused space. I've only done it a few times but it always worked for me. did you try and move any partitions or type in a new size?
I tried to move the partition from right to left before swap space. The extra 10gb space I created was on the right side after swap-space, so deleted the swap and moved to left to have single disk and created swap on the right. Did I mess up something in that process ? :(
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: VirtualBox crashes after increasing the storage size

Post by loukingjr »

well, mpack is certainly correct about not resizing a disk with snapshots. once you did that, nothing you did in GParted would matter.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
whimsical1987
Posts: 6
Joined: 6. Apr 2013, 08:43

Re: VirtualBox crashes after increasing the storage size

Post by whimsical1987 »

As far as I remember, I resized the latest snapshot.
So, I have to reinstall everything from the scratch. That sounds scary, I have lot of configurations to the application server, I have to spend redoing all that.. :(
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox crashes after increasing the storage size

Post by mpack »

It's hard to predict what the effect would be of resizing just a part of a snapshot chain. It depends on which chain element you picked on (the base VDI or one of the snapshots?), and it also depends very much on how much the snapshot was relying on underlying filesystem data structures remaining fixed. The fact that GParted saw a larger disk (if I understand your description correctly) implies that the change was visible to the current state, meaning it had propagated through the snapshot chain... which is probably bad news, as it implies that the entire chain is affected. This is assuming that you resized the base VDI.

The following lines from the log file look sinister as well.
VBox.log wrote: 00:00:11.178993 AHCI#0P0: Read at offset 34359099392 (4096 bytes left) returned rc=VERR_INVALID_PARAMETER
00:00:11.179238 AHCI#0: Port 0 reset
00:00:11.497135 AHCI#0P0: Read at offset 34359119872 (4096 bytes left) returned rc=VERR_INVALID_PARAMETER
00:00:11.497301 AHCI#0P0: Canceled read at offset 1228800 (4096 bytes left) returned rc=VINF_SUCCESS
In theory, something like this (a snapshot chain containing of elements of a wrong size) should not make VirtualBox crash, but the reality is sometimes different.
Post Reply