Adding physical disk failed - where I did mistake?

Discussions related to using VirtualBox on Windows hosts.
MIRKOSOFT
Posts: 76
Joined: 25. Dec 2015, 02:23

Re: Adding physical disk failed - where I did mistake?

Post by MIRKOSOFT »

I unmounted drives by two scripts - both are the same, only drive is changed. Unmount was succesfull and in My Computer were not visible:

Code: Select all

@echo off

REM Be sure to change this to the drive letter you want to mount the drive to!
set drive=R

REM Be sure to change this to the Volume Name of the drive you want to mount!
set volume=\\?\Volume{b8af929f-559f-4a08-81d9-0f52e5cb0886}\

:start
echo Mounting Drive...
mountvol %drive%: %volume%
echo Drive R(APPS) Mounted!

pause
exit
So, I tried to create virtual disk by command and here you can see error result:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage internalcommands createrawvmdk -filename L:\APPS-FAT32.vmdk -rawdisk \\.\PhysicalDrive5 -partitions 1
VBoxManage.exe: error: Cannot open the raw disk '\\.\PhysicalDrive5': VERR_SHARING_VIOLATION
VBoxManage.exe: error: The raw disk vmdk file was not created
So, what a problem there is yet?

Thank you for help.
Miro
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Physical disk unmounted for using in VM, but reports still error - is here anybody who can help?

Post by Martin »

Where does your script unmount the drive?
Last edited by Martin on 26. Dec 2017, 11:17, edited 1 time in total.
socratis
Site Moderator
Posts: 27329
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: Adding physical disk failed - where I did mistake?

Post by socratis »

Miro,
I've deleted your duplicate message. According to the forum rules, duplicate posts are not allowed. I've also merged Martin's response with the old thread that you had.

You can't unmount something that is in use. That's what the "sharing violation" message says. Is your hard drive in use? Is it the same one that you booted from maybe?
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.
MIRKOSOFT
Posts: 76
Joined: 25. Dec 2015, 02:23

Re: Adding physical disk failed - where I did mistake?

Post by MIRKOSOFT »

Ok, I duplicated post for one purpose only - it was looking like forgotten.

The whole harddisk has 3 partitions - no one is booting, only VIDEO partition is for adding videos, rest 2 partitions are free, no file, no in use.
I'm using 6 HDDs and this one was added for VBox physical disk adding, also only for videos - 'cause I need not so big space for VM.

Miro
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Adding physical disk failed - where I did mistake?

Post by Martin »

Again: Your script is mounting the disk!
To unmount you are missing the "/d" or "/p" parameter.
https://technet.microsoft.com/de-de/lib ... s.11).aspx
MIRKOSOFT
Posts: 76
Joined: 25. Dec 2015, 02:23

Re: Adding physical disk failed - where I did mistake?

Post by MIRKOSOFT »

Oh, I'm sorry - I swapped code, here's unmouting code:

Code: Select all

@echo off

REM Be sure to change this to the drive you want to unmount! 
set drive=R:

echo Unmounting Drive...
mountvol %drive% /p
echo Drive R(APPS) Unmounted!

pause
exit
Please forgive me my mistake.
Miro
MIRKOSOFT
Posts: 76
Joined: 25. Dec 2015, 02:23

Re: Adding physical disk failed - where I did mistake?

Post by MIRKOSOFT »

Please can anybody help me?

Miro
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Adding physical disk failed - where I did mistake?

Post by mpack »

MIRKOSOFT wrote:Please can anybody help me?
My policy is not to help anyone use the raw disk feature, and I believe many other mods and volunteers feel the same way. As mentioned in the manual, using raw disks is an experts-only feature, because inexpert use could result in the total destruction of data on the host drive. One of the signs of an expert is that the description in the user manual should be perfectly adequate for understanding the feature.
MIRKOSOFT
Posts: 76
Joined: 25. Dec 2015, 02:23

Re: Adding physical disk failed - where I did mistake?

Post by MIRKOSOFT »

OK, I understand and maybe really switch Vbox to VMware - since this installation of Windows have only problems and here I was in hope that will find help.
In other - I'm using 6 physical disks and one of them was connected for this purpose only - no data - no loss. Even I need help with unmounting partitions only.
Miro
socratis
Site Moderator
Posts: 27329
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: Adding physical disk failed - where I did mistake?

Post by socratis »

MIRKOSOFT wrote:Even I need help with unmounting partitions only.
Unmounting partitions is *not* a VirtualBox problem. You should be looking in Windows forums, not in VirtualBox forums. We've been saying that for the longest time!
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.
MIRKOSOFT
Posts: 76
Joined: 25. Dec 2015, 02:23

Re: Adding physical disk failed - where I did mistake?

Post by MIRKOSOFT »

Yes, but no one other forum got answer.

Let me be please.
Miro
Post Reply