Jump to content

Mount a network share in a directory?


mf_2

Recommended Posts

Hello,

On my computers, I run a software which needs to access data in the path D:\data.

However, this data is exactly the same on all machines, so I wanted to map a server share (\\myserver\globaldata) into D:\data.

Is this possible?

This would make maintenance a lot easier, since I would only need to make file changes on those files once instead of 50 times (I administrate about 50 client machines).

I tried looking into "subst" and "net use", however the first does pretty much the opposite and the latter doesn't do what I want.

Best regards,

mf_2

Link to comment
Share on other sites


You might want to look into "Junction Points" in Windows, although I'm not sure if they'll work over the network.

Junction points redirect file writes destined to D:\Data and redirects them to another location. To the application it writes and reads to/from D:\Data, but the file system is really accessing it from the other location.

Link to comment
Share on other sites

Why not mount the network share as D:

create your share as: \\myserver\globaldata\data

Put your data in: \\myserver\globaldata\data

then map D: to \\myserver\globaldata

You will have to change the existing D: drive to another letter though so some users may get confused if they use D: for other things.

Link to comment
Share on other sites

I cannot change the D partition to another drive letter since there is other data on that drive too and the main application on those computers is looking for that other data on D only. I'll look into those junction points.

Edited by mf_2
Link to comment
Share on other sites

You can try using the subst command to map a network path to a drive letter location, but I can't guarantee that will do what you are looking to do. However, there's really no other way I'm aware of with built-in tools (perhaps there's a 3rd party app that can do this, but someone else would have to provide info on one if it does exist, as I do not know of one).

Link to comment
Share on other sites

You can try using the subst command to map a network path to a drive letter location, but I can't guarantee that will do what you are looking to do. However, there's really no other way I'm aware of with built-in tools (perhaps there's a 3rd party app that can do this, but someone else would have to provide info on one if it does exist, as I do not know of one).

He already has an existing D: drive so subst would cause a drive letter conflict resulting in one of them to disappearing. If it must be something native (barring the (free) junction point utilities), there is always there is always the mount a partition to a folder option. Create a folder called data on the existing D: drive, mount a partition to that folder, and put the data there.

Just a Thought

Stoic Joker

Link to comment
Share on other sites

That's mounting partition to a folder...not a network drive. :)

I'd recommend looking at Winbolic Link. If you look at the example on the Winbolic Link site they're showing a link being created to a mapped network drive. I don't know how well it'll work and you'll obviously get an error if the drive isn't mapped...but apparently it is possible.

Link to comment
Share on other sites

That's mounting partition to a folder...not a network drive. :)

I'd recommend looking at Winbolic Link. If you look at the example on the Winbolic Link site they're showing a link being created to a mapped network drive. I don't know how well it'll work and you'll obviously get an error if the drive isn't mapped...but apparently it is possible.

Right, I was looking at duplicating the path on the (server) target machine also...which I'd assumed would also be part of their objective. Winbolic Link is another (junction point) 3rd party utility that it seems they don't want to use... *Shrug* ...This sounds like a job for DFS, but I'm not really sure what the "Sticking Point" in the client side D: -vs server side D: folder structure is.

We may all be over thinking this.

Link to comment
Share on other sites

I'm not overthinking it at all. :)

I understand that he has a client-side application that looks for files in D:\data on the client. What he wants to do is have all of his users share the same data, but all of their workstations already have D: partitions. There's only two ways that I know of to fix it in that case:

1. Login to every workstation and change the drive letter for the second drive/partition to something else, and then map a network share to D:.

or

2. Create a junction point at D:\data that points to a network share. To do this you have to use something like Winbolic Link because Windows doesn't come with a utility to create junctions (also known as symbolic links in the *nix world).

I think I recall there being a utility in one of the Resource Kits to create junctions though. I'll check on that later.

Link to comment
Share on other sites

I'm not overthinking it at all. :)

I understand that he has a client-side application that looks for files in D:\data on the client. What he wants to do is have all of his users share the same data, but all of their workstations already have D: partitions. There's only two ways that I know of to fix it in that case:

1. Login to every workstation and change the drive letter for the second drive/partition to something else, and then map a network share to D:.

or

2. Create a junction point at D:\data that points to a network share. To do this you have to use something like Winbolic Link because Windows doesn't come with a utility to create junctions (also known as symbolic links in the *nix world).

I think I recall there being a utility in one of the Resource Kits to create junctions though. I'll check on that later.

Okay ... I'l give you that, but he never really specifies if the D: drive is local or network (granted local is a safe assumption). If it is local then he'd need to go to each machine to create the junction point, unless there is some way of scripting its creation.

It just seems like (Yes I'm digging at the why/how they got here) there's got to be a better way (DFS?) to do this.

...So I'm overthinking it by my self then. ;)

Link to comment
Share on other sites

Thank you for this much input to my problem.

I googled for junction points and found a bunch of Microsoft applications, linkd and mountvol. Linkd looked promising but doesn't work.

I want to map \\myserver\globaldata into D:\data, so this is my linkd command: linkd D:\data \\myserver\globaldata

Since this didn't work, I swapped the parameters, but it still didn't work.

The error message I got was "Cannot create a link at %whichever-path-the-first-parameter-is%". When googling about that error message, I got exactoly six results, two were identical and one was either in Chinese or in Japanses, so that left me with four links, all of which turned ot to be addressing some SYSVOL Active Directory troubles.

I am really running out of ideas here.

I cannot simply change the drive letter of the local D: to something else, that is an absolute no-go.

Does anybody have any other suggestions?

Edited by mf_2
Link to comment
Share on other sites

Here's another utility (now owned by Microsoft):

http://www.microsoft.com/technet/sysintern...k/Junction.mspx

Also...see the note on that page:

Note that Windows does not support junctions to directories on remote shares.

That's probably why your command wasn't working. You have to create the junction to a mapped drive. So you were doing this:

linkd D:\data \\myserver\globaldata

Where you should've mapped \\myserver\globaldata to a drive letter (such as G: for example) and used the following syntax:

linkd D:\data G:\

Edited by nmX.Memnoch
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...