VirtualBox

Ticket #4703 (new defect)

Opened 5 years ago

Last modified 3 years ago

VBoxManage creterawvmdk on osx only allows first 4 partitions.

Reported by: baf Owned by:
Priority: major Component: other
Version: VirtualBox 3.0.4 Keywords:
Cc: Guest type: other
Host type: Mac OS X

Description

VBoxManage creterawvmdk on osx only allows first 4 partitions to be used. Also allows nonexistitng partitions with too high numbers on the commandline without any error message. Example command:

sudo VBoxManage internalcommands  createrawvmdk  -filename /tmp/foo.vmdk -rawdisk /dev/disk0 -partitions 1,2,3,4,5,6,7,8,9,10,11,12,13

partition table (gpt)

sudo gpt -r show /dev/disk0
Password:
gpt show: /dev/disk0: Suspicious MBR at sector 0
      start       size  index  contents
          0          1         MBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640   26542320      2  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
   26951960     262150         
   27214110   10586832      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
   37800942          3         
   37800945   24659775      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
   62460720  455432536      5  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  517893256   95864960      6  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  613758216     262149         
  614020365    4128705      7  GPT part - 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
  618149070    6988275      8  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  625137345       5070         
  625142415         32         Sec GPT table
  625142447          1         Sec GPT header

Resulting vmdk file

# Disk DescriptorFile
version=1
CID=4dd10ca2
parentCID=ffffffff
createType="partitionedDevice"

# Extent description
RW 1 FLAT "foo-pt.vmdk"
RW 409639 FLAT "/dev/disk0s1"
RW 26542320 FLAT "/dev/disk0s2"
RW 262150 ZERO 
RW 10586832 FLAT "/dev/disk0s3"
RW 3 ZERO 
RW 24659775 FLAT "/dev/disk0s4"
RW 562681728 ZERO 
snipped from here

Change History

comment:1 Changed 5 years ago by tmeixner

I'm not running MacOSX but I have a gpt partition table on my removable harddrive running Linux Kernel 2.6.30 _64 and VB 3.0.4. My problem is not exactly the same but I think they are related. "createrawvmdk -partition" and the "listpartitions" argument does not seem to work correctly on gpt partitions. Pls advise if a new ticket should be opened for this.

I have several partitions on /dev/sda

% blkid
/dev/sda1: LABEL="root" UUID="34648208-47f0-4355-ab53-45fc00b216af" TYPE="ext4"
/dev/sda2: UUID="5ca0f551-55f3-4db9-8bf3-00fa9a4d6ff5" LABEL="var" TYPE="reiserfs"
/dev/sda4: UUID="9A6424EE13C7CE88" LABEL="untitled" TYPE="hfsplus"
/dev/sda3: UUID="7C7E4040AD9131E7" LABEL="untitled" TYPE="hfsplus"
/dev/sda5: LABEL="home" UUID="d5a2cce3-aa7a-48ef-b4da-a84561102bbf" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda6: LABEL="lfs" UUID="14543a3c-c2bb-4ba3-91f0-8b0845de8c1e" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda7: LABEL="swap" UUID="4f37be7c-5a4e-4078-b7e7-481149381e1c" TYPE="swap"

The listpartition commmand seems not to be able to read the Partition table correctly.

VBoxManage internalcommands listpartitions -rawdisk /dev/sda
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0xee  0   /0  /1   1023/254/63        305245            1

If you attach the rawdisk via createrawvmdk it ignores the -partition arguments completely and gives access to the whole harddrive in the Guest machine.

The output from the .vmdk file secified with -partition 6,7

# Disk DescriptorFile
version=1
CID=657cb2e4
parentCID=ffffffff
createType="partitionedDevice"

# Extent description
RW 1 FLAT "lfsraw-pt.vmdk"
RW 625142447 ZERO

# The disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="a3cc6b0d-47da-49e2-b310-1a4dcedf242e"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="255"
ddb.geometry.biosSectors="63"

I was able to give raw access to just one partition by specifying /dev/sda6 without the -partition option.

VBoxManage internalcommands createrawvmdk -filename lfsraw.vmdk -rawdisk /dev/sda6 -relative -register

comment:2 Changed 3 years ago by djvasi

My vmdk-raw-parts utility can do this:  https://github.com/vasi/vmdk-raw-parts

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use