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. Windows 8.1 now supports SD cards (I gather). Since the mounting and dismounting of the VHD seems a hit or miss process for me, Im wondering if I should get rid of the VHD. The question now is how. One way of course would be to reformat. But then Id have to copy all my files back on. Is there an alternative. I dont think simply dismounting the VHD does it because the files aren’t seen by the D: drive.

  2. I got this to work flawlessly on my Surface RT but it refuses to work on my Surface Pro! I know 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?

  3. Is it possible to remove/replace the SD card after creating the VHD? Will the same process work with external hard drive? Can external hard drive be removed? I have Surface RT.

    1. You will want to disable the Start up Script if you remove the card and keep it removed prior to rebooting. Yes this will work the same with an external hard drive, same rule applies for the start up script except you will want to make sure it is also connected every time you start. If it isn’t you can skip the start up script and just double click the VHD every time.

  4. Hi Matt!

    Thanks for this fantastic guide, worked a treat for me. Hope MS get this sorted soon so we don’t need the work around.

    Only problem I am having is downloading movies. It seems files are stored to a temporary location somewhere on the C: drive first before they are moved onto the SD card. This is a problem as I don’t want to keep 10gb free on C: all the time! Do you know of any way to override this so it is stored straight onto the SD card?

    Thanks!

    1. Thank you for the feedback. The default behavior with IE is when a download occurs it goes directly to the C drive, I do not know a work around for this but you will notice it’ll continue to download just slow down the progress an extreme amount.

  5. Thanks for the article. Unfortunately everytime I try to make the vhd I get the error “The requested operation could not be completed due to a file system limitation”. I’ve tried multiple file sizes some well below the capcity of the card. Any ideas?

          1. I just worked with my buddy @IT_Josh and he was able to verify on his Surface Pro that the problem is the card being formatted as FAT32, please format the SD card to NTFS and try again.

          2. New problem, the drive vhd mounts fine at restart but is nearly full. It ounly has 4 empty folders on it. Any Ideas?

          3. So before you restart the VHD is full of files, once the computer comes back up after the restart the files are missing?

          4. Oonly thing on the vhd/mounted disk are 3 empty file folders and one with a 1.5 mb file. they are all there on restart. The SD card itself on properties shows it is empty. The mounted drive shows nearly full on properties tab

          5. I just tried a quick format of the mounted virtual drive. There is nothing on it and is shows 49 GB used and 8 free. The SD card shows empty

          6. Actually it only shows 59 MB total space not GB. That because it is an expanding vhd? Either way I can’t store files more than 8 MBon it

          7. Got it. Did a new vhd and it works fine. Guess I picked MB instead of GB when I set the drive size

            Thanks!

  6. Hi Mate,

    First i have to thank you for this guide. But sill i’ve got a Problem over here.

    I set up all as you wrote. It even works by adding photos to the “Pictures” Folder on the VHD. They were instantly displayed oin the Photo-App in Metro-UI.
    I thought I’ve got it so I did a restart to test the Auto Attach Script. But after the restart, the VHD wasnt online. It didnt showed up under “Computer”. So i did a double click on the VHD.vhdx
    Now it is online and can be selected. But if i copy new Pictures in the Folder, the Photo App wont Display the new ones….any Idea?

    1. Did you immediately check after the computer started? Try giving it 5-10 seconds (remember it should be a Delay Start) and see if you are still experiencing the issue.

      1. Yeah u were right. I was just impatient 🙂

        But still got a Problem. The Photo App dont Show new Pictures again.

        If I got the Indexing menu and unselect the VHD and select it again it starts seasrching. After it’s done all new Pictures Show up in the app…

        Any Ideas why it didnt start automatically?

        Thanks again 🙂

          1. I am not sure how frequently the Indexing Service will look. I thought at first I was having same problem as you were but eventually the images did show up in the photo application.

  7. Hi

    Interesting article, I try to do following the instructions, but seems that I screw something, and revert everything

    Now every time I take an screenshot is saved in the SD card (drive D:) also the camera store the photos in the SD but after I remove the SD card now pictures are stored in the disk C, but screenshots not appear in the screenshots library, I install back the SD card and continue to save on drive D, weird.

    Any hint?

    Also I wonder, if pictures are stored in the SD card and I delete by mistake one, the SD card doesn’t have a recycler bin, so I cannot un erase the picture, exist a procedure to set up a recycler bin in the SD?

    Thanks for your help.

    1. Edgar, the issue you are experiencing with your SD card is related to the configuration of your Libraries. You still have them set as the default, when the SD card is removed it is unable to find the primary so it stores it to the C drive. Please look at the current configuration of your Libraries and you should be able to resolve the issue.

  8. Thank you so much for the guide! I used it on my Acer W510 and it really works well. I haven’t got the auto-script to work however. Trying to figure out what I’m doing wrong. Thanks!

    Robert

    1. Verify you have your PowerShell Execution Policy set for RemoteSigned, and you are pointing to the correct PowerShell file with the Scheduled Task.

  9. awesome article. Everything seems to work but I cannot get my pictures to show in the photos app. I see them in my library in desktop under the VHD drive and I have configured the library to point to this folder under the VHD drive. Need help.

Leave a Comment

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