Some Back-Story: How I Got my Unrecognized Samsung Galaxy S3 to Connect to Windows 7 As a Portable DeviceThe other day, after changing configurations on neither my phone nor my laptop, my phone stopped being recognized by my laptop's windows 7 environment. Naturally, I went through this checklist:
- Try a different USB port -- Still broken.
- Restart the phone -- No luck.
- Restart the computer -- Nada.
- Reinstall the phone's USB drivers -- Zilch.
- Fully uninstall, then reinstall all USB bus and device drivers -- Painful, and still ineffective.
Somehow that fixed it. But why was my phone unrecognized in the first place?
Why Would I Want or Need To Map A Drive Letter To My Android Phone's Filesystem?Before my phone stopped being recognized, it gave me a few messages warning about low-disk capacity. My usual approach to disks being full is running the amazingly useful open-source disk-space visualization tool WinDirStat.
|WinDirStat gives you a visual representation of the space on your drive|
There's a hitch though: WinDirStat can only map drives with a drive letter, and all reasonably new Android devices mount as a 'Portable Devices', not as storage volumes:
|Note how the phone is listed as a 'Portable Device' instead of a regular drive|
For technical (and well thought out) reasons, modern Android devices connect to the computer by either Picture Transfer Protocol (PTP, a protocol also employed by many digital cameras) or Media Transfer Protocol (MTP, an extension of PTP to accommodate arbitrary media), when connected via USB. A limitation of this protocol is that directories do not contain meta-information about their content, so folders do not show a Size in Windows. WinDirStat is needed, because it will probe the directories for you and graphically show their content.
|Windows Explorer fails to show any folder size information.|
- Find a way to map my phone's filesystem to a disk letter.
- Use WinDirStat to analyze my disk usage.
How NOT to Map Your Phone's Filesystem to a Drive Letter (An Introduction to WinObj.exe, SUBST, SUBST4NT.exe and Hardware ID's in Windows)On the advice of WinDirStat's package maintainer, I got it in my head that if I could just find the handle being used by Windows to address the hardware address of my phone, then I could manually map that handle to a disk letter using NTSUBST.exe.
A Brief History Lesson on SUBST, NTSUBST.exe and SUBST4NT.exeThere is an oft-forgotten CMD utility in Windows called SUBST. It is used to map arbitrary disk locations to drive letters. For instance:
SUBST X: \Windows\System32\drivers\etcCreates a new drive letter, X, which points to the host file folder. To remove the mapping, use:
SUBST X: /DThis is very useful, but has some limitations, so a more robust utility was created, NTSUBST.exe. NTSUBST allowed users to map virtually any directory, device or network location to a drive letter, but has in recent years been wiped from the internet.
After many hours of looking for a working version of NTSUBST.exe, I emailed WinDirStat's package maintainer in desperation: since he had suggested NTSUBST.exe, maybe he would be able to provide a copy if I asked nicely... He did one better! He introduced me to SUBST4NT.exe, a tool which accomplishes the same feat. as NTSUBST, but with the benefit of existing on the interent at all. I was stoked.
Until I tried it out and it didn't work. Then I was choked.
How You Really Can (But Probably Shouldn't) Give a PTP Device a Drive LetterIt turns out that you REALLY can't treat an MTP device as a regular drive... but there is some impressive work toward making a read-only PTP drive letter encapsulation tool worth mentioning: http://www.ptpdrive.com/. They only provide trial software, and it seemed to lag infinitely while trying to deal with my MTP cellphone, but this software really does do what it says on the tin.
The Best Way To Map Your Android To A Drive LetterThere's more than one way to skin a cat... since my goal is simply to have my phone as a drive letter, I don't necessarily need to do that via USB. By mapping a network drive to your phone, you can access all of your files, and as a bonus, you don't need to be plugged into the computer! You have a couple options in servers for your phone:
- Samba File Servers -- This type of server will let you connect to your windows home-group network. It will work very well if you have a network set up already, and may be a perfect solution.
- WebDAV File Servers -- This is Samba's cousin, minus the home-group network. It simply serves your files on a network address (the ip of your phone, on some configurable port).
Once you have a server set up on your phone, setting up a network drive pointing to it is easy:
|Open "Computer" in Windows Explorer and press "Map network drive"|
|If everything worked, then you'll now have your phone mapped to a drive letter!|