Sunday, December 5, 2010

How to mount the SDCard in Recovery Mode

More than often if you like messing around with your phone, chances are you want to take backups and have them transferred to your PC.

Or maybe, you've screwed up your phone, so you want to transfer your Nandroid backup image to the SDcard since you don't automatically have it on there.

In that case, have no fear. It is very possible to have your phone's memory card show up in Windows as external storage so you can move files to and fro as much as possible.

There are multiple uses that this could have. Personally, I looked around for this and found the answer on XDA because my phone would reboot if put into Mass Storage Mode.

Now, the trick is, to use the adb shell to get into the phone, and then mount the sdcard as mass storage.

The commands are..

echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file

..for mounting the sdcard. This will allow you to see the sdcard in Windows exploder. To unmount the card after safe removal ( cuz I've had quite a few bad experiences :S ), the command is..

echo "" > /sys/devices/platform/usb_mass_storage/lun0/file

So since I could mount and unmount the sdcard as I wanted, I figured it would just be easier to run batch files without touching the phone as opposed to selecting mass storage mode.

So now to create batch files, the commands are just a wee bit edited.

For mounting, the command to be put in the batch file is

adb shell "echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file"

And for unmounting, the batch file command is..

adb shell echo ^"" > /sys/devices/platform/usb_mass_storage/lun0/file

Now I'm sure anyone who's tech savvy enough to read this blog will know how to create batch files, but for those who don't know what batch files are, theyre text files that execute commands and their file extension is .bat

Good luck.

No comments:

Post a Comment