How to manually unmount drives in W2K

  • Thread starter Thread starter Robert Myers
  • Start date Start date
R

Robert Myers

We have an EMC in house that we are using to spin a BCV
to a remote server and this works, however the BCV volume
that I mount on the backup server requires me to remove
the drive letter and the re-add the drive letter before I
can access the updated information.

Does anyone know how to manually unmount drives in 2K
that I can add to a local script or run via RCMD.
 
We have an EMC in house that we are using to spin a BCV
to a remote server and this works, however the BCV volume
that I mount on the backup server requires me to remove
the drive letter and the re-add the drive letter before I
can access the updated information.

Does anyone know how to manually unmount drives in 2K
that I can add to a local script or run via RCMD.

See tip 2600 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
I don't think that is what he is looking for Jerry. That won't force a specific
drive letter to dismount though I guess they could rework the environment to use
junctions instead of drive letters.

I am not aware of any apps from MS that will force a volume to dismount by
specifying the volume. However here would be part of the code required to do so
for an internal disk, not sure if it would work with EMC or not because there
could be driver issues.


DWORD DismountVolume(HANDLE h)
{
DWORD dwSize;
if (bDebug) cout << "DEBUG: Dismounting volume...\n";
if (!DeviceIoControl(h,FSCTL_DISMOUNT_VOLUME,NULL,0,NULL,0,&dwSize,NULL))
{
DWORD dwErr=DisplayErrorMsg("ERROR (FSCTL_DISMOUNT_VOLUME): ");
CloseHandle(h);
return dwErr;
}
if (bDebug) cout << "DEBUG: Dismounted.\n";
return 0;
}


My writeprot tool (free win32 tools page of www.joeware.net) has to dismount the
drive when marking it read only or read-write. Remounting the drive is not
specifically required as the OS will remount automatically when something tries
to access it.

joe
 
Thanks to all that responded. I am working with their
TeirII support and I mentioned that I was thinking of
using the MOUNTVOL and they recommended against it.

We will be further trying to isolate drive activity prior
to moving the copy to the backup server with their
resource kit which allows me to flush the cache just
prior, thanks again

-----Original Message-----
I don't think that is what he is looking for Jerry. That won't force a specific
drive letter to dismount though I guess they could rework the environment to use
junctions instead of drive letters.

I am not aware of any apps from MS that will force a volume to dismount by
specifying the volume. However here would be part of the code required to do so
for an internal disk, not sure if it would work with EMC or not because there
could be driver issues.


DWORD DismountVolume(HANDLE h)
{
DWORD dwSize;
if (bDebug) cout << "DEBUG: Dismounting volume...\n";
if (!DeviceIoControl (h,FSCTL_DISMOUNT_VOLUME,NULL,0,NULL,0,&dwSize,NULL))
{
DWORD dwErr=DisplayErrorMsg("ERROR (FSCTL_DISMOUNT_VOLUME): ");
CloseHandle(h);
return dwErr;
}
if (bDebug) cout << "DEBUG: Dismounted.\n";
return 0;
}


My writeprot tool (free win32 tools page of
www.joeware.net) has to dismount the
drive when marking it read only or read-write. Remounting the drive is not
specifically required as the OS will remount
automatically when something tries
to access it.

joe




--
Joe Richards Microsoft MVP Windows Server Directory Services
 
Back
Top