• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root HOWTO: Partition Your SDCard for A2SD

savoxis

Android Expert
Aug 10, 2010
812
708
38
Pacific NW
www.savoxis.com http
UPDATED 10/8

Velocity III is here!

Now lets get that A2SD working

So with the release of Velocity 0.3 (thanks Trident) I would imagine allot inquiry as to how to properly use the APPS2SD feature. Lets start with a little explanation:

The A2SD in Velocity is setup as a semi-intelligent script that runs at boot, it will check to make sure that your SDCARD has a second partition available (/dev/block/mmcblk0p2) that is formatted as an EXT file system, then it will move all of your application files from /data/app to your SDCARDs second partition, which is located at /system/sd, the script will then create a shortcut (symlink) from /data/app -> /system/sd so all newly installed applications will be placed on the SDCARD.

The easiest way to accomplish this is through the ROM Manager application available in the Marketplace:

1. Plug your phone into a PC and copy all data you want to save off of your SDCARD onto a temporary folder on your PC, When you are done backing up either unmount your sdcard, or unplug the phone from the PC

2. Open ROM Manager and be sure that you have the latest ClockworkMod Recovery installed. It will be apparent in the top RECOVERY section of the program

3. Scroll down to the UTILITIES section and select Partition SD Card, this will give you a menu allowing you to select the size in which you want your EXT partition on the SDCARD to be, Personally I would recommend using at least 128mb although there is no downside (other than losing an equal amount of space on your 1st partition) in making it as large as allows.

4. The ROM Manager will then ask if you would like to create another partition to use as SWAP, I would NOT recommend creating one (select 0mb) unless you have a Class 6 SDCARD. The constant writing to SWAP can cause problems with class 4 cards. If you still have the card that came with your Ally. Its Class 4

5. The ROM Manger will now reboot into Recovery to partition your Card, it will take a few moments for it to complete and afterwards you can reboot. You will notice that you have nothing on your SDCARD, you can now plug the phone back into the PC and copy all the data that you backed up in Step 1 to the sdcard.


