[hardy] ext3 filesytem dont take care of a big size file > of total partition size

Bug #201358 reported by marcobra (Marco Braida)
4
Affects Status Importance Assigned to Milestone
virtualbox-ose (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

On updated an ugraded Ubuntu 8.04 Hardy with a just checked ext3 filesystem
i'm trying to convert a vmware image to virtualbox image...

The vmdk vmware image is a 9 GB image file:
-rwxrwxrwx 1 ubuntu ubuntu 9778102272 2007-07-03 15:50 xpanna.vmdk ( 9.778.102.272 )

My hard disk is a ext3 /dev/sda2 72Gb total size

When i run this command:
qemu-img convert -f vmdk xpanna.vmdk -O raw xpanna.img

it run and i get this img file on disk:
-rw-r--r-- 1 ubuntu ubuntu 78652716032 2008-03-12 10:15 xpanna.img

This file have size of 78.652.716.032 > hard_disk /dev/sda2 total size > hard_disk /dev/sda2 free available space

but the system seems don't take care of this and write the file on itself.

When i run df -h i get... (please open the attached screenshot image)

Only when i try to convert the .img image to virtual box image with this command:
vboxmanage convertdd xpanna.img xpanna.vdi

i get the expected error:

....
Converting VDI: from DD image file="xpanna.img" to file="xpanna.vdi"...
Creating fixed image with size 78652716032 bytes (75010MB)...
Failed (VERR_DISK_FULL)!
...

Thank you

Revision history for this message
marcobra (Marco Braida) (marcobra) wrote :
Revision history for this message
marcobra (Marco Braida) (marcobra) wrote :
Revision history for this message
marcobra (Marco Braida) (marcobra) wrote :

Additional check, if i force a filesystem check with

sudo touch /forcefsck

Ubuntu check the ext3 filesystem and don't show any error.

Hope this helps, thank you.

description: updated
Revision history for this message
Russell Sears (sears) wrote :

There are three issues here. I think the bug is in virtualbox's vditool.

First, ext3 supports sparse files, which means that runs of zeros aren't actually stored anywhere on disk. The .img file is probably sparse, so the reported filesize is to be expected. You can check the actual size of a file with "du -h filename".

The next issue is that qemu-img created a very large file for some reason. If the image size was set to be 78GB in vmware, then qemu-img is behaving correctly as well.

Finally, (on my hardy system) vditool's converter from RAW files doesn't seem to consider sparse files when it decides whether or not it has enough space to convert a raw disk image to vdi format.

Marcoba's computer has 29GB free, and the vmware file is 9GB, so there should be enough space.

vditool should probably determine the true size of sparse dd image files (like du does) before refusing to convert the image, or at least provide a --force option.

Revision history for this message
Russell Sears (sears) wrote :

Oops; looks like I spoke too soon. It's not taking advantage of sparse files when it converts from DD formats:

$ vditool DD VistaQemu.vdi VistaQemu.bin
vditool Copyright (c) 2004-2008 innotek GmbH.

Converting VDI: from DD image file="VistaQemu.bin" to file="VistaQemu.vdi"...
Creating fixed image with size 0 Bytes...
The operation completed successfully!
Writing data...
The operation completed successfully!
sears@tachikoma:~$ du -h VistaQemu.vdi
17G VistaQemu.vdi
sears@tachikoma:~$ du -h VistaQemu.bin
13G VistaQemu.bin
sears@tachikoma:~$ ls -lh VistaQemu.bin
-rw-r--r-- 1 sears sears 16G 2008-04-29 18:39 VistaQemu.bin

(vditool SHRINK shrinks the file back down to 13G, as expected)

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this reproducible in the latest upstream version from Sun?

Changed in virtualbox-ose:
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in virtualbox-ose:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.