1. Download our Official Android App: Forums for Android!

Root Question about a2sd zipalign

Discussion in 'Android Devices' started by Roymus, Apr 6, 2011.

  1. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    I checked similar threads but I couldn't get a definite answer to this. I have the DarkTremor app running on my Evo (I believe it comes with the Azrael ROM 4.0 and other recent ROMs). So, following the directions on another post, I've run the following commands using Terminal Emulator to invoke zipalign:

    open terminal, type "su"
    press accept
    type "a2sd zipalign"

    My questions are: 1) Does this command invoke zipalign even after a phone reboot or battery pull, or do these commands need to be re-run after a restart? 2) Should I still be running the apps2sd app after installing new applications to check to see if they can be moved to my sd card, or will a2sd do this automatically somehow? 3) How can I observe or measure the benefits (if any) of zipalign?

    Thanks...
     

    Advertisement

  2. youdoofus

    youdoofus Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    2,131
    Joined:
    Feb 26, 2011

    Feb 26, 2011
    2,131
    747
    213
    Tech support rep for Knology
    so dak
    I only know the answer to part 1, you hafta do it with each reboot... part 2 kinda falls into that same category, but i dont know if zipallign is a constantly running app, or if it only does what its told to do then basically sits dormant, im thinking the latter... and part 3? i havent the foggiest idear lol
     
  3. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    1) From the darktremor a2sd documentation:

    So, if you run a2sd zipalign, it will zipalign at each boot, and you never have to worry about it. If you run a2sd align, then it only does it once.

    2) apps2sd (using the built-in method) and dt a2sd are two completely different things, and should not be used together (though they *can*). When you use a2sd, the app locations are moved to the sdcard, and a symlink (shortcut) is created from where the system looks for apps to where the apps are on the card. When you install an app, it goes to the card, period. If you move the app to the card via apps2sd at that point, the system won't know anything is different, but you'll basically have part of the app on the ext partition, and part of it on the fat32 partition. That's pointless, and a poor use of space. The only reason you should keep an apps2sd app around is to make sure apps *don't* end up being moved to the sdcard automatically, as a2sd takes care of it the way it should.

    3) There really isn't a good way. Does it seem faster? In theory, your apps should load faster and use less memory.
     
  4. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Thanks...that helps clear a few things up. So are you saying that a2sd zipalign will automatically move the apps to the card, and the only reason to keep apps2sd is to move apps BACK to the card that require it (for example, apps with widgets that must run on the phone)? I noticed that my IPCam Viewer widget isn't working since I ran zipalign (it must be located on the phone)...could this be the reason? Also, to address my third question in the OP, would Titanium Backup's home screen show more memory free as a result of zipalign? Right now, I show 117MB free internal and 115MB free for SD card (a2sd)...not sure whether these are good numbers or not (I have a class 4 32GB sd card). Thanks again...I know these are a lot of questions, but hopefully this will help others as well...
     
  5. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Zipalign has nothing to do with moving apps to the sdcard. It is a separate function of a2sd, and is meant solely for making apps a little more efficient. If you want your apps to run on the sdcard via the a2sd method, you need to run a2sd reinstall, but only if they aren't already there. Run a2sd check, and it will tell you the current state. If you're unsure of the results from that, run:

    a2sd check > /sdcard/a2sd_check.out

    then copy the file /sdcard/a2sd_check.out to your computer, and attach it here, and I can help you read the results.

    As for apps2sd, you just don't want to use the froyo apps2sd method at the same time as a2sd. A2sd is a complete solution for moving *all* apps to an ext partition on the sdcard. It is automatic, and there is not option of running any apps on internal storage while it is running unless you push them to /system/app. Using apps2sd at the same time is possible, but pointless, and uses up space on the rest of the card.

    As for memory, what I meant was apps should technically use less RAM while running. It has nothing to do with internal storage.

    Does that help clear anything up at all? I know it can be a little bit confusing at first :).
     
  6. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    I think I get it, except for the part about using the froyo apps2sd method at the same time as a2sd. I run apps2sd periodically to move apps to the sd card that can be moved. I think it's important (and necessary) to move all apps that can be moved to sd to free up available memory, simply because the Evo tends to run a lot better if it has lots of free memory (less lockups, spontaneous reboots, etc.). Using apps2sd to move apps to the sd card seems to be a lot easier than the a2sd method you mentioned, so I'll probably continue to use it even if it's not as efficient...I have 32GB after all :)
     
  7. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    There's nothing wrong with using apps2sd as long as you're not using a2sd to move all apps to the sdcard at the same time. I'll tell you what, run that command to create the a2sd_check.out file, as posted above, and I can tell you what your current setup is.
     
  8. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Thanks, akaz...not sure how to attach files but I went ahead and included the text below. I took a look, it looks like I have an external partition created but not mounted...not sure how to mount or even if that's a bad thing...thanks again!

    [ ] Apps2SD is launching...
    __ _____
    | \ |
    | | |
    |__/ | Darktremor Apps2SD 2.7.5.2 (2010-09-30)
    [ ] GetProp Command = /system/bin/toolbox getprop
    [ ] SetProp Command = /system/bin/toolbox setprop
    [ ] Mount Point = /system/sd
    [ ] Creating /cache/dc
    [ ] Symlinking /cache/dalvik-cache to /data/dalvik-cache
    [ ] Starting Apps2SD Check Program.
    [ ] Checking for ext partition
    [X] Ext partition found, but not mounted.
    Your rom may not be setup to run Apps2SD.
    Check with your rom developer if the boot image
    is programmed to run Apps2SD.
    Your partition may be using an EXT4 partition,
    but your rom may not support EXT4. Repartition
    your SD card to use EXT2 or EXT3.
     
  9. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Okay, you don't even have your sdcard partitioned correctly at the moment, so you're obviously not running a2sd with apps on the sdcard. You can still use it for some things, but if you want to take full advantage of it, partition your sdcard. Until then, go ahead and use froyo apps2sd, if you like.
     
  10. evomattnc

    evomattnc Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    3,245
    Joined:
    Feb 10, 2011

    Feb 10, 2011
    3,245
    536
    213
    Mechanical Engineer for GE Nuclear
    NC
    Akaza, while i have you in here...i was reading about linux and i read somewhere, likely at android.source.com, that linux doesnt really give a shit what the available memory is, unlike windows it isnt "picky" that is to say whether it has 50 mb free or 500 it will run pretty much the same...? Do you know anything about this? Can you clear it up? Its mostly on topic :).
     
  11. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Akaza, thanks...I know I've shot my load on questions, but if you can point me to a link on how to correctly partition my sd card for a2sd that would be great...again, mucho thanks, I also appreciate the background info...I'm in IT and manage a group of engineers, so it's not falling on deaf ears :)
     
  12. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Well, yes and no. In Linux, it is extremely common to partition the filesystem (which is always done in the case of android as well). In the event that root (/) runs out of space, the system will crash. You simply need room for certain system processes to run. That's the way it is. But if you partition correctly, nothing will ever happen to the root of the filesystem. Directories that need more space usually are on other partitions, and are just mounted to the root filesystem. If they run out of space, you can just clear stuff up. What this means is that the system shouldn't crash. What it doesn't mean is that the system will work well. Processes could easily crash, and refuse to start back up. In the case of android, the system exists on the /system partition. No such thing really exists in a normal Linux environment, where system files are in / and the system directories under it (etc, for example). You can partition them out if you want. In any case, the only partition in Android that you're likely to run out of space on is /data. This partition is specifically made for the Android system. You could make a partition in Android and mount it at /data if you wanted, too. It's not a system directory, so if you run out of space, the system will still run. BUT, don't expect your applications to run well, or for the system to be 100% stable. Thankfully, Android makes use of a /cache partition, so that you don't see such large fluctuations in usable memory. You don't (normally) have the ability to just stick whatever you want in /cache (yes, there are ways to).

    In any case, once you start running out of disk space, processes might start to fail. Let's take a normal Linux environment for example. If you have a partition that only has 50 MB left, and you try to unzip a file that might potentially still leave some space on the drive, it could still likely fail due to there not being enough space for temporary files as it extracts, etc. That's kind of a broad example, but it will cause problems.

    Just remember that Android does work a little bit differently. You're likely to run into issues if you don't leave yourself a little bit of room on /data. Don't expect the system to necessarily crash, but don't expect it to work well, either. Also, if you run out of room in /cache, expect to have problems. That rarely happens, though, and is easy to fix, anyway.

    As for Windows...well, yeah, most people just stick everything on C:\, which causes the system to crash when you run out of space.
     
    ocnbrze, aburgthing and evomattnc like this.
  13. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    No problem :). It's just one of those things where you have to learn a new process. That can be tedious for anyone. Here is a pretty good step-by-step. Just skip the part about flashing another ROM, etc. unless you're going to do that. Just follow the steps for partitioning. You can do that after flashing a ROM if you want.
     
    Roymus likes this.
  14. evomattnc

    evomattnc Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    3,245
    Joined:
    Feb 10, 2011

    Feb 10, 2011
    3,245
    536
    213
    Mechanical Engineer for GE Nuclear
    NC
    thanks akaza, answer is exactly what i was looking for, as usual :D
     
    midmadn likes this.
  15. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Glad I could help :). Do you remember what exactly it was that you were reading?
     
  16. evomattnc

    evomattnc Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    3,245
    Joined:
    Feb 10, 2011

    Feb 10, 2011
    3,245
    536
    213
    Mechanical Engineer for GE Nuclear
    NC
    I'll have to check my history when i get home, i should be able to find it though.
     
  17. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Akaza...thanks again. I went through the thread...it ends with the poster saying it still didn't work :) I'll give it a shot anyway, doesn't look as if it would hurt, but will obviously nandroid beforehand. Thanks again for the help and the patience!
     
  18. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Those are the basic steps I took, so I know it works :). If you run into any trouble, just let me know
     
  19. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Ok, I've tried partitioning the sd card as instructed. Everything seemed to have worked fine, but it looks as if the external partition is not mounted. When I run ads2 cachesd, I get the message [X] EXT partition not mounted in the middle of the a2sd text block. I went back into recovery and went through the Mounts menu and tried mounting everything...no dice (I'm not even sure what this does really...can't seem to find any reference to it anywhere, but it looked good). There's obviously some Android OS magic that has to happen before the SD card can be successfully mounted. I don't mind partitioning the SD card again, but it takes a while to restore the data (15 GB worth). Any help as always is appreciated!
     
  20. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Are you sure it's partitioned? Did the total space of the fat32 partition go down? Open the terminal emulator, and run this:

    mount|grep mmcblk2

    and

    ls -l /dev/block/mmcblk2
     
    Roymus likes this.
  21. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Akaza: I will PM you to keep this thread from getting too long if that's ok...thanks!
     
  22. evomattnc

    evomattnc Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    3,245
    Joined:
    Feb 10, 2011

    Feb 10, 2011
    3,245
    536
    213
    Mechanical Engineer for GE Nuclear
    NC
    If you have to PM him OK but we dont mind threads getting long, it may help others down the line so we encourage the problems to be solved in thread. Someone may have this issue and never get to solve it and have to PM akaza as well because when it was solved it didnt make it in here.

    Hell sometimes i start a thread and then solve it myself before anyone replies, i still put my solution in the thread.
     
    ocnbrze, ceabbott2 and aburgthing like this.
  23. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    Ok, here you go...I haven't started repartitioning SD card, still backing up, any advice is appreciated!

    Thanks again...here are the questions (I'm using Amon Ra recovery)

    What are the correct options to set from Partition SD? I entered 1,024 for the ext partition size and 32 for the swap size.

    After partitioning, there are two other potential options: SD: ext2 to ext3 and SD: ext3 to ext4. I think I chose both of these options the first time, which may have been a problem. Should I only do ext2 to ext3? If so, what does this do?

    After the partition is done, is there an additional Mount step that must be done from Amon Ra? There is a Mounts menu that allows you to mount system, data, cache, sd-ext, etc...is this necessary?

    After I restore my files from backup and reboot the phone, what (if anything) should I run from Terminal Emulator? I think I need to run:

    a2sd cachesd
    a2sd zipalign

    Also, it looks like the version of DarkTremor Apps2SD I have is 2.7.5.2 (2010-09-30). Is this the latest version? If not, can you post a link to get the latest?

    Finally, I'm thinking of flashing the latest MikFroyo 4.6 ROM (I'm currently running Azrael 4.0). Do I need to go through the partitioning process each time I flash a ROM?

    Thanks as always...

    Roy
     
  24. akazabam

    akazabam Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    4,418
    Joined:
    Jun 7, 2010

    Jun 7, 2010
    4,418
    1,387
    313
    Near Los Angeles
    Okay, so, first of all, where did you get a2sd from? Did it come with Azrael? I'd look, but it's faster to just ask you :p. If it comes with a ROM, you have to do everything manually. If you flashed it after the fact, it attempts to move apps and set up swap upon installation. Since you didn't have the ext partition set up, that's kind of a moot point. Anyway...

    1) That's your problem right there. There is no support for ext4. You need to convert ext2 to ext3, and stop there. If you convert it to ext4, it will never mount. All that does is convert file system types.

    2) The mount options in recovery is strictly temporary mounts from within recovery. It will not affect what happens once you leave recovery and boot up normally. It is, however, a nice way to test an ext partition after you've created it.

    3) The first thing you need to do after getting the partition set up is verify that a2sd will work at all, so you run this command:

    a2sd check

    That will output what you have configured a2sd to do, and if the environment is set up properly. If you're using a Sense ROM, the ext partition will be mounted at /system/sd. If you're using CM, it's mounted at /sd-ext. Assuming that is working, you can continue with a2sd. That being said, what exactly do you want out of a2sd? To be honest, if you don't intend to move apps to the card, you might not want to bother with partitioning the card at all. Moving davlik to the /cache partition (a2sd cachepartreset) will free up just as much space on /data, and will *technically* be faster (especially if you have a slower card). I don't believe zipalign cares where apps are, either. if you intend to move apps to the card, however, you need to run:

    a2sd reinstall

    That will move all apps to the card.

    4) The latest version of a2sd is 2.7.5.3 Beta 04. There is no good reason for you to update, really.

    5) You only need to partition once (until you replace the card, obviously). What you *do* need to remember to do is wipe the ext partition along with other partitions when flashing a new ROM. Think of it as you would wiping data.
     
  25. Roymus

    Roymus Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    43
    Posts:
    203
    Joined:
    Jul 18, 2010

    Jul 18, 2010
    203
    26
    43
    My DarkTremor came with Azrael. I will repartition the card as you suggest and try again. As far as what "m trying to accomplish, that's easy: I'm trying to free up available internal memory (because that's always good, avoids lockups and laggy performance) AND improve overall performance (because that's always good, and I've read that zipalign helps with that). As I've said, I've been using froyo apps2sd up until now...happy to continue, but I've read that a2sd is better.
     
Tags:

Share This Page

Loading...