R
R
Ruslan Leviev2013-02-01 08:41:51
Debian
Ruslan Leviev, 2013-02-01 08:41:51

Media Overflow (HDD) in VirtualBox

To test developments, I keep Debian 6 OS in VirtualBox with a standard set of installed server programs (nginx, mysql, php-fpm, memcached, etc.). I took the Debian image for VirtualBox ready from torrents. Accordingly, the virtual media was marked in the image in advance, with a size of 8 GB.

For a long time I successfully used this virtual machine, uploaded developed projects there (launched a local server from VirtualBox), some of these projects were with rather large databases (1-2 GB.)

Today, in the process of uploading another large database to the virtual machine, the import was suddenly interrupted by an error. After that, the server console started (by itself, without pressing anything) to issue Exception errors, a memory access error, and something like that. Then the console and the server finally hung up. The console did not respond to any commands, it was impossible to turn off the virtual server through VirtualBox itself. It was possible to turn off the server along with VirtualBox only through Ctrl + Alt + Delete.

Now, when trying to run the image with the server, the download hangs at the following point:

Loading, please wait...
mount: mounting none on /dev failed: No such device
W: devtmpfs not available, falling back to tmpfs for /dev
INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
Starting the hotplug events dispatcher: udevd.
Sunthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated..._


By all indications, it seems to me that the reason is the overflow of the virtual hard disk (8 GB). This causes some misunderstanding for me in view of the fact that in the image settings the media is designated as “dynamically expanding” :
virtual box

Plus, it clearly shows that there is at least another 3 GB. free (however, we will discard this moment from the assumption that the rest of the space is eaten up by the swap at startup).

The question is: is it possible to somehow change the size of the virtual media (put, say, not 8, but 40 GB) of the image after this image has started to be used? I didn't find it anywhere in the settings. Or is it just by deleting the image from VirtualBox and re-creating a new image with the right size?

If it matters, then VirtualBox used version 4.2.0, now updated to 4.2.6 - nothing has changed. The main OS on the computer from under which VirtualBox is launched is Windows 7.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Man1aca1, 2015-04-10
@Man1aca1

So, to increase the size of the virtual disk, we need to do the following. Open the command line (Win-R - cmd - OK) and go to the directory in which we have installed VirtualBox (if you did not change the path suggested during installation, this will be the C:\Program Files\Oracle\Virtual Box folder). Now we will get information about the virtual disk VDisk.vdi we need with the command:
VboxManage.exe showhdinfo C:\VMDISK\VDisk.vdi
(this command assumes that the path to our virtual disks is C:\VMDISK and the disk we need is called VDisk.vdi)
In the results output by the command, there is a line Logical size in which the maximum size of the disk is indicated. Now let's try to increase the disk size, for example, up to 40 GB (40960 MB) with the command:
VboxManage.exe modifyhd C:\VMDISK\VDisk.vdi −− resize 40960
Once again, display information about the disk with the command:
VboxManage.exe showhdinfo C:\VMDISK\VDisk.vdi
And make sure that the Logical size line shows the new value of the maximum disk size.
After increasing the maximum virtual disk size with the above commands, we need to log into the guest system and use the guest operating system to increase the size of the logical disk.

M
max_mara, 2013-02-01
@max_mara

“Dynamically expanding” means up to some specific size. That is, if you have a limit of 8 gigabytes, then the image file on the disk will take, say, only 2 gigabytes, and if the size of the machine grows, then the image file grows to 8 gigabytes, but no more.
What I would try to do is add another SATA image in the "Storage" section, start the machine in single-mode, mount a new disk and move all the data that takes up space there.

L
LordGlue, 2013-02-01
@LordGlue

Usually, they create a new empty screw for 200-500 GB, connect it to the machine and connect any liveCD with a program like Acronis, GParted - any one that works with disks. Boot from the liveCD and copy the old screw to the new one. The machine is turned off, the old one is removed, leaving only the new screw.

A
Anisotropic, 2013-02-01
@Anisotropic

If the place really ran out there, then increasing it is a matter of a minute:
0. make a copy of the VHD for every fireman
1. run diskpart.exe
2. write in it
select vdisk file="full path to the file"
expand vdisk maximum="size in mb"
3. increase the size of the volume in debiane, for this, apparently, you will have to boot into livecd

A
astrobeglec, 2013-02-01
@astrobeglec

I had exactly the same error when there was not enough space on the host partition on which the virtual disk lay (in my opinion, less than the dynamic one required for full capacity).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question