Configure Windows to use MicroSD as Primary Storage

So after I got my first surface Pro i realized it didn't have enough storage. I then set out to find a solution to solve this issue, short of strapping an external HDD to the backside of the screen.

I first realized that if you attempt to use a SD card as storage, it will not utilize the recycle bin and also without some tinkering you couldn't get OneDrive, back then called Skydrive, to store your stuff on there either.

On to the tutorial :)

Warning: Before proceeding, please make sure to backup your sdcard. As these steps will have you format the card.

This tutorial will cover:
1. Creating a VHD and saving it on the SD card
2. Creating directories on this VHD for your specific libraries
• Documents
• Music
• Video
• Pictures
• Downloads
• Onedrive
3. Enable Indexing on the VHD4. Creating a script to automatically attach the VHD on Boot (pre-create script attached for this step)
5. Creating unmount and mount scripts to manually mount and remount the vhd (pre-create scripts attached for this step)

Creating a VHD

  1. Open start menu
  2. type "Disk Management” and click "create and format hard disk partitions"
  3. right click the sdcard in the list and click format
  4. set file system to "ntfs" and set the allocation unit size to "default"
  5. check off quick format and hit ok, let it finish and proceed
  6. Click “More actions” on the right side
  7. Click “Create VHD”
  8. Browse to the SD Card’s storage and name the VHD whatever you want
  9. Allocate as much of the SD’s storage you want to this VHD,
  10. You can decide between Fixed or Dynamically expanding. I personally went with Dynamically expanding.
  11. Find the newly created disk in the lower panel, should be “Disk 2”
  12. Right click where it says “Disk 2”
  13. Click “Initialize Disk”
  14. Click OK
  15. Right click “Unallocated”
  16. Click “New Simple Volume…”
  17. Click “Next >”
  18. Click “Next >”
  19. Select the Drive letter you want (can be anything)
  20. Click “Next >”
  21. Name the Volume whatever you want
  22. Click “Next >”
  23. Click “Finish”
  24. right click the drive letter for the sdcard
  25. click on "change drive letters and paths"
  26. click "add"
  27. click on the c drive
  28. click "browse"
  29. click "new folder"
  30. name it "sdcard"
  31. hit "ok"
  32. right click that drive again and return to the "change drive letters and paths"
  33. remove the drive letter
  34. hit "ok"
  35. close the window

Create/Configure Library Directories on VHD

  1. Open start menu
  2. type "this pc" and click on it
  3. Create new folders named “Documents”, “Downloads”, “Pictures”, “Videos”, “Onedrive”.. In my case since I have my library folders stored on onedrive, I have those within the onedrive folder
  4. Optionally create folders named “Dropbox”, “google drive”
  5. Close current window
  6. Open start menu
  7. type "this pc"
  8. Right click on “Documents” and click on properties
  9. Go to the “location” tab
  10. Click the “move” button and navigate to the newly created location
  11. click "select folder" on the new location
  12. click "ok" and if asked if you want to move the current contents of the folder, click "yes"
  13. Repeat steps 8-12 for the following:
  • Music
  • Pictures
  • Videos
  • Downloads

Enable Indexing on VHD – Very Important

  1. Open start menu
  2. Type “Indexing Options”
  3. Click on “Indexing Options”
  4. Click “Modify”
  5. Select the newly Attached VHD
  6. Click OK
  7. Click Close

Create Script to Auto Attach on Startup

download this zip file and extract the contents to that newly created folder on the c drive

vhd_mount_scripts.zip

  1. Open the start menu
  2. Type “this pc” and open it
  3. Open the c drive
  4. Open that newly created folder called “sdcard”
  5. open each of those script files in notepad and make sure the paths are pointing to the correct path for your vhd file, and also the programs in the "mount" and "unmount" scripts. the program paths are so that the cloud programs will launch after the vhd is mounted, if you like me want to have them stored on there.
  6. Open the start menu
  7. Type “Task Scheduler” and open it
  8. Click “Task Scheduler Library”
  9. Click “Action”
  10. Click “Create Task…”

General Tab

  • Name: Attach SD VHD
  • Location: \
  • Description: This is the Task that is going to automatically attach the VHD file on the SD card on system boot.
  • “Click Change User or Group…” type in SYSTEM
  • Check “Run with highest privileges”

Triggers Tab

  • Click “New…”
  • Begin the task: At startup
  • Click OK

Action Tab

  • Action: Start a program
  • Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  • Add arguments: C:\sdcard\Auto-Mount.ps1
  • Click “OK”

Conditions Tab

  • Under Power uncheck “Start the task only if the computer is on AC power
  • Click “OK”

Manual unmount and mount scripts

Since the Sdcard slot is built into the screen part of most of the Surfaces (Surface Pro 1-4 and surface 3, currently), this part of the tutorial isn't required for them. This is mostly for the Surface Book; because the card slot is in the keyboard. When the keyboard is detached, if you don't use this part of the tutorial, you will not safely unmount your data and could face data loss or corruption, and issues with cloud services.

  • Create shortcuts to the bat files on your desktop, so that you can use them to mount and unmount the vhd at will
  • make sure the paths in the bat files are pointing to the vhd and cloud programs (onedrive, dropbox,google drive) you can also add any other programs to those bat files to launch and quit.. just copy the format for the currently included paths
  • please always run the unmount script before detaching the keyboard

 I found this article helpful. (0)