Configure Surface to use MicroSD as Primary Storage

After about a week of excitement and playing around with features, I decided it was time to start optimizing and making this thing run the way I wanted. The first thing I noticed was that I could not use my SD card with my Libraries, so all my apps are going to by default save to the local SSD, which is far from what I want. I knew there had to be a way around this, so I started digging in. I feel I finally have it to the point where others should be doing the same thing, and once done, you can forget about it.

  • Create a VHDX and save it on the SD card
  • Create directories on this VHD for your specific libraries
    • Documents
    • Music
    • Video
    • Pictures
  • Configure the libraries
  • Enable Indexing on the VHDX – This is important because the Photos app doesn’t work right without it.
  • Have a script automatically Attach the VHD on Boot

If you would like to know the exact steps to take, please continue reading.

Creating a VHD

  1. Open Charms Menu (Swipe in from the right side of the screen)
  2. Click Settings
  3. Click Tiles
  4. Change “Show administrative tools” to Yes
  5. Swipe from the bottom of the screen
  6. Click All apps
  7. Under “Administrative Tools” click Computer Management
  8. Click “Disk Management”
  9. Click “Action”
  10. Click “Create VHD”
  11. Browse to the SD Card’s storage and name the VHD whatever you want
  12. Allocate as much of the SD’s storage you want to this VHD,
  13. You can decide between Fixed or Dynamically expanding. I went with Dynamically expanding.
  14. Find the newly created disk in the lower panel, which should be “Disk 2”
  15. Right-click where it says “Disk 2”
  16. Click “Initialize Disk”
  17. Click OK
  18. Right-click “Unallocated”
  19. Click “New Simple Volume…”
  20. Click “Next >”
  21. Click “Next >”
  22. Select the Drive letter you want (can be anything)
  23. Click “Next >”
  24. Name the Volume whatever you want
  25. Click “Next >”
  26. Click “Finish”

Create/Configure Library Directories on VHD

  1. Click the “Libraries” icon from the “Task Bar”
  2. Single click “Documents”
  3. Click “Manage under “Library Tools” from the ribbon
  4. Click “Manage library”
  5. Click “Add”
  6. Browse to the newly Attached VHD you just created
  7. Click “New Folder”
  8. Name it whatever you want (Eg: Documents)
  9. DO NOT OPEN THE FOLDER, select the folder and click “Include folder”
  10. Remove the Default Personal folder
  11. Click OK
  12. Click “Set save location”
  13. Select the newly created folder
  14. Repeat steps 1-13 for the following
    1. Music
    2. Pictures
    3. Videos

Enable Indexing on VHD – Very Important

  1. Open the “Charms Menu”
  2. Click “Search”
  3. Type “Indexing Options”
  4. Click Settings
  5. Open “Indexing Options”
  6. Click “Modify”
  7. Select the newly Attached VHD
  8. Click OK
  9. Click Close

Create Script to Auto Attach on Startup

  1. Open PowerShell as an Administrator
  2. Type “Set-ExecutionPolicy RemoteSigned”
  3. Press Enter
  4. Type “y”
  5. Press Enter
  6. Click Computer from the navigation bar on the left of the Libraries folder
  7. Open the C: Drive
  8. Create a new folder named “PoSH”
  9. Double click the new folder
  10. Right-click in the white area and navigate to “New > Text Document”
  11. Name it Auto-Mount.ps1
  12. Open the new file with Notepad
  13. Paste the below code in, don’t forget to modify the red text to the path you saved the VHDX file at
    1. “Mount-DiskImage D:\YourVHD.vhdx”
  14. Open the “Charms Menu”
  15. Click “Search”
  16. Type “Task Scheduler” and open it
  17. Click “Task Scheduler Library”
  18. Click “Action”
  19. Click “Create Task…”
  20. General Tab
    1. Name: Attach SD VHD
    2. Location: \
    3. Description: This is the Task that automatically attaches the VHD file on the SD card on system boot.
    4. “Click Change User or Group…” type in SYSTEM
    5. Check “Run with highest privileges”
  21. Triggers Tab
    1. Click “New…”
    2. Begin the task: At startup
    3. Click OK
  22. Action Tab
    1. Action: Start a program
    2. Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    3. Add arguments: C:\PoSH\Auto-Mount.ps1
    4. Click “OK”
  23. Conditions Tab
    1. Under Power uncheck “Start the task only if the computer is on AC power
    2. Click “OK”
  24. Have fun testing. I recommend opening the Camera app and taking some pictures, making sure it index the new ones, try adding music to the folder make sure it shows up in the music app, the same thing for the Video app.

Update 12-30-2012: Thank you, Don, for reminding me you need to set the execution policy on the machine first.

Love it? Share it!

