Something similar can be achieved by "createrawvmdk" with "-rawdisk" and "-partitions". This creates a small *-pt.vmdk for partition table.
I want to create my vmdk using a text editor. Here's what I do:
Code: Select all
# create pt and tail
VBoxManage createhd --filename ssd-micron-fakebig-PhysicalDrive0-pt.vmdk --size 1 --format VMDK
VBoxManage createhd --filename ssd-micron-fakebig-PhysicalDrive0-tail.vmdk --size 150000 --format VMDK
Code: Select all
# Disk DescriptorFile
version=1
CID=f1bc1924
parentCID=ffffffff
createType="partitionedDevice"
# Extent description
RW 2048 FLAT "ssd-micron-fakebig-PhysicalDrive0-pt.vmdk" 0
RW 500116144 FLAT "\\.\PhysicalDrive0" 2048
# ..500118192
RW 307200000 FLAT "ssd-micron-fakebig-PhysicalDrive0-tail.vmdk" 0
# ..807318192
# The disk Data Base
#DDB
ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.uuid.image="d82e6e03-2ae0-4aa4-8e80-114b16ecd65a"
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.cylinders="0"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
Code: Select all
[il@reallin ~]$ dd iflag=direct if=/dev/sdb of=/dev/null
dd: error reading '/dev/sdb': Input/output error
128+0 records in
128+0 records out
65536 bytes (66 kB, 64 KiB) copied, 0.138835 s, 472 kB/s
[il@reallin ~]$
Code: Select all
00:03:35.299047 AHCI#0P1: Read at offset 65536 (512 bytes left) returned rc=VERR_EOF
00:03:35.315964 AHCI#0P1: Read at offset 65536 (512 bytes left) returned rc=VERR_EOF
00:03:35.330204 AHCI#0P1: Read at offset 65536 (512 bytes left) returned rc=VERR_EOF
00:03:35.343750 AHCI#0P1: Read at offset 65536 (512 bytes left) returned rc=VERR_EOF
00:03:35.357037 AHCI#0P1: Read at offset 65536 (512 bytes left) returned rc=VERR_EOF
00:03:35.370572 AHCI#0P1: Read at offset 65536 (512 bytes left) returned rc=VERR_EOF
Is it because "FLAT" expects a raw image, not a real .vmdk file? Is it possible to use a dynamic image as an extent?
Some other questions:
- My 1st partition starts at sector 2048. Why does the created *-pt.vmdk have size 64-sectors and the rest is filled with zeros?
Code: Select all
# partition table
RW 63 FLAT "linux-pt.vmdk" 0
# padding. Why?
RW 1985 ZERO
# 1st partition (not used)
RW 718897152 ZERO
# linux swap
RW 8196096 FLAT "\\.\PhysicalDrive2" 718899200
# linux
RW 249677872 FLAT "\\.\PhysicalDrive2" 727095296