Configuring Windows to use MicroSD as Primary Storage

Configuring Windows to use MicroSD as Primary Storage

Windows uses 20gb, then you take the 10GB used for file system pointers, install chrome, firefox, eclipse, and visual studio and the space is basically gone. But wait there is an microsd slot! However, Windows can’t move my libraries to the sd card, then I noticed that some programs won’t install to an sd card, and the deal breaker, Dropbox won’t sync to an sd card. The solution is to create a Virtual hard disk, VHD, and store that on the microsd card and point everything to the VHD.

I wanted a really light and portable computer that I could use in company meetings for notes, traveling, and general web browsing. I also wanted this machine to be able to compile my software projects and be useful for coding. Finally, as a guy who loves technology and wants everything, but can’t afford it, the device needs to be a reasonable price. I went with the [Asus VivioTab Note 8 64GB](https://www.amazon.com/VivoTab-M80TA-B1-BK-Tablet-Integrated-Professional/dp/B00HWHQKFI). I upgraded to Windows 10 and ran the disk cleanup utility, installed some programs and most of the hard drive was gone. I created a Virtual Hard Drive, VHD, and put that on the microsd card and then had all the programs point to the new VHD. Programs and the OS treat the VHD as a permanent hard drive.

The Plan

  • Create A VHD and save it to the Micro/SD Card/USB
  • Create Directories for your libraries
  • Configure the libraries
  • Enable Indexing on the VHD
  • Auto Mount the VHD on system boot

Creating the VHD

  1. Open Disk Management (right click the start menu icon, select disk management)
  2. Click Action
  3. Click Create VHD
  4. In the location field Browse to the Micro/SD card/usb and name the VHD file whatever you like
  5. Allocate as much storage as you think you will need. (I did the full size of the microsd – 5gb)
  6. You can use either fixed or dynamically expanding (I used dynamically expanding)
  7. Click OK
  8. Find the new disk in the lower panel of Disk Management, should be disk 2
  9. right click the left box and select “Initialize Disk”
  10. Click OK
  11. Right Click the right part where it says “Unallocated”
  12. Click “New Simple Volume”
  13. Leave it as GPT, Click next,  name it whatever you want, click next
  14. Select any available drive letter, click next
  15. click Finish

Create/Configure Library Directories – Optional

  1. Open File Explorer
  2. In the Navigation pane, scroll down to the “Libraries” folder
  3. Single click Documents
  4. Select the “Manage” Tab in the ribbon bar
  5. Click “Manage Library”
  6. Click “Add”
  7. Browse to the new VHD that you mounted
  8. Click “New Folder”
  9. Give it a name (I used “Documents”)
  10. DO NOT OPEN the folder, just select it and click “Include folder”
  11. Remove the Default Personal Folder
  12. Click OK
  13. Click “Set save Location”
  14. Select the newly created folder
  15. Done
  16. Repeat for each library as needed (Music, Pictures, Videos, etc)

Enable Indexing on VHD – Required

  1. Open Windows Search (win+s) keys or “Charms Menu” or Cortana
  2. Type “Indexing Options” and Open
  3. Click “Modify”
  4. Select the new VHD you created
  5. Click OK
  6. Click Close

The AutoMount Script

  1. Open windows Powershell as an Administrator (right click and run as administrator)
  2. Type Set-ExecutionPolicy RemoteSigned
  3. Press Enter
  4. Type Y
  5. Press Enter
  6. Close
  7. Open File Explorer
  8. Open the C: drive
  9. Create a folder named something like “VHD_MOUNT” or “MOUNT_SCRIPT” or anything that helps you identify that the script will be saved here
  10. Open the folder
  11. In the ribbon bar go to the view tab and check “File name extensions”
  12. Right click the white space New->Text Document
  13. Name it Auto-Mount.ps1
  14. Accept the file name extension change
  15. Paste the following, remember to Change D to the drive letter of your micro/sd card/usb and use the full path to your VHD file
    1. "Mount-DiskImage D:\YourVHD.vhd"
  16. Save and close
  17. Open Windows Search (win+s) keys or “Charms Menu” or Cortana
  18. Type “Task Scheduler” and open it
  19. In the left pane select “Task Scheduler Library”
  20. In the Action menu select Create Task
    1. General Tab
      1. Name: Attach VHD
      2. Location: \
      3. Description: AutoMount script for the Micro/SD card/ USB VHD
      4. “Click change user or Group” Type in System in the bottom box and hit check names
      5. Check “Run with highest privileges”
    2. Triggers Tab
      1. Click New
      2. Begin the task “At Startup”
      3. Click OK
    3. Action Tab
      1. Action: Start a program
      2. Program/script:
        1. C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
      3. Add Arguments:
        1. "C:\<your folder>\Auto-Mount.ps1"
      4. Click OK
    4. Conditions Tab
      1. Under Power uncheck “start the task only if the computer is on AC Power”
      2. Click OK

Test

Restart your computer and see if the drive auto mounts. If you set up the libraries, take a few pictures and see if they are indexed properly by showing up in the gallery. Add some music and see if it shows up in the music app, etc etc. If you have dropbox already installed you can goto Dropbox preferences -> Account and hit the move button and select the new VHD. Dropbox will do the rest.

Tags:, , , , , ,