92 thoughts on “Configure Surface to use MicroSD as Primary Storage”

  1. Nice article! The steps will be better if we mount the SD card to an empty NTFS folder instead of using drive letter “D” because this auto assigned drive letter will be taken if you have another USB drive plugged in when system boots, thus the SD card becomes “E” or something else. The script will then fail. Mounting to an empty NTFS folder on C, or manually assign a not likely to be used drive letter to SD reader should solve the problem.

    For the same reason, when mounting the VHD file, we should manually assign a not likely to be used drive letter to it. 🙂

  2. This is pretty awesome, though I can’t get the script to auto mount on start-up, though I work on that tomorrow. Thanks though for your hard work, excellent resource!

  3. Great tutorial. I could not get my surface to use the SD card for Libraries any of the other ways proposed linking or using a c:\ drive mount point. This worked off the bat.

    The missing step Don probably thought of.

    Step 13.5: Exit notepad saving your script.

    Obvious but needs to be done before setting up the task.

    Copying music now 🙂
    After that will reboot with fingers crossed.

    I think this is a serious? oversight by Microsoft. Considering the usable space on a 32 GB Surface use of the SD Card (Media Card) for media is an obvious thing. Hopefully they’re working on a fix. I had one of the chat support guys tell me that media cards weren’t supported for media but USB drives are. That’s just ludicrous. A USB drive being much more detachable and volatile than the SD Card. I cant see a reason to remove the SD Card.

  4. Great article. I found a few problems with the above, but no biggie. In order to create the VHD you have to format the MicroSD as NTFS.
    The VHD that gets created at least on my machine is created with an extension of VHD and not VHDX.
    In the PowerShell script you have the Trigger to mount the VHD at startup. What I found is when the system hibernates the drive is no longer mounted. I tried mounting at login, but the annoying part of this is that your initial experience is that you land on the desktop with Windows Explorer and not at the Modern UI Start Screen. Any Suggestions?

  5. Thanks for the great instructions and research! I figured all I had to do was buy a memory card, insert it, and configure the library paths. Obviously not. 😛

    Something you might want to add to the instructions is that running PowerShell scripts is disabled–at least it is on Windows RT on a Microsoft Surface RT.

    To get the script to work, I had to run the PowerShell app as an administrator and then enter the following PowerShell command:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

    This sets the policy for the local computer so that scripts created on the system can execute but downloaded scripts can’t be run unless they are signed properly.

    There are other execution policy settings available that may be more appropriate for other users.

    Supposedly you can use this shorter command instead of the longer form above, but I didn’t try it.

    Set-ExecutionPolicy RemoteSigned

    There’s also a missing step in the instructions, but I can’t remember what it is right now. I know it was simple and obvious, though–something like a missing note to press OK or something similar.

    Thank you again for your help/work on this. It is greatly appreciated. Your solution works smoothly and without requiring a second thought.

    Don

    1. I followed all of the instructions and the SD card VHD works well. However, I cannot get the automatic mounting at start-up to work. When I enter the script in PowerShell, the action is denied. How do I sign on as Administrator as suggested. My PowerShell command line reads “PS C:\users\Joseph>” I thought I had administrator privileges but I guess not. Thanks in advance

      1. You need to right click the PowerShell icon and Run as Administrator. Inside of the PowerShell command prompt execute Set-ExecutionPolicy RemoteSigned

  6. Each time I try to create the VHD, I get an error stating the requested operation could not be completed due to a file system limitation.

    1. Please provide me with the following information
      1. What hardware are you running?
      2. What Updates if any have you installed?
      3. What type of external storage are you trying to place the VHD on?

  7. Dangit. I found this page because the previous trick with symbolic links wasn’t working for me at all with the music app. I have this all set up with a working VHD, auto-mounted on startup even, indexed, added to libraries as primary save locations, and pictures taken save right into it, but neither the music app nor the photos app will show anything located in the folders. Odder yet, the Music Info app (very nice, BTW) which did work with symbolic links does not now work with these VHD locations. I’ll try a complete redo I suppose.

  8. You can also hide the drive that hosts the VHD to no ill effect.

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    Create a new DWord entry called “NoDrives” and give it a corresponding hex or decimal value for the drive. (E: is decimal 16, or hex 10)

    You can still access the E: if you type it in manually, but it’ll no longer show in the list.

    Approaching a polished, finish product here. 😉

    1. Do you have a source where you found this information? When I update the blog I’d like to provide sources of where you learned about this. If you discovered it on your own I’ll give you direct credit 🙂

  9. I would like to say many thanks to everyone giving me some fantastic feedback on this article and tips on other things to add to it. I will be playing with some of these methods when time frees up and be summarizing these other alternatives.

    Please keep providing this great stuff guys and I will get to it as soon as possible!

  10. I was also able to bitlocker the memory card, create the VHD using this method, and prior to mounting the VHD, add the following command to the script:

    manage-bde -unlock e: -RecoveryPassword {big recovery number}

    Then the VHD mounts as drive D:.
    Autounlock doesn’t work on the Surface platform at this time. Since your unlock password resides in the bitlockered built in surface drive, this should be relatively safe to do. Someone would have to crack the encryption on the C: to get the key to unlock the E:, that hosts the VHD.

    1. Could you please point us toward (or provide in brief) the process by which you bitlockered the card? I would like to have that added security, even if I’m only going to have music and images on it. Stray GPS coords plus personal images seems like a good thing to keep hidden in case the machine goes missing.

Leave a Comment

Your email address will not be published. Required fields are marked *