[SERVER-14530] --dbpath does not support drive root properly Created: 11/Jul/14  Updated: 09/Jul/16  Resolved: 07/Nov/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.6.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Peter Graening Assignee: Mark Benvenuto
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 x64


Operating System: Windows
Steps To Reproduce:

Attempt to have MongoDB use a drive root as dbpath and run it as a Windows Service.

Participants:

 Description   

Configured a mongod instance where I had dedicated a separate drive for storage and assigned it the drive letter M.

While trying to setup mongod as a Windows service, it would not take "M:\" as a valid dbpath, But it would take "M:". For simplicity's sake (nothing else would be using the drive) I wanted to store all data at the root directory.

Things appeared to be working correctly because files were being allocated in M:\ as the databases grew. However, upon inspection, all data was actually being written to C:\Windows\System32\m_<db name>.x and the files on M:\ were zeroed out and empty.

I created a directory on M for data and moved the datafiles from C to M with no apparent loss of data.



 Comments   
Comment by Mark Benvenuto [ 14/Jul/14 ]

I have not been able to reproduce any install failures with either cmd.exe or powershell.exe on Windows 8.1 on MongoDB 2.6.3.

This worked:

mongod --install --dbpath M:\ --logpath C:\mongod.log

And this worked:

mongod --install --dbpath M: --logpath C:\mongod.log

I verified by checking c:\mongod.log in these examples.

Can you send me the output for

sc.exe qc mongodb

assuming you installed monogdb under the default service name. This will tell me how MongoDB is installed.

In terms of the database files going to the wrong location, this unfortunately is expected if the path was not fully qualified. The current working directory changes from you install mongodb (ie, where you run mongod --install from), and the service execution time (it becomes %windir%\system32). You can solve this my ensuring fully qualified paths for the directory name. Additional validation for full paths has been added to our development builds to prevent these mistakes.

Generated at Thu Feb 08 03:35:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.