VirtualBox

Ticket #943 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

VBoxManage convertdd creates corrupted images

Reported by: prahal Owned by:
Priority: minor 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

VBox.log Download (94.0 KB) - added by leoadias 6 years ago.
Vbox.log
VBox.png Download (959 bytes) - added by leoadias 6 years ago.
Vbox.png
vbr.dd Download (512 bytes) - added by leoadias 6 years ago.
MBR of Virtual Disk
mbr.dd Download (512 bytes) - added by leoadias 6 years ago.
MBR of the hard disk image file
bughunter2_fdisk.txt Download (215 bytes) - added by bughunter2 5 years ago.
bughunter2_mbr.bin Download (512 bytes) - added by bughunter2 5 years ago.

Change History

comment:1 Changed 6 years ago by frank

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

comment:2 Changed 6 years ago by Uranellus

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 Changed 6 years ago by frank

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 Changed 6 years ago by frank

  • Status changed from new to closed
  • Resolution set to worksforme

No response, closing.

comment:5 Changed 6 years ago by leoadias

  • Status changed from closed to reopened
  • Resolution worksforme deleted

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 Changed 6 years ago by leoadias

See Vbox.log and Vbox.png attached files.

Changed 6 years ago by leoadias

Vbox.log

Changed 6 years ago by leoadias

Vbox.png

comment:7 Changed 6 years ago by steved424

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 Changed 6 years ago by leoadias

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?

Changed 6 years ago by leoadias

MBR of Virtual Disk

Changed 6 years ago by leoadias

MBR of the hard disk image file

comment:9 follow-up: ↓ 10 Changed 6 years ago by leoadias

Please,

See the vbr.dd and mbr.dd attached.

comment:10 in reply to: ↑ 9 Changed 6 years ago by steved424

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 ..

Changed 5 years ago by bughunter2

Changed 5 years ago by bughunter2

comment:11 Changed 5 years ago by bughunter2

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

comment:12 Changed 5 years ago by steved424

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 Changed 5 years ago by bughunter2

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

comment:14 Changed 5 years ago by steved424

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 Changed 5 years ago by bughunter2

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

comment:16 Changed 5 years ago by frank

  • Status changed from reopened to closed
  • Resolution set to fixed

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.

www.oracle.com
ContactPrivacy policyTerms of Use