Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Discussions related to using VirtualBox on Linux hosts.
AnnNing
Posts: 10
Joined: 10. Aug 2021, 09:09

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by AnnNing »

@fth0 Well, I failed to clone/export the current state VM, and had no idea how to back up it otherwise :(

I'm not sure mini size the virtual disk image could do any good, but I certainly will give a try. The Gparted was on the guest not the host, so it won't be any mistake.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by fth0 »

AnnNing wrote:how to back up it otherwise
Simply make a copy of the whole OdorMatrix folder. If any experiment goes wrong, you can simply copy it back. Note that no VirtualBox software should be running when copying it back.
fth0 wrote:If this doesn't work, try his suggestion number 3., and use only the VBoxManage command (not gparted) to resize the virtual disk images that still have a virtual size of 20 GB.
AnnNing wrote:I'm not sure mini size the virtual disk image could do any good
Please re-read. I've been talking about enlarging the snapshot images, so that all images have the same virtual size of 2 TB.
AnnNing
Posts: 10
Joined: 10. Aug 2021, 09:09

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by AnnNing »

fth0 wrote:I've been talking about enlarging the snapshot images, so that all images have the same virtual size of 2 TB.
Oh, I tried that before, using the manager UI. But it didn't work and cause a error. What's worse, all the other VMs were been shutdown, the manager relaunched.

Error Info:

Code: Select all

Failed to resize the storage unit of the hard disk /home/.../{xxx}.vdi from 20.00 GB to 2TB.
Callee RC: NS_ERROR_ABORT(0x80004004)
AnnNing
Posts: 10
Joined: 10. Aug 2021, 09:09

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by AnnNing »

I've been thinking, is there been anything way, changing some file or some settings or something like that, so I can start the guest (20G now is really ok) and get access to my database? Migrating database would just be fine.

If that is not possible, I may have to back to one of those snapshots, take the whole thing as a lesson, and move on.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by mpack »

Most of the potential recovery options have been made much more difficult by the decision to (a) use snapshots at all, (b) make the logical drive size 2TB - making it very hard to make backups, which in turn makes most repair attempts into risky propositions. Being on a Linux host complicates other options too (i.e. the best tool for this job is designed for Windows).

Anyway, the route I would suggest is :
  1. Install Wine, which then allows you to ...
  2. Run CloneVDI, which you then use to try...
  3. Cloning the most recent snapshot - do NOT clone the base VDI. The clone should be saved to some drive which has enough space.
I frankly don't know if CloneVDI will like seeing that modulating drive capacity as it goes down the snapshot list. If it's happy then it will create a merged VDI, hopefully with a 2TB capacity. You can then build a new VM around the clone VDI (do NOT add it into the old VM). Then never ever use snapshots again, and also consider your backup strategies before choosing such large drive sizes in future.
AnnNing
Posts: 10
Joined: 10. Aug 2021, 09:09

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by AnnNing »

First of all, @mpack @fth0, thank you very much. Now I know when and where I did wrong, I'll avoid that in the future.

@mpack I'll try your way after migrating other VMs( I was planning to do it anyway, when I got the time). Success or not, I'll post the result afterwards.

Thank you again.
AnnNing
Posts: 10
Joined: 10. Aug 2021, 09:09

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by AnnNing »

Hi guys. It's been a long time since we last discussed this issue. It happened that I had to resize a disk of another VM today, so I run some tests, finally figured out how to solve it .

This is the gist of Vdi Info we talked about last time which cause the problem.

Code: Select all

Name                                            Virtual Size       Actual Size
main.vdi                                          2.0 TB            5.86 GB
    caputre1.vdi                                  20 GB            11.62 GB
        caputre2.vdi                              20 GB             1.49 GB
            caputre3.vdi                          2.0 TB             3.11 GB
                caputre4.vdi(current)             2.0 TB              41 MB
Last time I resize caputre4.vdi(current) first, main.vdi second, it didn't work.

Today I resize main.vdi first, it doesn't work. GParted show there is no extra space. Then I resize caputre4.vdi(current). The same error occur ,just like the last time;

Then I resize every vdi on tree, luck for me, it worked.

I used the same method to size the disk of another virtual machine, it worked too.

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

Re: Ubuntu in VirtualBox can’t start after gparted resize disk while i see there is enough space

Post by mpack »

AnnNing wrote: Then I resize every vdi on tree, luck for me, it worked.
Not luck. This is precisely what you were instructed to do above (step 3 in my 4 step suggestions list, later agreed by fth0 as well).
Post Reply