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. A huge thanks! Your instructions were very helpful!

    I had to make a few changes to get this working in Windows 10 respecting the Auto Attach script.

    1) When creating the boot-up task “Attach SD VHD”
    -> under the General Tab:
    -> set “Configure for:” to Windows 10 (for some reason it defaults as Windows 8.1 even in W10)

    2) When creating the Auto-Mount.ps1 file, make sure it is saved as a .ps1 file and not as a text file
    -> in the file explorer, select View tab
    -> check box “File name extensions”
    If the file name now appears with a .txt extension, delete the .txt by renaming it

    3) To keep everything consistent, my ps1 script mounts a .vhd not a .vhdx

    1. Hi Max,
      I’m trying to get this work but i can’t get automatic mounting to work, can you place somewhere some print screens?

  2. SAVE 4GB ON YOUR C:\ DRIVE

    After doing this–many thanks–I thought I might add a few suggestions for others about how to free up additional space on the C: drive. For me, this ended up saving about 4 GB on my C: drive.

    (1) Use webroot as your anti-virus software. After realizing symmantec was taking up >1GB, I read this review and switched. Good rating, low disk space needs… http://www.pcmag.com/article2/0%2c2817%2c2470317%2c00.asp

    (2) Move your Microsoft indexing file to your new SD card drive. This was about 2GB. http://windows.microsoft.com/en-us/windows7/change-advanced-indexing-options#

    (3) Move your outlook data file to the your new SD card drive. Even configuring outlook to only cache 3 months of email, I still have a >1GB data file. https://support.microsoft.com/en-us/kb/2752583

  3. I found this page more than a week ago, looking for a way to get Dropbox to accept a director on an SD Card on my Surface Pro 3. I followed the directions and it worked great. Today while another application was writing data to a Dropbox folder, the mount was dropped and both applications died. 🙁 The virtual disk no longer mounts on boot, and when I go into PowerShell and try to mount it manually, I get a permission denied error (FullyQualifiedErrorId : HRESULT 0x80070005,Mount-DiskImage).

    I haven’t played with virtual drives before. Any ideas on where to go next?

  4. Absolutely awesome. Thank so much for taking time to document all this. Just did my XPS 18 and it worked fine.

    Here are a couple of things noted about my process:
    Under “Create a VHD”, item 10 – “Create VHD” was disabled. I finally figured out I had to select a drive to enable it.
    Creating the VHD took about 20 minutes, probably because I’m using a 128gig SDXC. I hit Refresh and was wondering where Disk 2 was until I saw “Creating Virtual Disk…” in the status bar.
    I assume it’s okay to close Powershell and Notepad now? 🙂
    Under “Create a Script…” item 13 – not being a Powershell user, I followed your instructions to the letter. Or, number. You could make that instruction clearer if you said, “Paste in the text between the quotes below”. On my first attempt I gave the script the number 1, period, quotes and all. But hey, I was expecting the error. I just had to be sure. 🙂

    So, thanks so much! Two years later we’re still benefitting from your guidelines.

    1. Thanks for the feedback. To this day I never expected this blog post to be so popular. I even reference it fairly frequently and I’m thrilled that it has helped so many other people!

  5. hi
    i’ve the same problem as Joe…
    on my Surface Pro with win 8.1! I followed each step exactly as you’ve laid it out, so I don’t know what the issue could be.
    Task Scheduler says that the operation completed successfully, but the VHD still isn’t mounted. When I try to run “Mount-DiskImage D:\Libraries.vhdx” in Powershell as Administrator to test it out, it tells me “Mount-DiskImage: Access is denied.” followed by some other text that I don’t really understand. I’m sure that this is the problem but I don’t know how to fix it. Anything that you can think of that might cause this to happen?

  6. Pingback: You Gotta Try This: Microsoft Surface Pro | Minneapolis Media Institute Blog

  7. Pingback: Create a Custom Recovery Image

  8. Pingback: Micro SD card appear as a real drive to install DropBox etc

  9. I have so many different methods of accomplishing this task and read more “That didn’t work when I tried it” comments than seems normal.
    Having tried multiple times I finally came across a post that had it RIGHT…and almost as important – SIMPLE. I wish I had made a note of the site but I was using a friends Ultrabook -so my apologies (and thanks) to the original creator.

    Set up automatic mounting on system startup. -Win+W, type Schedule Tasks, enter. In the tree on the left side,click on “Task Scheduler Library”
    -From the “Actions” pane, click on “Create Task”
    Enter “mount D:\disk.vhd” (or anything you’d like) as the task name. Likewise description is optional -Select “Run whether user is logged on or not” Check “Run with highest privileges” -In Triggers tab, click New, select “At startup” and press OK.
    -In Actions tab, click on New. Select “Start a program” as Action. In program/script, put “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.”
    In add arguments, write exactly
    “-command “mount-diskimage D:\disk.vhd””
    -In Conditions tab, uncheck everything. Press OK
    Enter your Windows password and press OK. That’s it!
    Restart the system and see if your new drive is visible after login.

    Set up Windows Indexing.
    Win+W, type Indexing Options, enter Click on modify, check the new vhd drive (probably E).
    OK, Close.
    You can now create folders in the mounted vhd and add them to library.
    I hope this help everyone else as much as it did me!

Leave a Comment

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