| || |
Everything SD Cards - Discussion and How to
For those of you that just wanna get right to it, scroll to the bottom of the post for instructions:
Due to the large number of users who are now learning about the benefits of having an sd-ext formatted on your sd card, and the large number of users who are not sure how to create it, I decided to create a thread to go into some further detail about the process and exactly how it will work for you. Currently, the partition process is written up based off of the CWM Recovery, but despite which recovery you are using, you should still be able to follow along enough to get the job done. The basics are still the same.
There are several different types of sd-ext, ext2, ext3, ext4. The main difference between the three classes are the data transfer speeds. The faster the speed, the more strain it puts on the card, which ultimately will shorten the lifespan of the card. Some experience it and notice right away and others don't, but generally for a day to day user, it is very minimal and not really noticeable. If you take care of your card, it'll generally last you a year or more. This of course is not referring to cards that are defective or have become corrupted through misuse, etc.
Now why would you want an sd-ext? With the app2sd scripts enabled in today's custom roms, they basically trick the phone into thinking that the ext is part of the internal memory of your phone. Now I will say that again, the phone thinks that the sd-ext is part of the internal memory. This does not apply to the FAT32 (Regular) sd storage. That portion will still remain as normal external storage.
Obviously the biggest reason for creating the partition is to free space from your internal memory. Once the partition is created, apps (not app data), the dalvik-cache, and the cache for any movable app will be transferred to the sd-ext. Because the phone now thinks that this is part of the internal memory, you can continue to use apps and widgets as normal, unlike storing them on the external storage whereas now apps run when they want to or sometimes don't run at all, force close constantly, widgets disappear, etc. Also, ever noticed that while you are using mass storage mode to transfer files from your phone to your computer, none of the apps that are stored on the sd card work? Think about the sd card just like a disk in a computer. When it is mounted to the phone, the phone is able to read it just like a disk in a computer disk drive. When you remove the disk (sd card), or unmount it (usb storage) its now invisible to the phone. Creating this partition essentially splits the sd card into two separate cards. You have the sd card being used as external storage..which is what the computer sees during usb storage, and then the sdext which is now basically internal memory. So now you are still able to use all your apps stored on the sd ext. Again, remember in the beginning when I said that the phone now thinks your sd-ext is actually internal memory. So even though you have your sd card unmounted, the sd-ext will remain.
Now keep in mind, ALL apps will not move automatically. The script for the rom app2sd is designed to move apps to the sd card yes. However, keep in mind that your sd-ext is now internal memory. If you notice in your app drawer, an app like Google maps will show you a move to sd card box, but the box will be greyed out, and you will be unable to move it. Why? Certain apps require permissions to run that require them to remain in internal memory to run. So they cannot be moved to the sd. Some of you may have noticed that using third party apps like app2sd will move some of the files, but still not all, to the external storage, but then the app wont work, the widget dissapears, etc. This is why.
So now we have more internal storage, but still have apps we can't move. Oh well right? Wrong. There is a nifty little loophole to this mess. Titanium Backup! If you don't know what it is get it! If you have the free version, get the paid app! It is worth every penny. Now how is Titanium Backup different from any other 2sd app? The script in this app allows it to see your sd-ext, which means it is able to move your "unmovable" app to the sd-ext. Now when you use the internal app2sd that came with the Rom of your choice, you will notice that you have two options. The first is move to phone. The second is move to sd. When you move an app 2 the sd, you are moving it to the regular FAT32 partition. This is a good idea for apps that you just want to store for later and aren't really gonna use; however, if you want them to go to your sd-ext, where you will get the full function of the apps and widgets as I explained earlier, you will want them on your sd-ext. OKay so keeping in mind that we said your phone thinks that your sd-ext is actually your internal memory, rather than move your app 2 sd, you actually wanna select the move to phone option. This will put your app on the sd-ext, and will place the data on the actual internal memory of the phone. Now keep in mind that I said the ext is internal memory in the phone's eyes, so moving the apps means they will still work, your widgets will still function, and you will have your 180mb (or whatever amount is on your specific phone) free. This of course is minus the app data, and the cache for any app remaining on the phone.
Now hold on, I said dalvik and cache moved to the ext also right? This is true, but only the cache files for the apps moved to the ext, as many apps have dedicated cache files of their own. So you move all the apps, and the cache mess will move as well. Now you have seen this happen and probably don't even realize it. Let's say you have 5 apps on your phone. The total for the apps is 50mb. So if you have 150mb if internal storage you should have 100mb. So you look at your internal storage and it says you only have 80mb free. So where did the extra 20mb disappear to? App cache and data files. Is this right? How do I know? Look at how much internal storage you have. Go into recovery, wipe your cache. Now come back and look... the number just went up. Now instead of only 80mb free, you have 90mb free. You wipe app data, now you have 105 free. Keep in mind that this is also where contacts, text messages, etc. are stored, so taking all these things into account, the amount of storage used will change almost constantly.
So now that we have that out of the way, lets jump into how to create your sd-ext. Now keep in mind this is only going to be for your apps. Data and cache are separate extensions. Clockworkmod will only allow to create one sdext, so because of this you will have to add the additional ones on your computer. If you have the space available on the regular FAT32 portion of the sd card, you will be able to add these later without losing data or having to repeat this process. Even then a backup will still be advised as it is always possible doing anything like this to your card could wipe it clean. Lets get the basics down, and then we will move onto those at a later time.
Okay the first question is which sd-ext should I use? That is a good question because as I said there are three different types. Currently, default for Clockworkmod is an ext3. I always suggest that you create your ext using your phone, but you can do it with your computer as well. I recommend the EaseUS partition manager.
Lets go! Before you begin, see how much app storage you are using on your phone. Write it down, remember it, whatever you gotta do. We'll need that in a minute.
Step 1: [HL]Backup your SD card (the entire card)[/HL] to your computer. One more time, [HL]BACKUP YOUR ENTIRE CARD![/HL] I also suggest that after you [HL]BACKUP YOUR ENTIRE CARD[/HL] you go ahead and erase your card here.. just speeds it up in the phone a bit. Not a necessary step though. The phone will take care of it. You can either do this with the card in your computer, or mount usb storage in recovery and complete the entire process from recovery.
[HL]WARNING!! DOING THIS IS GOING TO FORMAT YOUR CARD! IT IS GOING TO ERASE EVERYTHING OFF YOUR CARD! BACKUP YOUR SD CARD![/HL]
Step 2: From CWM Recovery, go into the mounts and storage option. If you have usb mounted, unmount that and then select mount sdcard. If you were using your computer, go to mounts and storage in recovery with the card back in the phone and select mount sd card. Now go into the advanced menu. There you will see Partition SD Card. Select that option.
Step 3: Now you see a menu that says Ext Size. Generally, it is suggested that you want your partition to be at least 10% of your total card storage. Most people use a higher percentage with a bigger card. So as a guide, 1024mb (1 GB) is a good size for 16gb cards and higher. If you don't use a lot of apps, obviously go smaller. If you want a minimal ext, take that number I told you to get for your current app storage, and move up to the next larger size. So if you are currently on using 50mb, select 128mb in CWM. 127mb, move up to 256mb and so on. Select whatever number you decide on.
Step 4: Now we are at the swap size menu. Some say you don't need it, some say you do. That'll be something to get into when we discuss the data and cache ext's later. If you do it later, you have to go through this entire process later, so better to just do it now. I suggest that you go ahead and use one. Just select the 128m option. Don't bother with 256, you will never come close to that. 128mb is plenty! As an edit to this step, rather than partition swap on your sd card, you can also download an android app called swapper2 that will create a virtual swap partition. This allows you easily add and remove swap without the need of reformatting the card to add and remove. This is also a good app to use even if you do decide to format a partition.
Step 5: So you selected your swap size, the phone did its thing. The CWM command line reads done.
Step 6: Select wipe dalvik cache. Yes we erased the card in the beginning already, but now we need to erase the files on the phone as well. This is a necessary step. If you skip this, the mount will not stick, and the phone won't recognize the sd-ext. Scroll down to yes and select it.
Step 7: Hit the back button on the phone to return to the main CWM menu.
Step 8: Under the advanced settings select power off phone. Now remove the card and return it to your computer. If you don't have this option or cant get it to work, see step 9, otherwise skip to step 10.
Step 9: From the main CWM menu select mounts and storage. If you see an option that says unmount sd, select that. When you see it change to mount sd, pull your card out and return it to your computer.
Step 10: From here you can return your files to your SD. If you were using a new card, or simply wanna start with your card "clean", be sure to grab your rom, gapps, etc. If you have a clockworkmod folder in your backup, grab that to. When you did your backup during root, that's where it went so you're gonna want that. Now one thing I wanna point out here is those of you who are going to try to test it on your computer. Your computer will not "see" your ext. So you are just putting the files on what you can access. This is how it works...the phone will move everything on its own once you boot it back up with the card in it. The files that you are storing on it will appear to be on your regular sd card. If you want to actually see that your ext is there using your computer, you will need a partition program such as EaseUS to do that.
Step 11: Power on the phone. This initial boot will take several minutes. Let it do its thing. This is where all the files are being moved to the ext, and the phone is building the dalvik. Once the phone is back on, you are done.
[How To] Upgrade SD card with all linked apps in tact
With permission from Magnus7901 (post #9), I am posting out his link on how to do this here as an added resource to the thread. This one is all him. Im sure he'll be peeking in again, or see the link he dropped below to thank him. I am simply passing it along to all of you.
I couldn't find this posted anywhere on here, so if it's a duplicate, my apologies. I just upgraded to a 32 gb sd card, and have a great number of linked apps and found this method works for upgrading the card without losing any data or linked apps.
1. Backup all items off the FAT partition using usb storage mode.
2. Reboot into recovery and create a nandroid backup.
3. Staying in recovery, mount usb storage from the mounts and storage menu, and copy the newly created nandroid backup into your temporary directory with the old sd backups.
4. Unmount usb storage, and remove your old sd card, then insert the new sd card, and partition it using recovery, or if you have already partitioned it, simply skip this step. Note, if you do choose to partition it outside of recovery, make sure you use the same ext type.
5. Once your new card is partitioned, go back to mounts and storage, and re-mount usb storage.
6. Copy all files back to the new sd card.
7. Select backup and restore->advanced restore->(your new nandroid)->sd-ext. If you don't have the option, or choose not to use advanced restore, you can simply restore the entire backup.
8. Reboot the phone, and enjoy your seamlessly upgraded sd card.
Hope this helps someone out.
[Edit: changed to numbered list]