18

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)

2
  • 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

11 Answers 11

18

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).

5
  • +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
  • 4
    -1 as does not actually answer the question, just gives your subjective opinion – Mr. Hedgehog Jul 12 '17 at 16:01
  • Hmph. Opinion or not, this answer still has the ring of truth, indeed, it rings true. +1 for being awesome. – JonathanDavidArndt Sep 13 '18 at 12:41
42

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 were a folder on the local drive. All applications will treat this symbolic link as a local resource.

Hope this helps.

4
  • +1, was looking to create C++ project solution on a network drive. This trick works. :-) – Ashwin 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
  • This is really useful for when you've got source code on a host machine and want to access it from within a VM on the same machine. – Xerxes May 19 '20 at 2:40
  • I used this to search for duplicate files on my NAS :) – zeilja May 28 '20 at 18:22
5

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
3
  • 1
    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
  • Awesome, needed to fool dropbox. Does this mount persist between reboots etc etc? – Enjoy87 Oct 13 '20 at 15:17
5

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.

1
  • It should be noted that - with a standard filesystem - you cannot have two clients access the network drive at the same time. A standard filesystem expects a dedicated block device where it has exclusive access. Concurrent access will quickly destroy the filesystem unless you're using a clustering filesystem designed for this. – Zac67 Aug 31 '17 at 11:18
3

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}]
1
  • 4
    mounts as a "network drive" which is what the OP is looking to avoid. – quack quixote Feb 4 '10 at 0:00
2

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.

1

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.

0

I found a solution using thisDokan

You can mount a network share as a drive, and then share it as usual. Works perfectly.

0

As of Windows 10, you just have to right click the network and click "connect the drive" (just above "cut").

It will set a letter (D:, E: or else) and it will appear just as a local drive.

-1

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.

2
  • 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 '16 at 16:23
  • Thanks @TJSaunders , I will edit the post. Sorry, new to the forum. – TheFatiass Feb 18 '16 at 18:12
-4

The best method is created iSCSI, connect to this iSCSI and indicated the Shadown Copy storage for the local. This post i used to created iSCSI and Be Happy !!!.

http://www.andersonpatricio.org/criando-um-storage-iscsi-com-windows-storage-server-2012-e-configurando-nic-teaming-nas-interfaces-da-rede-san/

1
  • Could you expand your answer to explain how this provides the result the asker was interested in? It would also be useful if you could summarise the content of the link you provide. – iwaseatenbyagrue Mar 16 '17 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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