VirtualBox

Opened 16 years ago

Closed 15 years ago

#943 closed defect (fixed)

VBoxManage convertdd creates corrupted images

Reported by: Alban Browaeys Owned by:
Component: other Version: VirtualBox 1.5.2
Keywords: Cc:
Guest type: other Host type: other

Description

Using VBoxManage convertdd <myimage_of_disk_created_via_dd> output.vdi creates output.vdi with the right size and seemingly some data in there but the culprit may be that the partition table get corrupted. This was an image made via dd from a disk with a single ntfs partition. I could send you the image if needed (2.3G though and my upload is 60k)

Regards Alban

Attachments (6)

VBox.log (94.0 KB ) - added by Leonardo de Almeida Dias 15 years ago.
Vbox.log
VBox.png (959 bytes ) - added by Leonardo de Almeida Dias 15 years ago.
Vbox.png
vbr.dd (512 bytes ) - added by Leonardo de Almeida Dias 15 years ago.
MBR of Virtual Disk
mbr.dd (512 bytes ) - added by Leonardo de Almeida Dias 15 years ago.
MBR of the hard disk image file
bughunter2_fdisk.txt (215 bytes ) - added by Jelle Geerts 15 years ago.
bughunter2_mbr.bin (512 bytes ) - added by Jelle Geerts 15 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 by Frank Mehnert, 16 years ago

Please post the exact command(s) you used to create <myimage_of_disk_created_via_dd>.

comment:2 by Alexander Schaber, 16 years ago

Hello, I've tried to use this command to extract one partition into a vdi image

sudo dd if=/dev/sda1 | VBoxManage convertdd stdin /media/disk/C.vdi 62277025792  

Unfortunately if I try to boot the image the vm screen turns black after the bios went through. After that no more access to hd (according to the icon in vbox).

comment:3 by Frank Mehnert, 16 years ago

Uranellus, this cannot work because the OS would miss the partition table. You must copy the whole hard disk in every case. Or use a .vmdk container to use the host disk in your guest, see the user manual for more explanations.

comment:4 by Frank Mehnert, 16 years ago

Resolution: worksforme
Status: newclosed

No response, closing.

comment:5 by Leonardo de Almeida Dias, 15 years ago

Resolution: worksforme
Status: closedreopened

Frank,

I am having the same problem as Uranellus.

I copy a hole disk with dd as you told. I tried three diferents images, but the problem persists.

What could be wrong?

comment:6 by Leonardo de Almeida Dias, 15 years ago

See Vbox.log and Vbox.png attached files.

by Leonardo de Almeida Dias, 15 years ago

Attachment: VBox.log added

Vbox.log

by Leonardo de Almeida Dias, 15 years ago

Attachment: VBox.png added

Vbox.png

comment:7 by Steve Dodd, 15 years ago

Random thoughts: boot a live CD image in a VM with the problematic VDI attached, and do some basic checks: is it the right size? (blockdev --getsz gives sector count); is the partition table there? (fdisk -l); can you mount the partitions?

If booting is an issue, looking at/comparing the MBR (first sector of the HD/image) and VBR (first sector of the partition) might be instructive:

dd if=/dev/[sh]da bs=512 count=1 | hd | less
dd if=/dev/[sh]da1 bs=512 count=1 | hd | less

comment:8 by Leonardo de Almeida Dias, 15 years ago

I booted normaly with a Ubuntu Live CD.

Here is the result of fdisl -l:

root@ubuntu:~# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xda5cda5c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2550    20482843+   7  HPFS/NTFS
/dev/sda2            2551        9728    57657285    f  W95 Ext'd (LBA)
/dev/sda5            2551        9728    57657253+   7  HPFS/NTFS
root@ubuntu:~# 

The size of disk looks to be wrong. Should it be the same size of the original image (80g)?

root@ubuntu:~# blockdev --getsz /dev/sda
156301488

The partition was mounted normaly:

