Problem
"The folder is not empty, or the current user does not have read access to the folder", when attempting to create a partition on the root of the mount point
Error Message
When creating a partition using the New Partition wizard the following error message is displayed:
Dtrace of MMC shows the following Lines:
(mmc) <53944> EV:M CAUINewPartitionWizard::DoWork: Creating the new Vault Store Partition...|Partition:|Vault Store Partition Name |Computer:|EVServer)
(mmc) <53944> EV:L ConvertNetworkPathname entry
(mmc) <53944> EV:L ConvertNetworkPathname Exit. hr=Success (0)
(mmc) <53944> EV:M CAUINewPartitionWizard::DoWork failed: The folder is not empty, or the current user does not have read access to the folder.
Dtrace of StorageManagement Shows the following lines:
(StorageManagement) <7992> EV:H {CStorageManage::CreatePartition} HRXEX fn trace : Error [0xc0041093], [d:\builds\16\ev\v-m-s\sources\source\storage\storagemanagement\storagemanage.cpp, lines (38){...,1033,1034,1035,1036,1037,1042,1045,1047,1048,1066,1067,1085}, built Aug 15 09:12:43 2017].
(StorageManagement) <7992> EV~E Event ID: 6799 Unable to create Vault Store Partition. | |Vault Store: 187B73D522A827F40B958B532012E336E1210000EV-SITE1 |Partition Root Path: E:\MountPoint |Error: The folder is not empty, or the current user does not have read access to the folder. (0xc0041093) | |Internal references: |Flags: HSMType:0\NoSecurity:0\DeviceType:0\State:2 |Reference: {CStorageManage::CreatePartition} [d:\builds\16\ev\v-m-s\sources\source\storage\storagemanagement\storagemanage.cpp, lines (38){...,1033,1034,1035,1036,1037,1042,1045,1047,1048,1066,1067,1085}, built Aug 15 09:12:43 2017] |
Cause
This issue is caused by Windows OS placing 2 hidden system folders ("$RECYCLE.BIN" and "System Volume Information") on the root of the mount point as this is the root of the volume.
When the new partition wizard attempts to create the partition, it checks to see if the folder location is Empty. Since these hidden system folders are present. It will return a False and the wizard will display the error message above.
You can check to see if these files are present by going to Folder options and under the View tab select "Show hidden files, folders and drives" and deselect the box for "Hide Protected operating system files (Recommended)". Click and Apply then OK and now, if the files are present, you will be able to see them.
Alternatively you can utilize Command Shell to confirm if the folder in question contains any hidden files or folders , i.e., DIR /A or via PowerShell, i.e.,
$MethodDefinition = '[DllImport("Shlwapi.dll", CharSet = CharSet.Unicode)] public static extern bool PathIsDirectoryEmptyW(string pszPath);'
$ Shlwapi = Add-Type -MemberDefinition $MethodDefinition -Name 'Shlwapi' -Namespace 'Win32' -PassThru
$ Shlwapi::PathIsDirectoryEmptyW("C:\MountPoint")
Solution
In order to be able to create a Vault Store Partition using a Mount Point. You will need to create a Subfolder within the mount point and direct the partition to the sub-folder.
You will not be able to create the partition on the root of the mount point.