Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DISKPART command line utility

Status
Not open for further replies.

Goid

IS-IT--Management
Oct 13, 2006
15
CA
I'm trying to setup a batch file to map and unmap a volume to my server quite regularly. It is for the purpose of backing up. I have an external storage array that supports snapshots, which essentially copies the data from the volume you select to a new volume, then you back up that volume and unmap the drive letter once the backup is done.

The problem I have noticed is that when using DISKPART, the volume # does not stay static. An example:

Volume ### Ltr Label FS Type
Volume 0 H New Volume NTFS Partition
Volume 1 C NTFS Partition
Volume 2 D New Volume NTFS Partition

This is how it appears when I first run my batch file to mount the volume to the server. I then unmount and run the command again and Drive H will no longer be Volume 0, but Volume 2, Drive C is now Volume 0 and Drive D is now Volume 1. The Volume number to Drive letter mapping always changes which causes inconsistencies with my batch file.

It seems that Windows will assign whatever number it wants to a volume each time you run a rescan. Anyone who can shed light on this is greatly appreciated.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top