View Single Post
Old 06-07-2011, 09:54 PM   #1
kennyminot
Groupie
kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.kennyminot composes epic poetry in binary.
 
kennyminot's Avatar
 
Posts: 183
Karma: 90022
Join Date: May 2011
Location: Louisville, KY
Device: HTC EVO View 4G, HTC Wildfire S, Asus T91MT
[How To] Move Apps to your SDcard in Ermine

Before you read any further, the following post is a workaround to a known Ermine problem. While Dingo users might be interested in some of this information, I sincerely doubt that most of them will actually want to go through this process.

Let me start with a little background. Ermine is a very polished Android build, but it has a number of well-known issues. One of the most problematic is the inability to move apps to the sdcard. To make matters even more complicated, the Pocket eDGe designers rather unfortunately decided to separate the internal memory into two chunks. The first is called "application storage" in the device storage menu. The second is called "internal storage," and it is located in the /sdcard directory on the device. Unfortunately, the eDGe seems to treat this "internal storage" almost like an sdcard, so it's impossible to even copy applications onto this additional space. That leaves you with about relatively small 350mb to install programs. While this might be plenty for some people, I've already started to get dangerously close to that limit. As such, I wanted to see if I could find out a solution to the problem.

From what I've read, Android uses a program called "Apps2SD" to move programs to the sdcard. Here's how I understand the process works: when Android is instructed to move an application, it starts by encrypting the necessary files. Then, it moves over the copy-protected data. That way, people can't just unplug the sdcard, move it over to a friend's phone, and illegally install the copyrighted software. After doing a little research, I'm almost positive that the reason Apps2SD doesn't work in Ermine is because of this encryption process. If you look at the logcat, you get the following errors when you try to move over files:

E/Vold ( 1219): Error opening devmapper (No such file or directory)
E/Vold ( 1219): ASEC device mapping failed (No such file or directory)

On the threads I was reading from more knowledgeable folk, they said fixing the problem would required modifying the kernel. I'm completely clueless about how to do this, although I think a more skilled Android user could figure it out.

After doing some poking around, I discovered another method for moving over applications to the sdcard. Once it is up and running, it is relatively painless to use. However, the procedure for getting it to work is pretty complicated. Hopefully, someone will figure out a way to streamline this process. If anybody has any pointers for making it easier, just let me know, and I'll update the instructions.

To put it in a nutshell, instead of using the built-in Apps2SD software, you are going to use a freely available application called Link2SD. You can download it through the Android Market or through the app's xda page. For the most part, the program is simple, but there is a catch: you need to partition your sdcard into two sections. Essentially, you are "tricking" your eDGe into thinking your sdcard is actually two entirely different storage devices. By the time you are finished with this process, you will have significantly reconfigured your device's storage. Right now, the eDGe maps the drives onto the following locations:

/sdcard = internal storage
/extsdcard = sdcard

By the time you are finished, you'll have it mapped the following way:

/sdcard = first sdcard partition (for data, documents, movies, and music)
/extsdcard = internal storage
/data/sdext2 = second sdcard partition (for applications)

Finally, before you get started, just keep in mind that whenever you screw around with the system files, you risk messing up your eDGe, so make sure you are prepared for that possibility. You definitely want to backup everything on your sdcard. In addition, you probably want to backup any important applications with Titanium Backup, and you might want to consider saving a copy of any important documents. In addition, remember to download a copy of the golden update and Ermine update, which you'll need in order to get your tablet up and running in case you completely mess it up. There is a low chance of that happening with this procedure, but you never know. Better safe than sorry.

One last thing: this process requires your device to be rooted, which is super easy to do with z4root on the Amazon Marketplace. You also need a file management tool like Root Explorer. In my instructions, I'll be referring to that program, but you can use any similar application with text editing capabilities.

Step 1: Download Link2SD and install it on your system.

Step 2: Partition your SDcard into two partitions. You can do this in numerous ways. You Linux wizards might be able to do it manually. Alternatively, you could use a piece of partitioning software, such as MiniTool Partition Wizard. Personally, I used ClockworkMod Recovery on my Optimus V, which is relatively easy to use. Regardless of the way you do it, you need two partitions: one that is FAT32 (which will be used to store your data and documents) and one that is EXT3 (which will be used to store your applications). I have an 8GB card, and I allocated 6GB to my FAT32 partition and 2GB to my EXT3 partition. If you want more room for your applications, you can potentially make the EXT3 partition an even larger chunk.

***If you have trouble with the next two steps, I've uploaded the three files you need to modify to a subsequent post on this thread. You can simply download them and copy them to your device. This seems to have greatly simplified the process for a number of people. Make sure to read through the experiences of the other folk on this thread for more advice if you get stuck.***

Step 3: Map your sdcard onto the /sdcard directory. In order to accomplish this feat, you need to edit two Android system files. Go into Root Explorer and navigate to the /system/etc directory. Scroll to the bottom, and you'll find two files: void.fstab.external and void.fstab.internal. Hit "mount r/w" at the top of the screen and open both in your text editor. Basically, you want to replace any mentions of "extsdcard" with "sdcard" and any mentions of "sdcard" with "extsdcard." So, for example, take the following line in void.fstab.internal:

dev_mount sdcard /mnt/sdcard auto /block/mmcblk0

You want to change it to this:

dev_mount extsdcard /mnt/extsdcard auto /block/mmcblk0

Make sure you've inserted your partitioned sdcard. Then, after you have made these changes, reboot your eDGe. Now, your internal storage will be mapped to the /extsdcard directory, and your sdcard will be mapped to the /sdcard directory.

Step 4: Setup Link2SD. Click on the program. It should automatically detect your second partition. Then, it should ask whether you want to use an ext2, ext3, ext4, or fat32 . You want to select the "ext3" option (unless, of course, you formatted your second partition as one of the other options). Once it has finished setting everything up, it will ask you to reboot. Go ahead. After your computer restarts, make sure you can move an application over to your sdcard with the Link2SD program. (Note: my instructions are a little sketchy for this step because I have to recall everything from memory).

Step 5: Modify the Link2SD script to manually mount your sdcard's first partition. Now, you should be able to move applications to your sdcard, but there is a new issue: unfortunately, the program causes Android not to recognize the first partition on your sdcard. That leaves you unable to access a significant amount of storage space. Fortunately, there is a way to resolve this problem. Link2SD creates a script called "install-recovery.sh" that runs when you boot and manually mounts the second partition on your sdcard. You can also use this to manually mount the first partition. Go back into the system/etc folder on Root Explorer. You should find the "install-recovery.sh" file. Right now, it just has two lines. You need to add two more:

mount -t vfat -o rw /dev/block/vold/179:1 /sdcard
mount -t vfat -o rw /dev/block/mmcblk0p1 /sdcard

Reboot your eDGe. Your system should now have mapped the first partition of your sdcard to the /sdcard directory.

The process has only major limitation: if you ever need to remove your sdcard, you will need to reboot before the system properly recognizes it. Otherwise, Link2SD is actually a versatile piece of software, which will allow you to move basically any app to your sdcard.

For more information about Android's built-in Apps2SD program, check out the following thread. I wouldn't have been able to figure this out without GodfatherIP's helpful information. Finally, if you have any suggestions about how to streamline this process, just let me know.

Good luck! If you're brave enough to give this a shot, tell me how it works!

Last edited by kennyminot; 07-26-2011 at 10:12 AM.
kennyminot is offline   Reply With Quote