My Life: Wired

In regards to my previous post, this is my step-by-step guide to show you how to (imo) properly setup CrashPlan for backing up to and from a Windows Home Server.

Step 1: Logging in and creating the destination

You need to log into your Windows Home Server Administrative Desktop via remote desktop connection. If you don’t know how to do that, then I think this whole simple guide will be too complicated for you.

After you log in, make a new folder in the C:\ drive. I decided to just name mine c:\mount. You don’t HAVE to do this, but I like keeping it separate from other folders even IF it will only carry 2 small files. But whatever the case is, KEEP WHAT YOU’RE DOING OFF THE D: DRIVE, as per Microsoft’s request.

Step 2: Creating the .bat file

Next we create the .bat file to map the shares. This was actually the first time I put some work in .bat files since like `96 or so. All a .bat file is, is a file that runs a list of commands. Open up notepad, and even though it is blank, go ahead and save it. In the save menu, make sure you save it in the folder you created/chose and you save it as a .bat file. In other words, in the “save as type” make sure you select “all files”. I saved mine as "c:\mount\mount.bat".

Now we add some code to the file. I got most of the general code from here, but it still requires tweaking. This is how your .bat should look like:

echo %date% %time% : "%cd%\mount.bat" >> c:\mount\mount.log

timeout /t 60

net use X: \\<server>\<folder> /USER:server\Administrator <password> /persistent:no >> c:\mount\mount.log 2>&1 2>&1


Note: the "net use" line is one line, gotta love word-wrap

Obviously, you can change where you want the log to go, like I said, I just like having it in the mount folder. The ‘timeout’ is very important because without it, your shares won’t be mapped, and you will get a log full of ‘error 67’, I believe because the server hasn’t fully loaded everything when this .bat file is ran, so it gives it a minute to let everything load before it begins mapping the shares.

The /persistent:no command is also important, because without it, if you reboot, your shares won’t be mapped, as the .bat file is waiting to see if you want to overwrite the original map with this one. This prevents the system from remembering the mapped drives.

Now obvisouly you want to repeat the ‘net use’ per share you want to drive, mounting it to different letter. This is my .bat with only the password changed.
Image 2595

echo %date% %time% : "%cd%\mount.bat" >> c:\mount\mount.log

timeout /t 60

echo "Mounting U with \\server\music" >> c:\mount\mount.log
net use U: \\server\Music /USER:server\Administrator <pw> /persistent:no >> c:\mount\mount.log 2>&1 2>&1

echo "Mounting V with \\server\Photos" >> c:\mount\mount.log
net use V: \\server\Photos /USER:server\Administrator <pw> /persistent:no >> c:\mount\mount.log 2>&1 2>&1

echo "Mounting X with \\server\Misc" >> c:\mount\mount.log
net use X: \\server\Misc /USER:server\Administrator <pw> /persistent:no >> c:\mount\mount.log 2>&1 2>&1

echo "Mounting W with \\server\Software" >> c:\mount\mount.log
net use W: \\server\Software /USER:server\Administrator <pw> /persistent:no >> c:\mount\mount.log 2>&1 2>&1

echo "Mounting Y with \\server\Users" >> c:\mount\mount.log
net use Y: \\server\Users /USER:server\Administrator <pw> /persistent:no >> c:\mount\mount.log 2>&1 2>&1

echo "Mounting Z with \\server\Videos" >> c:\mount\mount.log
net use Z: \\server\Videos /USER:server\Administrator <pw> /persistent:no >> c:\mount\mount.log 2>&1 2>&1


You can see I added the echo lines just so I know what was mounting. If I didn’t, I would just get a list of “The command completed successfully.” I like my logs clean-ish.

Step 3: Setting up the Task
• Navigate to C:\Windows\Tasks in your WHS Admin Desktop
• Double click on ‘Add Scheduled Task”
• When the task wizard pops up, click next.

Image 2596
• Then when it asks to select a program, click ‘browse’, navigate to and select the .bat file you made.

Image 2597
• Go ahead and keep the default name… or change it… and select “When my Computer Start”, then click next.

Image 2598
• In the user name type “NT Authority\System” and leave the password fields blank.
• Now check the box next to “Open advanced properties for this task…” and click finish.

Image 2599
• Jump over to the Settings tabs and change the “stop the task if it runs for” to 0 hours and 5 minutes. In reality, depending on how long you set the timeout it should be executed quickly. I just set mine for 5 minutes, but if your timeout is set at 60 seconds, really 2 minutes would be sufficient. I also removed the check marks in the power management.
• Finally hit ok and reboot.

Step 4: Setting up CrashPlan.

After you reboot and your server is online, jump back into the admin desktop and install CrashPlan if you haven’t already. When you open your “my computer” you will see a few ‘Disconnected Network Drive” which is normal as the .bat was ran under the System profile. But you can double click on one of them and it will pop up your files on that share. So after you install CrashPlan, add those drive to the “what to backup”.

Image 2600

Step 5: Incoming backups
If you are not planning on backing up to WHS through CrashPlan, I would disable the ability in CrashPlan via settings > backup > Inbound backup from other computers. If you are, and plan on using the D: drive, probably best to create a folder through the WHS console (like ‘CrashPlan’) and turn off file duplication. Then mount that share the same way by adding it to your .bat file, reboot, then make the changes in CrashPlan.

I hope this helps someone who was lost like me, because this was driving me nuts. But all and all, it looks like it is working like a charm and I haven’t ran into any issues. I believe this is a much better way to do an online backup of Windows Home Server without directly referencing the d:\shares folder.

Should I run into any problems, I surely will post about it.

P.S.
Image 2601
Ah crap...

Edit: I have noticed, after speaking with people on the forums who were following this guide, that there is an issue with using net use and passwords with symbols. I have yet to find a solution, but as far as I know, you cannot use symbols in the password for it to work. you have to keep it alphanumeric. I am not sure exactly one what symbols you can use, but it is better safe than sorry. On an unverified comment Jason mentioned "The issue with symbols in passwords is not a net use issue, it's a batch file issue. You need to escape any special symbols with a carat (^)."

Also, if you are having trouble still, try going into command prompt and running the bat file from there. That way you can see any errors that may show up.

Tags: Backup,Crashplan,Guide,Technology,Windows Home Server
6%
Home About RSS Archive Tags Copyleft