Solved

Change where shares point

Posted on 2006-06-28
9
174 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
  • 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

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…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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