Bug 698392

Summary: qemu-img doesnt convert from raw to vmdk properly.
Product: [Fedora] Fedora Reporter: solanum <omalley_s>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 14CC: amit.shah, berrange, dwmw2, ehabkost, itamar, jaswinder, jforbes, knoel, kwolf, ondrejj, scottt.tw, stefanha, tburke, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-21 07:24:48 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description solanum 2011-04-20 15:24:58 EDT
Description of problem:
qemu-img doesnt convert from raw to vmdk properly. Solaris has a hidden partition/slice and the hidden flags get lost during the conversion. 

Version-Release number of selected component (if applicable):

qemu-img-0.13.0-1

How reproducible:
It happened twice. 


Steps to Reproduce:
1. install solaris 10 on fedora kvm stack
2. run qemu-img convert raw -> vmdk
3. put vmdk in VMware stack.
4. it boots to single user mode. (you can't boot to multi-user mode.
5. run format -> partition you will see a slice that should be hidden, but you can see it. 

Actual results:


Expected results:
I don't expect to see the hidden slice. 

Additional info:

from http://www.justlinux.com/forum/showthread.php?t=149828

Here is a list of the commonly used partitions, hide and unhide

< bit position>-----ID------Partition type------------
0 0 0 0 0 1 1 1 --- 7 ---- ntfs
0 0 0 1 0 1 1 1 --- 17 --- ntfs (hidden)
1 0 0 0 0 0 1 1 --- 83 --- native Linux
1 0 0 1 0 0 1 1 --- 93 --- native Linux (hidden)
0 0 0 0 0 1 1 0 --- 6 ---- fat16
0 0 0 1 0 1 1 0 --- 16 --- fat16 (hidden)
0 0 0 0 1 1 0 0 --- c ---- fat32 (LBA)
0 0 0 1 1 1 0 0 --- 1c --- fat32 (LBA) (hidden)
1 0 1 0 0 1 0 1 --- a5 --- BSD
1 0 1 1 0 1 0 1 --- b5 --- BSD (hidden)
1 0 1 1 1 1 1 1 --- bf --- Solaris
1 0 1 0 1 1 1 1 --- af --- Solaris (hidden)
0 0 0 0 0 1 0 1 --- 5 ---- Dos extended partition
0 0 0 1 0 1 0 1 --- 15 --- Dos extended partition (hidden)
1 0 0 0 0 1 0 1 --- 85 --- Linux extended partition
1 0 0 1 0 1 0 1 --- 95 --- Linux extended partition (hidden)

As always there is an exception to the rule. The Solaris partition is unhide with ID "bf" and hiding it make it into "af". Therefore to hide a Solaris partition in Grub the "unhide" instruction has to be used to toggle its 5th bit from "1" to "0".
---

I haven't been able to test the unhide/hide thing to see if that is a temporary work around yet. It appears as thought it could be an easier fix..
Comment 1 Kevin Wolf 2011-04-21 04:49:29 EDT
Please provide a qemu-io dump of the partition table immediately before and after the conversion. Image format conversion isn't supposed to change any of the content of an image file. You can dump the MBR like this (parameters to read are start and length):

qemu-io -c 'read -v 0 512' foo.img
Comment 2 Cole Robinson 2012-05-21 07:24:48 EDT
F14 is end-of-life, and reporter never responded, so closing. If anyone can still reproduce with latest qemu (fedora 16+), please reopen this report.