Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to mount a network location so that it appears as a local physical disk? e.g. \\computer\share as D: (not a network drive)

share|improve this question
    
Could you please state in the question, and with appropriate tags, which operating system you're asking about? – bignose Feb 1 '10 at 6:22
    
What is it that you're trying to accomplish? – Dennis Williamson Feb 4 '10 at 1:14
up vote 8 down vote accepted

As I said on this (almost) identical question:

Are you sure this is really what you want to do? There's a very good article on why this is a bad bad bad idea over at Joel on Software (see point #3)...

The concluding statement is:

Conclusion: the next time someone tries to sell you a programming product that lets you access network resources the same was as you access local resources, run full speed in the opposite direction.

If you want to know why, read the relevant parts of the article.

And the short answer to your question is: No. Not easilly, and the reason is that a local disk is expected to have all sorts of functionality that a network share does not. A local disk expects a local file system (NTFS/FAT/etc), which a network share does not have (Well, it does, but at the server it's hosted on, not your location), as well as a whole host of other features that just can't be safely or reliably replicated (see the linked artical).

share|improve this answer
    
+1, right answer. you not only answered the question asked, you also qualify for the mind-reader badge for discerning what the OP is really asking. – quack quixote Feb 3 '10 at 23:59
1  
... and the rest of the story is: what the OP wants is a "network block device", which can be done (and shouldn't, for all the reasons you list), but can't be applied to an existing Windows network share. – quack quixote Feb 4 '10 at 0:04
    
The linked article here is now 15 years old and is still relevant. Funny how time flies... – Mark Henderson Jun 3 '15 at 5:43

Yes, this is possible in Windows Vista and in Windows 7.

Open the Command Prompt as an administrator. Then type the following command:

mklink /D C:\LinkName \NetworkLocation\LocationName

This will create a "symbolic link" on Drive C called "LinkName", which will link to "LocationName" on "\NetworkLocation". Windows will of course know that this is a symbolic link, but will treat it as if it was a folder on the local drive. All applications will treat this symbolic link as a local resource.

Hope this helps.

share|improve this answer
    
+1, was looking to create C++ project solution on a network drive. This trick works. :-) – Ashwin kumar Nov 29 '12 at 9:10
    
There was a very weird corner case where this was useful to me. – Registered User Apr 1 '13 at 23:33

You can mount a network drive as a virtual physical disc using the iSCSI protocol to access an iSCSI server - for example, you can set one up using Free NAS - Google it for more info.

share|improve this answer
    
I will look that up, thanks – jwee Feb 4 '10 at 21:59

If you want to script it, use the NET USE command:

The syntax of this command is:

NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [/SMARTCARD]
        [/SAVECRED]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]
share|improve this answer
1  
mounts as a "network drive" which is what the OP is looking to avoid. – quack quixote Feb 4 '10 at 0:00

I'm assuming you're using Windows, but you don't say which version. In any case, in Windows Explorer in the Tools menu select Map Network Drive. If you're on Vista, for example, which hides the menus, just press and release the Alt key to show the menus.

You can also use the SUBST command:

SUBST M: \\COMPUTERNAME\SHARENAME
share|improve this answer
    
Hi, I was thinking more of how to mount it so that windows 7/2008 actually sees it as a physical drive and not a network mapped drive. I don't know if I actually make sense. However there are some software out there that does not see mapped drive as a physical drive (e.g Computer management Start->Run->compmgmt.msc)? Thanks – jwee Feb 2 '10 at 0:22
    
Do you mean you want to fool software that won't work with network drives? If the subst command won't do it you're SOL. – John Gardeniers Feb 4 '10 at 3:36

I used Alderbury answer in order to save my microsoft onedrive files to a nas wd my cloud and it works. I have a windows 10 PC. Microsoft onedrive will only save to folders on the c:\ drive and not a network drive.

Yes, this is possible in Windows Vista and in Windows 7.

Open the Command Prompt as an administrator. Then type the following command:

mklink /D C:\LinkName \NetworkLocation\LocationName

This will create a "symbolic link" on Drive C called LinkName, which will link to LocationName on \NetworkLocation. Windows will of course know that this is a symbolic link, but will treat it as if it was a folder on the local drive. All applications will treat this symbolic link as a local resource.

Hope this helps.

share|improve this answer

The suggestion of mklink /D C:\LinkName \NetworkLocation\LocationName actually works. This is how I made it work:

I first mapped by network drive as Z:. To do this right click on the network drive and you will see "Map network drive" as an option. If you do not open the network drive and create on it the folder in which you want to store Onedrive for Business. Then right click on the folder and map it to drive Z:, or any other you want.

Next, run CMD as administrator. In the command prompt box that comes up type mklink /D C:\ Z: (the spaces are needed). You will now see a file on c:\ named LinkName.

Open that file and you will see a file with the same name as the directory you mapped as drive Z:. Right click on that and click on Properties. Under the general tab you will see at the bottom attributes. If Read-only, or any other box, is highlighted, or checked, click on it to clear it. Then click apply.

You can now go to Onedrive for Business and choose as the location the folder within C:\Linkname that is the mapped network drive.

I hope this is easy to follow.

share|improve this answer

If you just want your files somewhere else, but don't actually need to access them from many locations simultaneously, you can save a virtual drive in the shared folder and use some software to mount it as a local physical drive.

It will behave as a local drive, all software will recognize it as such, but it won't consume space on your local hard drives. If you actually need to access those files from two or more locations at once, go for hardlink, as others already well explained.

Original text before editing:

I have an application that requires the files to be saved locally, but due to its gigantic space consumption I have to leave it on the server. I simply saved a virtual drive in a shared folder and mapped it using Daemon Tools. Works like a charm, and is recognised as local storage.

*It is fast, because of the gigabit network, but not completely reliable, though. You may lose critical data or corrupt the virtual drive's file. To prevent this, you can use the "Offline folder" option, but as it saves a copy of the files locally, it may consume a lot of space, which makes it impossible to use in cases like mine.

share|improve this answer
    
Could you rephrase this answer so that it more closely addresses the OP's request? As it stands now, this reads more like an advertisement than like a solution to the OP's issue. – Castaglia Feb 18 at 16:23
    
Thanks @TJSaunders , I will edit the post. Sorry, new to the forum. – TheFatiass Feb 18 at 18:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.