I have used VBoxManage to create raw partition VMDK:
Code: Select all
dd if=/dev/sda of=/cygdrive/f/D0_MBR bs=512 count=1
c:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands createrawvmdk -filename f:\mxlinux_part2_with_mbr.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 2 -mbr f:\D0_MBR
First, I was able to almost complete Linux installation inside VM and I can see some effect on the disk. But at some point VM started ignoring all writes to sda2 while reading data correctly without me changing anything. I found VERR_IO_NOT_READY error in VirtualBox log.
VirtualBox can refuse to start VM at times because of access error (VERR_VD_IMAGE_READ_ONLY, this looks like CreateFile resulting in "SHARING VIOLATION" in ProcessMonitor). VM can be paused due to this error, Linux host can report "check if no disk space left". I see WriteFile (to Harddisk0) operations in ProcessMonitor with result "0x80000010" and I cannot reproduce these right now because VM fails to start.
Now, the problem is that I cannot do anything to the raw disk using HexEditor in Windows too! It calls FlushBuffersFile which fails with "INVALID DEVICE REQUEST".
Different Hex Editor causes same error as VirtualBox (WriteFile with 0x80000010).
Disks are not set to read-only.
Code: Select all
DISKPART> list volume
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 C W7SP1x64 NTFS Partition 78 GB Healthy System
Volume 1 Partition 34 GB Healthy Offline
Volume 2 G SV_pomooika NTFS Partition 819 GB Healthy Pagefile
Volume 3 E raid1 NTFS Partition 931 GB Healthy
DISKPART> select volume 1
Volume 1 is the selected volume.
DISKPART> attributes volume
Read-only : No
Hidden : No
No Default Drive Letter: No
Shadow Copy : No
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> attributes disk
Current Read-only State : No
Read-only : No
Boot Disk : Yes
Pagefile Disk : Yes
Hibernation File Disk : No
Crashdump Disk : Yes
Clustered Disk : No