Solved

Change where shares point

Posted on 2006-06-28
9
176 Views
Last Modified: 2010-04-13
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
Comment
Question by:Canisrufas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17004797
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
 
LVL 4

Expert Comment

by:gbirkemeier
ID: 17004815
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17004883
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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

Author Comment

by:Canisrufas
ID: 17005700
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
 
LVL 4

Accepted Solution

by:
gbirkemeier earned 125 total points
ID: 17005833
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17006951
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17096850
So how did you do it in the end then?
0
 

Author Comment

by:Canisrufas
ID: 17111167
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17111327
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question