Solved

Change where shares point

Posted on 2006-06-28
9
170 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
 

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Migrate DHCP from server 2000 to 2008 1 618
Windows 2000  Domain controller 3 487
Windows Explorer and WinZXip 4 493
Update a root certificate 8 622
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…
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now