Problem with the size of VDI hard disk

This is for discussing general topics about how to use VirtualBox.
Post Reply
Josemari
Posts: 10
Joined: 23. Oct 2015, 17:05

Problem with the size of VDI hard disk

Post by Josemari »

Hello... first, excuse my english... and, this is my problem:

I'm working in a high school, and need change the configuration of many computers with the same hardware and operating system: Linux Mint 17.2 with several applications.

Usually I make the changes in one of the computers, make a image with Clonezilla, and then restore it in the rest of computers (with Clonezilla Server, booting the clients from LAN).

So, I would like make the changes in my home, but I don't whant bring one of the computers to home. So, I created one VM in VirtualBox, installed in my personal desktop with Linux Mint 17.2. This VM have a VDI drive, with the same size that the hard disks of the computers in the scholl = 80 GB.

Instead of install the OS in the VM, I restored the image of one of the computers (sda) in the VM (booting the VM with Clonezilla Live), and it was good.

Now, is possible make the necessary changes in the VM of home, and after make a new image (booting with Clonezilla Live again) from the VM, saving the directory with the image in a external hard disk.

On this way, the new image has the changes, and I only need restore it in the computers of the scholl, throw the LAN with Clonezilla Server (booting the clients from PXE).

Ok... finally, this the problem... when I restore the image, Clonezilla can't continue because the size of the image is 85 GB instead 80GB... I don't understand from where comes this 5GB.

I know that I can resize the VDI to 70 GB, for example, but my question is why there is 5GB more?. When I boot the VM there is 80GB, in the Virtual Media Administrator the VDI has 80GB... but if I boot the VM with gparted live, there is 3 partitions (sda1-/ sda5-/home sda6-swap) that sum 80GB... and THERE IS 5GB at the end of the hard disk, without partitions (?).

Any solutions, that do'nt need resize the VDI drive?.

Thak you.
MichaelTech
Posts: 8
Joined: 6. Sep 2015, 03:34
Primary OS: MS Windows 8
VBox Version: PUEL
Guest OSses: Windows 10, Ubuntu 15.10

Re: Problem with the size of VDI hard disk

Post by MichaelTech »

I can only solve this if you tell me the Host OS, The Guest OS, and the version of virtualbox
A master of tech
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with the size of VDI hard disk

Post by mpack »

Josemari wrote:Ok... finally, this the problem... when I restore the image, Clonezilla can't continue because the size of the image is 85 GB instead 80GB... I don't understand from where comes this 5GB.
At a guess, I'd say it's a misunderstanding about the meaning of "GB", added to a touching faith in the claims of hdd manufacturers.

VirtualBox uses binary quantities for everything: RAM and disk sizes.

1K in computing is 1024^1. Some people assume it means 1000. It never has.
1M in computing is 1024^2 = 1024K = 1048576 decimal. Not 1000000.
1G in computing is 1024^3 = 1024M = 1073741824 decimal. Not 1000000000.
80G is 80*(1024M) = 81920MB.

Plus HDD manufacturers like to obfuscate the issue. They deliberately abuse the above system because doing so allows them to claim higher capacities: e.g. they would claim at least "82GB" for the above drive. Add to this that hdd manufacturers commonly overstate their disk capacity for other reasons, e.g. they ignore space required for CRC checking etc, and they always round sizes upwards - so actual capacity will usually be less (sometimes a lot less) than claimed.

End result: if you create an 80G drive in VirtualBox it may be larger than an "80GB drive" installed in a PC, because VirtualBox gives you a drive with a true 80GB capacity, while your PC probably doesn't. All you can do is determine the actual size of the drive on the physical PCs, and make sure you use that size (or slightly smaller) in the VM.
Josemari
Posts: 10
Joined: 23. Oct 2015, 17:05

Re: Problem with the size of VDI hard disk

Post by Josemari »

Thank you for your response and sorry it took so long to respond. I still have the same problem and I have opened a topic in the Clonezilla forum to see if it has a solution.

As for your answer, I thank you and that may be the explanation, but the solution is not worth it. If I make the virtual disk larger than the physical one, when I make the image of the virtual machine later, the image will not be restorable on the physical machine because the physical disk will be recognized as smaller than the virtual one. What I am doing is shrinking the partitions and the virtual disk afterwards, to finally make an image of the virtual machine that is indeed restorable. It works but it takes time to do.

Finally I would like to know how I can close a topic in this forum, because after so much time it is no longer worth it. Thanks again.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with the size of VDI hard disk

Post by mpack »

Josemari wrote: Finally I would like to know how I can close a topic in this forum
You don't. This is not a private support ticket, these are discussion forums, and we generally don't prevent discussions.
Post Reply