Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On my Windows 2008 system, I've attached an external USB drive that's encrypted using Truecrypt. Once I mounted the Truecrypt drive, I share some of the directories from that drive using Windows file sharing. I find that whenever I restart the server, these shared directories are no longer shared and I to recreate share them. Pain.

Is there any way to avoid having to recreate these shares every time? Perhaps if I can script the sharing of the drives, perhaps I can run the script I mount the drive? If so, can someone tell me what the script commands are? For example, I want to share Z:\dir1 as \myserver\dir1 to everyone (no authentication required).

Thanks.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

If you restart the server service then those shares should be restored.

If you wanted to script this just do a net stop server followed by a net start server.

share|improve this answer
    
That worked! But now my clients are getting prompted for authentication even though I've turned off "Passoword Protected Sharing" and I've added "Everyone" with full-control to the share. –  Sajee Jun 17 '09 at 22:22

Add "ANONYMOUS" instead of Everyone

share|improve this answer
    
Thanks, that worked. I had to keep Everyone and add Anonymous (which by itself didn't work). Any idea about this: serverfault.com/questions/27713/… ? –  Sajee Jun 18 '09 at 12:26
    
After I restarted the server service, I'm getting a Windows Security auth dialog when I go to \\myserver. Any idea why this is happening? I tried removing Everyone and just using anonymous but I'm still getting the auth dialog. –  Sajee Jun 18 '09 at 14:13

it's ok, but NFS shares and QUOTAS don't restore.

share|improve this answer

In truecrypt, you can add the external drive as a system favourite, and to automatically mount system favourites when windows starts. This works around the problem of shares becoming unshared. The only problem is, the system drive needs to be encrypted, and have the SAME PASSWORD as the external drive.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.