root@ubuntu:~# mount /dev/sda1 /mnt/sda1
root@ubuntu:~# ls /mnt/sda1/
Age Of Empires II       PPS            sqmnoopt00.sqm
Arquivos de programas   Programas      sqmnoopt01.sqm
AUTOEXEC.BAT            RECYCLER       sqmnoopt02.sqm
$AVG8.VAULT$            sqmdata00.sqm  sqmnoopt03.sqm
Bootfont.bin            sqmdata01.sqm  sqmnoopt04.sqm
boot.ini                sqmdata02.sqm  sqmnoopt05.sqm
CONFIG.SYS              sqmdata03.sqm  sqmnoopt06.sqm
DIVX                    sqmdata04.sqm  sqmnoopt07.sqm
Documents and Settings  sqmdata05.sqm  sqmnoopt08.sqm
DOWNLOADS               sqmdata06.sqm  sqmnoopt09.sqm
DTS                     sqmdata07.sqm  sqmnoopt10.sqm
FOTOS PARA INTERNET     sqmdata08.sqm  sqmnoopt11.sqm
games                   sqmdata09.sqm  sqmnoopt12.sqm
GTA                     sqmdata10.sqm  sqmnoopt13.sqm
IO.SYS                  sqmdata11.sqm  sqmnoopt14.sqm
ISOBUSTER               sqmdata12.sqm  sqmnoopt15.sqm
Jogos                   sqmdata13.sqm  sqmnoopt16.sqm
MSDOS.SYS               sqmdata14.sqm  sqmnoopt17.sqm
NTDETECT.COM            sqmdata15.sqm  sqmnoopt18.sqm
ntldr                   sqmdata16.sqm  sqmnoopt19.sqm
pacote sims 2           sqmdata17.sqm  System Volume Information
pagefile.sys            sqmdata18.sqm  WINDOWS
Papeis de Parede        sqmdata19.sqm

Any idea?

by Leonardo de Almeida Dias, 15 years ago

Attachment: vbr.dd added

MBR of Virtual Disk

by Leonardo de Almeida Dias, 15 years ago

Attachment: mbr.dd added

MBR of the hard disk image file

comment:9 by Leonardo de Almeida Dias, 15 years ago

Please,

See the vbr.dd and mbr.dd attached.

in reply to:  9 comment:10 by Steve Dodd, 15 years ago

The disk size looks ok (it's in 512 bytes sectors), partition table looks good, dumping the mbr you attached seems to show that there's boot code in it.. very odd. (The second file you posted seems to be a copy of the first, but if the partition is usable I can't see why the vbr would likely be damaged.)

Did you find the list of "gotchas" at http://www.virtualbox.org/wiki/Migrate_Windows? Mind you, I would expect these issues to generate an error, or perhaps a hang a bit later on in the boot process ..

by Jelle Geerts, 15 years ago

Attachment: bughunter2_fdisk.txt added

by Jelle Geerts, 15 years ago

Attachment: bughunter2_mbr.bin added

comment:11 by Jelle Geerts, 15 years ago

I seem to have similar issues. I've attached my fdisk -l (invalid partition table) output and the MBR of /dev/sda.

comment:12 by Steve Dodd, 15 years ago

Hexdumping your MBR (using hd/hexdump):

00000000  63 6f 6e 65 63 74 69 78  00 00 00 02 00 01 00 00  |conectix........|
00000010  00 00 00 00 00 00 02 00  10 73 cd 0e 76 70 63 20  |.........s..vpc |
00000020  00 05 00 03 57 69 32 6b  00 00 00 01 00 00 00 00  |....Wi2k........|
00000030  00 00 00 01 00 00 00 00  20 82 10 3f 00 00 00 03  |........ ..?....|
00000040  ff ff ee 2e d6 a2 78 77  8e 43 11 dd 81 32 fc ee  |......xw.C...2..|
00000050  82 9f 6d fb 01 00 00 00  00 00 00 00 00 00 00 00  |..m.............|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000200

I don't recognise those strings, but they look like a non-raw disk image from another virtualization product. How did you make the VDI?

comment:13 by Jelle Geerts, 15 years ago

Just converting the VHD (Virtual PC disk image) to VDI by running this command: VBoxManage convertdd disk.vhd disk.vdi

comment:14 by Steve Dodd, 15 years ago

AFAIK, convertdd doesn't do that. From the manual: "This command converts a raw disk image to a VirtualBox Disk Image (VDI) file."

The "convertdisk" command added in http://www.virtualbox.org/changeset/12775 should do the trick whenever it makes into a released build (if it hasn't already -- I'm still using 2.0.0, so can't check.)

comment:15 by Jelle Geerts, 15 years ago

Okay that was pretty stupid of me, thanks for the information =)

comment:16 by Frank Mehnert, 15 years ago

Resolution: fixed
Status: reopenedclosed

Please reopen if this problem persists with a current release of VirtualBox (2.2.4 or 3.0.0).

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use