Thursday, February 17, 2011

The path must point to a fixed, NTFS drive whose root directory exists.

Hi,

Just wanted to share a quick fix in SharePoint 2010 Search which I faced today, this error almost took me for a toll with no help in Internet :(, finally I was able to successfully
resolve the issue with bit of thinking and support from my colleague.

Scenario: Installed SharePoint via Power shell Scripts in SharePoint 2010 Farm (3 App Servers, 3 WFE's and 1 SQL Server). Unable to create Crawl or Index components in some of the machines.

Error: While creating new crawl components or Query & Index partitions, SharePoint 2010 keep on prompting the message "The path must point to a fixed, NTFS drive whose root directory exists."
Note: The error prompts while trying via Central Administration and via Powershell Scripts it hangs to activate the components

Solution: Execute the following command in Power shell and wait for 15 minutes to reflect the changes

Repair-SPManagedAccountDeployment

Via scripting, add the following lines at the top

Repair-SPManagedAccountDeployment
sleep 900

Hope this little fix will help other users to come up with a solution quickly.

Following is the complete script for Crawl and Query Components

Crawl Component

try
{
$ServerName = $env:COMPUTERNAME

Repair-SPManagedAccountDeployment
sleep 900


#Start Search Service Instance
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
if ($searchInstance.status -eq "Disabled")
{
Start-SpEnterpriseSearchServiceInstance -identity $ServerName
}

## Wait
Write-Host -ForegroundColor Blue " - Waiting for Search Service Instance to start..." -NoNewline
While ($searchInstance.status -ne "Online")
{
Write-Host -ForegroundColor Blue "." -NoNewline
start-sleep 1
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
}
Write-Host -BackgroundColor Blue -ForegroundColor Black " ......: Search Service Started!"

#Get Service Application
$searchApp = Get-SPServiceApplication | ? {$_.TypeName -eq "Search Service Application"}

write-host Getting Initial Crawl Topology
# Retrieve the active topology
$InitialCrawlTopology = $searchApp | Get-SPEnterpriseSearchCrawlTopology -Active
$InitialCrawlTopology


write-host Cloning Crawl Topology
# Clone the topology
$CrawlTopology = $searchApp | New-SPEnterpriseSearchCrawlTopology -Clone -CrawlTopology $InitialCrawlTopology

write-host Creating new crawl component
# Create the new crawl component
$CrawlDatabase0 = ([array]($searchApp | Get-SPEnterpriseSearchCrawlDatabase))[0]
$CrawlComponent0 = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $searchInstance -IndexLocation $CrawlComponents
$CrawlComponent1 = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase0 -SearchServiceInstance $searchInstance -IndexLocation $CrawlComponents

write-host Activating new crawl topology
# Activate the new crawl topology
$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology -Active
Write-Host -ForegroundColor white Waiting for the old crawl topology to become inactive
do {write-host -NoNewline .;Start-Sleep 10;} while ($InitialCrawlTopology.State -ne "Inactive")

sleep 900


write-host Deleting Crawl Topology
# Delete the old crawl topology
$InitialCrawlTopology | Remove-SPEnterpriseSearchCrawlTopology

sleep 100

}
catch
{
Write-Output $_
}

Query Component

try
{
$ServerName = $env:COMPUTERNAME

Repair-SPManagedAccountDeployment
sleep 900

#Start Search Service Instance
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
if ($searchInstance.status -eq "Disabled")
{
Start-SpEnterpriseSearchServiceInstance -identity $ServerName
}

## Wait
Write-Host -ForegroundColor Blue " - Waiting for Search Service Instance to start" -NoNewline
While ($searchInstance.status -ne "Online")
{
Write-Host -ForegroundColor Blue "." -NoNewline
start-sleep 1
$searchInstance = Get-SPEnterpriseSearchServiceInstance | where {($_.server) -match $ServerName}
}
Write-Host -BackgroundColor Blue -ForegroundColor Black " ......Started!"

$searchApp = Get-SPServiceApplication | ? {$_.TypeName -eq "Search Service Application"}


write-host Retrieving Active Topology
# Retrieve the Active Query Topology
$InitialQueryTopology = $searchApp | Get-SPEnterpriseSearchQueryTopology -Active
$InitialQueryTopology

write-host Cloning Query Topology
# Create New topology
$QueryTopology = $searchApp | New-SPEnterpriseSearchQueryTopology -Partitions 2


write-host Adding Query Components
$IndexPartition0 = ([array](Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology))[0]
$QueryComponent0 = New-SPEnterpriseSearchQuerycomponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition0 -SearchServiceInstance $searchInstance -IndexLocation $QueryComponents

$IndexPartition1 = ([array](Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology))[1]
$QueryComponent1 = New-SPEnterpriseSearchQuerycomponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition1 -SearchServiceInstance $searchInstance -IndexLocation $QueryComponents


# Reuse the existing property database
$PropertyDatabase0 = ([array]($searchApp | Get-SPEnterpriseSearchPropertyDatabase))[0]


# Assign three index partitions to the property database
$IndexPartition0 | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase0
$IndexPartition1 | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase0

write-host Activating new query topology
# Activate the new query topology
$QueryTopology | Set-SPEnterpriseSearchQueryTopology -Active
Write-Host -ForegroundColor white Waiting for the old query topology to become inactive
do {write-host -NoNewline .;Start-Sleep 10;} while ($InitialQueryTopology.State -ne "Inactive")

sleep 900


write-host Deleting old query topology
# Delete the old query topology
$InitialQueryTopology | Remove-SPEnterpriseSearchQueryTopology

}
catch
{
Write-Output $_
}

1 comment:

Paul Grimley said...

Hi Abdul, thanks for sharing this and there is little out there for this error in SharePoint. I have exactly the same scenario as you when connecting via PowerShell and raised this with Microsoft. The solution provided by Microsoft was that the Timer service does not start automatically and once you start this manually you will be able to change the search topology. More information can be found here http://www.paulgrimley.com/2010/11/side-effects-of-attaching-additional.html