Partitioning Your SDCard With the AmonRA (Drellisdee's) Recovery

1. Plug your phone into a PC and copy all data you want to save off of your SDCARD onto a temporary folder on your PC, When you are done backing up either unmount your sdcard, or unplug the phone from the PC

2. Boot up into recovery by holding down the SEND MENU and END buttons.

3. Select "Partition SDCard" Then Partition SDCard Again

4. I will ask for the size of the SWAP Partition, 32MB is default, 0 is no swap. If you plan on using a program like swapper to enable swap2sd then use 32MB, if you have a slower (class 4 or 2) SDCard, you will probably want to select 0 here. Use the "trackball" (arrow keys around OK button)

5. It will ask for EXT Size. I would recommend allowing for 128MB or more. I personally use 512 because I have a large SDCard.

6. It should now partition your card (if someone can PM me a verification that would be great, this is as far as I went since I don't want to RE-Partition my card lol)

7. Reboot into recovery again, and go to partition SD Card, you can now select ext2-3 then 3-4 for faster file system.

8. If you have Velocity 3 flashed already it will automatically enable A2SD on your first boot. Otherwise you will need to flash Velocity 3, or use Killertonez update.zip to install darktremmors a2sd

Please Note I write this section up mostly on memory and whatnot, so if you see any discrepancies, PLEASE contact me so I can correct this.


FAQ

So I partitioned my card without errors and rebooted Velocity 0.3 how can I tell A2SD is working?
You can test a2sd by opening a terminal emulator and doing the following
Code:
su
ls /system/sd
ls -l /data
df
If it is installed correctly you will see all your apps located in /system/sd and you will see a symlink from /data/app => /system/sd and df will show disk usage by partition.

My system takes longer to boot why?
The downside to having a2sd enabled is the system will have to check the filesystem for errors and mount the sdcard before it boots, this will add a few seconds to your boot time and your first boot may take a few minutes if you have allot of apps

All my apps in /system/app are still there
The script does not copy your system apks to the sdcard, it is not a good idea because then you would not be able to remove the sdcard without the system crashing

When I install a app from the marketplace my internal phone memory still goes down a little bit.
This is due to the dalvik cache for these apks still being stored in internal storage, at this time it may cause damage to lower quality (class 4) cards to store these files on sd.

Addition:
ClockworkMod has a problem mounting the partition it created :). When wiping data you will see an error like this:
Code:
mount: mounting /dev/block/mmcblk0p2 on /sd-ext failed: Invalid argument
E:Can't mount /dev/block/mmcblk0p2
(File exists)
This means that it DID NOT wipe the 2nd partition on your SDCARD, if you just made the partition, ignore this message because it is blank anyway. But if you are reflashing you WILL need to wipe this information. For the time being you can wipe it through adb or a terminal emulator on your phone, there are better ways but this is quick and easy:
open a adb shell to your phone or a terminal emulator if you can and:
1. su
2. umount /dev/block/mmcblk0p1
3. mount /dev/block/mmcblk0p2 /sdcard
4. ls /sdcard
VERIFY THAT THIS IS YOUR /system/sd/ DIRECTORY IT SHOULD JUST CONTAIN APK FILES
5. rm -R /sdcard/*
6. umount /dev/block/mmcblk0p2

Or you can flash to Drellisdee's Recovery until Koush releases an update to ClockworkMod


Written but not proof read -Savox
 
Because this symlinks /data/app to the partition on your sdcard, anything that installs to /data/app (which is anything you get from the market, for instance) will be on the sdcard. The only way to force things onto internal storage is to install them to /system/app. I'm pretty sure the dialer and live wallpaper apps will be there by default. You'll have to move handcent to /system/app manually, either from the command line or with something like Root Explorer.

If you decide to move apps to /system/app, remember that you must first remount the /system partition read-write. You will also have to update them manually - updates will automatically install to /data/app.
 
  • Like
Reactions: savoxis
Upvote 0
Great guide, thanks! I followed instructions and thought all went well, but something isn't right. I'm using ROM Manager and paritioned the SD card as instructed. When the phone rebooted, the Velocity (I just flashed v0.3 today) logo came up is now blinking every 5 seconds or so. Phone isn't booting completely.

Not sure what happened exactly, but am wondering what a next step would be.

EDIT: Didn't work right, but I'm doing a recovery now and will try again! Sorry about the post.
 
Upvote 0
i bought an 8Gb Sd card not thinking about the class. So i think i messed up an now i have a class 4 sd card. can/should i partition my sd card for apps2sd? will i still be able to flash velocity .3 with out the partition?


The class dictates the speed. Using a class 4 card for a2sd isnt horrible it will just run slower than a class 6 card. Having a fast card is not so much important for a2sd as it is for swap2sd
 
  • Like
Reactions: Oblivious72
Upvote 0
ok thanks, i will try it and see what happens

EDIT: so what does apps2sd do? in a nut shell. does it free up space on my internal storage? is that all?


Well yes, it frees up internal storage space which is very important on the Ally since it uses mtdblock5 (/data/) as RAM/Swap space, so the more apps you have installed in internal memory the slower the phone will run. Putting them on a partition on your SDCard lets you install a whole lot of apps (way more than allowed on the internal storage) without slowing down the phone as much
 
Upvote 0
Not sure what I am doing wrong. Every time I install a2sd_ally_OC.zip (running Velocity 0.2 and GNM_Turbo4), I end up with the Droid loop. And yes, I cleared the cache and the Dalvik-cache.

Any suggestions? Thanks!

Since you are on velocity 0.2 you have to flash a2sd_ally_velocity.2.zip first then a2sd_ally_OC.zip.
 
  • Like
Reactions: netizenmt
Upvote 0
It worked through ROM Manager for me or at least I think it did. Before partitioning, I had 92mb of internal space. After partitioning apps2sd, I had 112mb of internal space. I assumed that meant it had worked.

When you say it doesn't work, what exactly do you mean? Does it go through the process, like rebooting into recovery, but when it finishes it hasn't done anything? Or do you get some error message in ROM Manager when you try to partition it?
 
Upvote 0
i did what you said to do in order to partition, but when i go to terminal emulator and type
su
ls /system/sd
i get
/system/sd: no such file or directory

??????


Mine says the same thing, but it did work. I tested it by downloading a 6mb app from the market and it installed and worked fine and I lost no internal storage space in the process.

On a similar note, how do you see how much space you have left on the sdcard for apps with a2sd since it's not listed in the stock storage space menu?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones