• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Change where shares point

I'm looking at a major data move and am facing having to recreate a large number of shares on a windows 2000 file server. We have run out of space on one of our user drives and have just purchased a new larger drive array to store it on. For the innitial data move I plan to do a full backup and restore from tape, which will maintain all permissions.

The problem is that there are a large number of file shares that will need to be recreated. Is there a way to either redirect the existing fileshares to the new location or can someone help me with creating a script to copy, modify and recreate the existing shares?
0
Canisrufas
Asked:
Canisrufas
  • 5
  • 2
  • 2
1 Solution
 
Steve KnightIT ConsultancyCommented:
OK, are these multiple shares 'user' home drive shares or others.  If they are individual user shares perhaps think of moving away from this and have a \\server\users share and connect home drives to \\server\users\%username%.  Only works if all clients are >=W2K

Again if they are user shares and you just want to keep them as is it is not difficult to write a quick bathc file to skip down folders in the current directory and share, i.e.

for /f %%a in ('dir D:\users\*. /b') do net share %%a=D:\users\%%a

or to create hidden shares for each directory in d:\users:

for /f %%a in ('dir D:\users\*. /b') do net share %%a$=D:\users\%%a

As to other shares perhaps get a list with net share then this could be parsed back into another set of net share commands at the new server, may be better off just re-creating simple 'shared area' type shares depending upon the no. involved.

hth

Steve
0
 
gbirkemeierCommented:
Have you looked at using DFS (Distributed File System)?
You could implement it before the move, then when you make the move it will be a snap to transfer the shares.

http://www.microsoft.com/windowsserver2003/techinfo/overview/dfsfaq.mspx
0
 
Steve KnightIT ConsultancyCommented:
Don't bother with the tape backup method BTW if the old drive area is staying in place BTW.  Use an XCOPY command to copy including permissions, onyl newer files etc.  Run this once beforehand to create all the directoreies and a snapshot of the data, create all our shares ready (asssuming different server...) then run it again to copy anything that has changed.  Alternative is robocopy.

xcopy source dest /d/s/e/k/y/o/r

As above DFS does work very nicely BTW if it is an option...

Ask if any more info. needed on these

Steve
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
CanisrufasAuthor Commented:
The users drives are set a couple ways. As this is a citrix envo they have roaming profiles and home folders set in AD. Additional drives are set via login script.

net use F:/d
net use P:/d

net use f: \\File01\eladata$
net use p: \\File01\Publicfolders


etc etc etc.

I'll be pulling the 60 gig array out of the server and replacing it with a 360 gig array. So I'll have to restore data from tape, no big deal, though it means down time which we all hate. the problem is that there are a lot of eladata$ nladata$ sdodata$ type shares, and there are so many different groups that have access to so many different combinations of folders, that I pretty much have to have the sharenames recreated exactly as is, not to mention the share permissions.

To add insult to injury the folders are name
f:\shares\ela
so if I just share it based on the "ela" portion of the name it wont work, I'll need the "data$" added on to the end
0
 
gbirkemeierCommented:
I assume ela is a username?
If you have a list of the usernames and folders, you could make a batch file that used the net share command:
net share %username%data$=f:\shares\%username%

Or,
Is the array hardware based or software? Can you hook up both arrays at the same time? If it is hardware based then could you image the old array to the new array?  This would preserve all of the shares (well, everything actually) and would take less time than a tape restore.
Since the old array is so small you could do a three step, and copy it to a singls drive, then install the new array and copy the data back to it.

You could use a tool like Bart PE with the array drivers loaded and either image the array to the new array.

Sorry, just tossing our ideas.

0
 
Steve KnightIT ConsultancyCommented:
Hang on a minute.  If this is the same box and the drive goes back on the same drive letter then there is nothing to do - shares are held in registry so will remain acros the array change - I presume your system boot discs are separate?

Might be offline most of today,  will look back later but no doubt others will elaborate further too if required
0
 
Steve KnightIT ConsultancyCommented:
So how did you do it in the end then?
0
 
CanisrufasAuthor Commented:
Still haven't done it actualy, but I'm going to be backing up the drive aray to a NAS, then swapping out the drives, and restoreing it back. I've created a batch file to recreate the shares as when the OS starts and finds that the folders aren't there it automagicaly removes the shares. Net Share batch file to the rescue!
0
 
Steve KnightIT ConsultancyCommented:
The OS doesn't remove the shares if the folders aren't there.  They stay in the registry and are re-created next time the directory exists.  If you boot without the folders being there or just stop/star the server service you will see an event log entry saying the server service was unable to re-create the share.  To test this create a share for a directory, stop the server service, remove the directory and try restart it.  You will see an error in the event log and no share but the service will start.  Now re-create the same directory name, restart the server service again and the share should be back...

Steve
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now