Can`t to copy data to physical hard disks on VirtualBox

This is for discussing general topics about how to use VirtualBox.
Post Reply
Eugene_777
Posts: 6
Joined: 11. Jun 2017, 13:26

Can`t to copy data to physical hard disks on VirtualBox

Post by Eugene_777 »

Hello.
I have OS FreeBSD on VirtualBox which consist 6 disks merged in zfs pool. Host OS is Windows 7. I need to connect physical hard disk (volume 3Tb with GPT, FS-NTFS) to VirtualBox that copy data with zfs pool to physical hard disk and later will open them in my host OS the Windows 7.
I`ve connected hard disk in this way: created link to physical hard disks (VboxManage.exe internalcommands createrawvmdk -filename g:\Images\wdnas.vmdk -rawdisk \\.\PhysicalDrive5) and connected to VirtualBox.
My disk has appeared in FreeBSD but I can`t mount it in system. FreeBSD write "Invalid argument". I recreate a partition with help "gpart", after that FreBSD has mounted partition and I can copy data on my physical hard disks.
But when I have tried unmount my hard disk VirtualBox give me message error "The I/O cache encountered an error while updating data in medium ahci-0-6 (rc=VERR_ACCESS_DENIED). Make sure there is enough free space on the disk and that the disk is working properly. Operation can be resumed afterwards." I tried to check item "Use host I/O cache" but it didn`t help.
When I`ve seen windows disk manager to my hard disk didn`t have the partition and look like unallocated space.

Help me please, I don`t know how i can to handle with this problem.
Thankful in advance for the help
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by mpack »

My policy is not to help people use raw disk. It's an experts only feature: if you need to ask how to use it then you shouldn't be using it.

I do wonder why you don't simply set up a network share like you would if the second PC was physical?
Eugene_777
Posts: 6
Joined: 11. Jun 2017, 13:26

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by Eugene_777 »

mpack wrote:My policy is not to help people use raw disk. It's an experts only feature: if you need to ask how to use it then you shouldn't be using it.
I don't understand what is the problem to use raw disk? If i need to do this way, why I can't do so?
mpack wrote:I do wonder why you don't simply set up a network share like you would if the second PC was physical?
I think if I connect physical hard disk I will have bigger speed copy of data than copy of data through the network.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by socratis »

Eugene_777 wrote:If i need to do this way, why I can't do so?
  1. You don't need to, you want to.
  2. If you do and something goes bad and you lose your HD, somebody is going to hear your wrath. I guess mpack doesn't want to be a part of this (neither do I). He said "you're on your own", he didn't say "don't do it".
Eugene_777 wrote:I think if I connect physical hard disk I will have bigger speed copy of data than copy of data through the network.
What's your disk throughput? What's your network throughput? Is this a theoretical conclusion or do you have any numbers?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Eugene_777
Posts: 6
Joined: 11. Jun 2017, 13:26

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by Eugene_777 »

socratis wrote:If you do and something goes bad and you lose your HD, somebody is going to hear your wrath. I guess mpack doesn't want to be a part of this (neither do I). He said "you're on your own", he didn't say "don't do it".
a.I use image files of hard disks. I don`t use the real hard disk. Real hard disk only that copy data. But now real hard disk doesn't have any data.
b. I don`t understand what has this to do with somebody? All that I do I do at my own risk and I don`t want to accuse somebody. It's very strange...
Please, write me in private message if you don't want that somebody will have read it. But I want to know how to do it.
socratis wrote:What's your disk throughput? What's your network throughput? Is this a theoretical conclusion or do you have any numbers?
I don't know it. It is a theoretical conclusion.
erdeslawe
Volunteer
Posts: 241
Joined: 8. Jul 2015, 10:23

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by erdeslawe »

Eugene_777 wrote: But I want to know how to do it.
Have you tried the relevant section of the VirtualBox User Manual?
Eugene_777
Posts: 6
Joined: 11. Jun 2017, 13:26

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by Eugene_777 »

I tired, but I didn`t succeed. I was writing above about it.
I don`t understand why can`t you say how to decide problem if you know.
I was trying do many things before write here. Maybe I do something wrong but for it exist forum that somebody could ask a question.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by socratis »

Eugene_777 wrote:I use image files of hard disks. I don`t use the real hard disk. Real hard disk only that copy data. But now real hard disk doesn't have any data.
I'm not sure I understand that part. What's an "image file of a hard disk". And why to you want to use raw disk access if you don't use real hard disks? I'm honestly confused and I'm trying to makes sense of what you're saying. Could you describe your setup once more, using a different approach?

All we can tell you is in the manual, we're not hiding anything from you. Before I suggest something I want to know that it's going to work without any problems. I will not do that with raw disk access. I've never done it, neither I'm going to start now.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Eugene_777
Posts: 6
Joined: 11. Jun 2017, 13:26

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by Eugene_777 »

Ok. Let I will try to describe my problem once again. I think so will be easier.
I have OS FreeBSD on VirtualBox which consist 6 file images of hard disks (file image means copy bit to bit from a real hard disk, for example: dd, img formats. Maybe you know) merged in zfs pool (means RAIDZ2). Host OS is Windows 7.
I need to make image zfs pool and copy to another disk. For copy data I have hard disk 3Tb. I wanted to connect this hard disk and copy data from zfs pool here. It`s all.
Already it doesn`t matter for me which way do it. But preferabelу through connect hard disk.
BMJ
Posts: 1
Joined: 27. Jun 2017, 07:29

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by BMJ »

I'm always leery when someone says "Why would you want to do that??".
Here's a scenario where using a raw host partition is preferable to using a network share:
  • Linux host that includes an NTFS filesystem (it's dual-booted).
    Windoze guest that needs write access to that NTFS filesystem.
To get access via a network share (or Samba/SMB), the host will have to mount
the filesystem with ntfs-3g . That's OK for read-only access, but at least in the
past it has been flaky when writing (or at least creating).
But by using raw disk access, all the NTFS hocus-pocus is done by Bill himself
(i.e. the Windoze OS).
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can`t to copy data to physical hard disks on VirtualBox

Post by mpack »

Your scenario presupposes the thing you're trying to prove - you are assuming that the VM needs physical access to a host drive. Personally I'd just clone the host drive and give the VM an independant and fully virtual copy.

But, set that aside.

If you have two PCs and you want to share a folder, then an SMB share is the standard solution, and that principle isn't changed when one of the PCs is a VM. The limitations of your host drivers also has little effect on the logic: if your host drivers are inadequate then replace them, or get a better host OS.

And finally, just to briefly address the straw man that was set up in your first sentence: nobody asked why the OP wanted to use raw disk. Personally I'm not at all interested in that question. He was asked what was wrong with the more obvious solutions, which are usually a better fit for non experts. I.e. we weren't asking about his decisions, only his assumptions.
Post Reply