Linux-Swap without App2SD??? - Hero, G2 Touch Q&A, Help & Troubleshooting

Hi everyone,
A relatively noob question here.
I am running the Official ROM 2.76.405.5 on an unbranded Hero, and want to give Linux-Swap a try. But I don't want Apps2SD; I might move certain apps cache to the SD after rooting, but like the Apps themselve on the internal memory though. How can I go about it? What do I need to do?
1) Can I format my SD card so that it has a fat32 and a linux-swap partition but NO "ext" partition?
2) If I do make an EXT partition, what patch/fix should I do to make only swapping work, without Apps2SD? Modaco's Hero patch as well as his custom ROMs come with Apps2SD. Is there a way to get rid of it?
3) Will I need "busybox" to make swapping work? Or is "Swapper" alone going to be enough?
4) If I make my custom update.zip file from Modaco's Hero patch.zip, from which I delete A2SD, and then falsh that update.zip via the recovery mode, will it work?
5) And what swap size do you recommend? Some people use as large as 256MB... while the default in most cases is 32MB. Is the larger the better?
Please help a non-developer here. Many thanks in advance!

OK, I have done it and it seems right. I made all three partitions (fat32, ext3, and linux-swap) and then pushed busybox by Modaco's method via "adb shell". That means I have the ext3 partition but no Apps2SD, so my apps would stay on the internal memory. Am I right?
Now I have also installed Swapper and so far it has not given me any error. Via Advanced settings, I have told it to use Swap "partition" instead on swap file. My swap partition is 256MB
My questions now are:
1) If I kill swapper by taskkiller, will swapping end?
2) How much swappiness should I choose?
3) How do I know that it is working and what improvements should I expect to see? How can I test that my phone is functioning faster??
Please reply

Would anyone like to share their comments on this, please?!?
One more thing, Hero comes with a 288MB RAM, but the total available system memory (RAM) shown by Swapper app is 197MB. Why such discrepancy??
Your views will be much appreciated!

Very well asked questions. Some masters respond to them please so we don't disturb you about these questions within every thread of yours

to format your sdcard (i'm assuming you know how to use parted and have only 1 partition) resize your fat32 partition, for example, with my 7948 MB sdcard:
Code:
(parted) resize 1 0 7850 (where 7850 is the maximum size of your sd-card minus the amount you wish to allocate for swap, in this case, 98 MB)
wait for it to finish re-sizing, doing it this way prevents data loss, after it's done;
Code:
(parted) mkpartfs primary linux-swap 7850 7900
(parted) mkpartfs primary linux-swap 7900 7948
(parted) rm 2
(parted) resize 3 7850 7948
(parted) quit
you basically create two linux-swap partitions (the second partition can be anything, but I use linux-swap because it can be any size in MB) so that the third one gets asigned a p# of 3, then remove the second one, and then resize the third one to take up the whole space left after your fat 32 partition, that way you don't waste any space. You can always
Code:
(parted) print
to make sure your fat 32 partition has a p# of 1 and your linux-swap has a p# of 3
About why there's only 197MB left on your device? Radio and GPU take the other 96 MB and the system has no access to that memory. Don't worry, it's still enough for you to run hero, pity us dream users with only 96 MB working RAM.
===edit====(answer more questions)
If by "official rom 2.73.405.5" you mean the one you can download from MoDaCo, then I don't even think it has root. There are four 2.73.405.5 roms there, the RUU, which you should avoid like the plague, the Official one which is only the RUU but packaged in OTA format, the Official one with Radio update, and the Official rooted one. You wan't to use the rooted one. Also, you do need busybox (you're already done it). I think that in the official rooted there are no scripts running at boot, so you won't get A2SD forced upon you (always a good thing, soon as I buy my Hero I'm using that build too as a base for my build), no compcache, no swap-file usage, nothing, just a stock rom with root. Anyway, you already have busybox, and that's all swapper requires, so you're good. For extra credit, you could learn how to unpack boot.img and edit the init.rc to call on your own script from bin and have it do swap automagically instead of using swapper (plus you can do nifty things like using mmcblk0p2 instead of p3, among other things).
I don't know how swapper works exactly, but I think all it does is echo settings to the VM to set up swap, so killing the app should do nothing (it's just a front-end to what other roms do automatically) and swap should stay working after you kill it. You can try, just kill the app and then open up the terminal and type
Code:
$su
# busybox free
that will tell you how much memory you have and how much swap you have, you should still have swap even after killing swapper.
About swap size?... depends who you ask. If you ask me, you have a hero with 198 MB working ram and you shouldn't even have to bother with swap at all. If you still want to, maybe try to set up a 32 MB compcache setup (you have enough ram where compcache makes sense) with a swappiness of 0 (this keeps the memory pages for Rosie in swap and even after heavy usage, you can always go back to rosie w/o reloads).
Having a swap-file on your sdcard makes no sense if you don't have a class 6 sdcard as it will hurt performance, so, if you do, anywhere between 64 MB and 198 MB (to match the whole working memory space of the device) with a swappiness of 60 should suffice.
I wish I had a hero...

Thanks jubeh, thanks soo much. It was really helpful After reading your answer, I completely understand how to make only fat32 and linux-swap partitions and save space by not having an ext3.
I am afraid I don't quite understand the compcache thing; I think I have to do more reading/homework on this before I ask further questions
I did install the Official ROM which I downloaded from HTC website as an RUU >> flashed Amon_RA's recovery image via flashrec >> rooted by pushing "su" and "Superuser.apk" via ADB shell, and then also pushed Busybox (from Modaco's 2.2 ROM, I think it is version 1.5.1).
I am using a Sandisk 8GB class 6 card... it is fine so far (except the photo thumbnails not being generated in the ".thumbnails" forlder, but that's a different story). I have noticed that after the ROM upgrade, a folder called "rosie_scroll" get automatically created on the SD card... may be it's a kind of built-in swap?!?! Am not too sure.
Moreover, at the moment, I have set swappiness to 60. When most of the apps are open, the hero functions quite well but I see that about 190-194MB of the internal memeory is being uesd at times and heavy use and the area of occupied swap partition gradually increases. I think it is because only thise apps will swap which are kind of sleeping or dozing in the background. Am I right?
Just another question, if you unzup MCR 2.2, you see in the xbin folder, a file called "dexopt-wrapper", an addition to busybox. What does it do? Its function?
Will having lots off apps open in the background and swapping them continuosly have a deleterious effect on the battery life??
Thanks again
Best regards.

having many apps open means using ram a lot. if you add swapping, it means not only ram sucking battery, but also reading/wirtting sd, which is pretty much battery sucker itself.
so yes, if you want to lengthen your battery life, keep your apps loaded atst to a minimum.
if what you want is a comparison for battery life between swapping and not swapping.. you should check if you have your phone always on or off and some other factors (keeping ram alive in hibernation mode wastes more battery than static sd memory, ie).

Thanks sik_gerar I understand where you are coming from.

Related

Apps2SD + VillainROM 6.2 Problem

Hey,
I've noticed a very weird and particular problem with my Apps2SD on VillainROM 6.2. I've partitioned the SD card as recommended with no swap space and 512MB for ext2 partition and the rest left fat32 one. It is said that it should work automatically.
But after installing ~100 apps maybe less I'm left with 15MB of internal storage left and an information that I cannot install nothing no more due to low space.
I've run appscheck or whatever that script's called (you know the one) and it says: "apps2sd is working without dalvik-cache"
Clearly it should be working then but it's not. I understand that the space should be going down a bit one way or another but having installed less than a 100 apps I should not run out of it especially that most of them were quite small. That said I just wanna add that Android Commander shows up ext2 partition greyed out when I access my mobile with it - so, it sort of prooves that there's something wrong.
Is there a way to fix it, so I could fully enjoy my phone?

[Q] someting about the urukdroid 0.7

hi everyone here
i am a new guy here,my device is the archos 101 16G.after i install the urukdroid 0.7 in the internal stock(16G),it run well.
i also found its " Available space" become 735MB.not casual 256MB.however,its "free memory" for running apps is just 110MB(when i kill most of services and apps).concequently,after three or four web pages opend(especially flash on),the browse collapse!,i think it is killed dued to lack of free memory.
so .who can tell me why? "735MB" just a fiction?
thanks
No fiction, just missinformation on your side.
"Available space" equals to the space left on the /data partition. This is the space you have for installing Apps an their private data.
This has nothing to do with the amount of memory the processor has to operate.
This stays at 256 MB.
After Android is started you probably have around 100MB left of that.
If you need more memory, you have to enable swapping and/or compcache.
thanks for your help,
i wonder is it stable to SWAP "256Mb" in my SDcard?
and the"swap swappiness" value should be "10" or "60" or other?
addtionally,is it any way swapping in the internal stock? i mean the infernal 16G
thanks too
This is a good question, but we can not answer this really.
1. Swappiness means the lower the value the harder the kernel tries not to swap.
2. You can put the swapfile onto the internal drive, BUT as you constantly run out of mem ( by your description ) you will have alot of writecycles.
And a SD has a limitted write contingent so your internal drive might age faster, and because you can't change that i personaly would not use it for swap.
But there are some reports that normal SD cards sometimes give a freeze.
If you use Dolphin Browser you can decide to put the cache onto SD.
ok,thanks a lot,
seems that i have to use the dolphin and age my SDcard both
by the way,anyone could give me some tips how to swap in sdcard?
is it neccessally to repartition sdcard and how?
Swap
Swapper 2 is pretty easy.
Swapper 2 (for Root users)
To put the Swap partition on your sdcard go to; settings - Swap place - and enter.
/sdcard/sdcard/swapfile.swp
You can also change - Swappiness - and - Swap Size - in settings if you choose to.
After changing settings go back to home page and push ON button. It will then create the swap on your sdcard, be patient this takes a few seconds. You can see the Swap file on your sdcard using file manager. It automatically turns itself on after reboots.
To use USB you have to turn Swap on your sdcard off by simply going to Swapper 2 and press the OFF button.
When finished using USB simply turn it back on or it will turn back on after your next reboot.

Out of Space even after App2SD!

I have a HTC Legend running on NewSense RC4. I have App2SD installed. I've changed the default install location to SD Card via " pm shell setInstallLocation 2". Though I've done all this, I have only around 2-3 MB space always. I're removed the data and cache for many apps. Yet, this is the situation. And I only have 52 APPS.
Please tell me another method to increase the amount of space. Please don't sugesst me to flash to another ROM.
I also read somewhere about partitions on SD card or something. Can you please enlighten me on this?
Note: I read to fast and COMPLETELY skipped the part where you said "Don't tell me to flash another rom" I am soooooo sorry!
The only other option I can give you is to flash Cyanogenmod7 and use data2ext if you want app space, but that is probably out of the question for you!
On the partitioning note:
Partitioning quite simply means splitting your microSD card into 2 or more PARTS (hintART-itioning). Often times, partitioning is used to create a separate space for apps2SD or data2ext. The simplest way to partition is to download rom manager (you must have root and be able to boot into recovery) and choose the option "partition sd card" choose 0 swap , then choose 512mb partitioning space! WARNING: this will delete EVERYTHING on your memory card, so either turn back, or backip tour mem. Card! After it is partitioned, you can proceed to add apps to the new partition of your SD card. Note this will, like I said, split your memory card space! Ex:
If you hav a 1 GB (1024 MB) Memory card, after partitioning, your memory for files will decrease to 512 mb, while 512 mb is reserved for your apps!
Just a word of advice from a fellow XDA-er!
I am not aware whether or not the HTC legend runs Cyanogenmod7 or not, but it would be well worth the flash to use it. Unless you are in love with the Sense UI (because CM7 uses 2.3.3 Gingerbread) then come on over to the Cyan side . Data2ext takes your ENTIRE data section of your phone (that part that holds the meat and bones of an app, PLUS the huge apk file) and puts it in that partition you created. Data2ext is simply a flashable script that puts that partition in action. After flashing the script via recovery, just go to your terminal emulator app on your phone and on the first line, type "su" (without quotes) and then type "data2ext --enable" (exactly as typed without quotes) and vuala, your REAL data section on your phone is literally virtually UNTOUCHED! Which makes your phone a lot faster. There is also a script that let's you choose the size of your partition (no more than 2 GB is strongly recommended) but I haven't used that script just yet, but will soon! Data2ext is WAY bettr than apps to SD! I know that I did way more than just answer your question, but I wanted to answer, plus give a better alternative should you choose to use it
Hope I answered ur question,
Ognimnella
Sent from my T-Mobile myTouch 3G Slide using XDA App
ognimnella said:
Note: I read to fast and COMPLETELY skipped the part where you said "Don't tell me to flash another rom" I am soooooo sorry!
The only other option I can give you is to flash Cyanogenmod7 and use data2ext if you want app space, but that is probably out of the question for you!
On the partitioning note:
Partitioning quite simply means splitting your microSD card into 2 or more PARTS (hintART-itioning). Often times, partitioning is used to create a separate space for apps2SD or data2ext. The simplest way to partition is to download rom manager (you must have root and be able to boot into recovery) and choose the option "partition sd card" choose 0 swap , then choose 512mb partitioning space! WARNING: this will delete EVERYTHING on your memory card, so either turn back, or backip tour mem. Card! After it is partitioned, you can proceed to add apps to the new partition of your SD card. Note this will, like I said, split your memory card space! Ex:
If you hav a 1 GB (1024 MB) Memory card, after partitioning, your memory for files will decrease to 512 mb, while 512 mb is reserved for your apps!
Just a word of advice from a fellow XDA-er!
I am not aware whether or not the HTC legend runs Cyanogenmod7 or not, but it would be well worth the flash to use it. Unless you are in love with the Sense UI (because CM7 uses 2.3.3 Gingerbread) then come on over to the Cyan side . Data2ext takes your ENTIRE data section of your phone (that part that holds the meat and bones of an app, PLUS the huge apk file) and puts it in that partition you created. Data2ext is simply a flashable script that puts that partition in action. After flashing the script via recovery, just go to your terminal emulator app on your phone and on the first line, type "su" (without quotes) and then type "data2ext --enable" (exactly as typed without quotes) and vuala, your REAL data section on your phone is literally virtually UNTOUCHED! Which makes your phone a lot faster. There is also a script that let's you choose the size of your partition (no more than 2 GB is strongly recommended) but I haven't used that script just yet, but will soon! Data2ext is WAY bettr than apps to SD! I know that I did way more than just answer your question, but I wanted to answer, plus give a better alternative should you choose to use it
Hope I answered ur question,
Ognimnella
Sent from my T-Mobile myTouch 3G Slide using XDA App
Click to expand...
Click to collapse
Yes, I read about the partitioning method. I've a few questions.
1. Will this method work on ANY ROM ?
2. Will I reclaim ALL my internal memory?
3. Is this is a sure shot method to install AS MANY apps as we need (the only condition being you that much SD card partition space) ?
4. Can you please link me to a detailed tutorial?
abhishek_turbo911 said:
Yes, I read about the partitioning method. I've a few questions.
1. Will this method work on ANY ROM ?
2. Will I reclaim ALL my internal memory?
3. Is this is a sure shot method to install AS MANY apps as we need (the only condition being you that much SD card partition space) ?
4. Can you please link me to a detailed tutorial?
Click to expand...
Click to collapse
1. Method will only work on rom that support it.
2. You will get a lot of internal memory back but data will remain internal unless you move app's data to sd-ext also.
3. Method trick the phone into thinking the sd-ext is part of your internal memory so you'll be able to install a good amount of apps.
4. Search Dark Tremor's a2sd or S2E in the market.
abhishek_turbo911 said:
Yes, I read about the partitioning method. I've a few questions.
1. Will this method work on ANY ROM ?
2. Will I reclaim ALL my internal memory?
3. Is this is a sure shot method to install AS MANY apps as we need (the only condition being you that much SD card partition space) ?
4. Can you please link me to a detailed tutorial?
Click to expand...
Click to collapse
1. No to my knowledge it only works on CM7 (and you said flashing a new rom is out of the question)
2. Yes, plus more
3. Yes, so far, I hav somewhere around 85 apps installed (and that's with 512 mb only, with 150-200mb still left
4. http://forum.xda-developers.com/showthread.php?t=902395
P.S. - If you want to have the freedom of installing up to 2GB partition space for apps, use data2ext-v4. If you want the already preset 512mb, then use data2ext-v7 (it is thoroughly explained in the post)
Sent from my T-Mobile myTouch 3G Slide using XDA App

[Q] using preinstall as swap, possible?

I would like to know if is possible to use preinstal partition as swap on stock rom with stock kernel.
what would be the drawbacks of doing such thing?
can be placed a file to act as swap?
On a rooted device, yes. No problem. You don't need a file, you could just format the entire partition as swap. I don't see any drawbacks but I also don't see many benefits to this... For me, the normal physical RAM available to the system is more than enough. I have not been able to fill up more than half of that, not even once.
BTW the total RAM available should be around 700-800 MB. If you have less than that, you probably need to apply the ramfix, which will improve the performance of your device more than any kind of swap.
chepe263 said:
I would like to know if is possible to use preinstal partition as swap on stock rom with stock kernel.
what would be the drawbacks of doing such thing?
can be placed a file to act as swap?
Click to expand...
Click to collapse
The advantage of using the internal storage as swap is that it would be faster than putting it on a microSD card. The preinstall partition is certainly large enough to use for swap.
The disadvantage to using internal storage is that flash memory does have a limited life. For normal file access the lifetime of flash memory will most likely exceed the useful life of the phone, but this may not be the case when flash memory is used for swap. Swap will put many more read - write cycles on the flash memory than normal file access.
I use swap; my experience is that I need swap space if I want to use the webtop for anything more than occasional web browsing. Before I enabled swap webtop was regularly warning me that I had low memory (and you can't close the warning message, which is really annoying). I put together a description of what I did in the 7th post on this thread:
http://forum.xda-developers.com/showthread.php?t=2200679​
If you do go ahead and use preinstall as swap, let us know how it works.

[Q] Why 4096/0 smoothbean partitions sizes

I've been running latest SmoothBean for some time and it appears to be the most stable JB version out there. Always open to other opinions. I'm an old IT guy with years of Windows/Unix/Linux experience and I've had Mepis Linux on my desktop in the past, for 2-3 years, but went back to Windows 7/8. Anyway I noticed the install instructions say format the internal SD storage 4096/0 but it seems to run fine with 2048/0 so just wondering what the reasoning is for the increased partition size when it seems to run fine with 2048?
Also why 0 for swap size partition, doesn't Android need swap space similar to Unix/Linux OS's?
thanks in advance
dano10 said:
I've been running latest SmoothBean for some time and it appears to be the most stable JB version out there. Always open to other opinions. I'm an old IT guy with years of Windows/Unix/Linux experience and I've had Mepis Linux on my desktop in the past, for 2-3 years, but went back to Windows 7/8. Anyway I noticed the install instructions say format the internal SD storage 4096/0 but it seems to run fine with 2048/0 so just wondering what the reasoning is for the increased partition size when it seems to run fine with 2048?
Also why 0 for swap size partition, doesn't Android need swap space similar to Unix/Linux OS's?
thanks in advance
Click to expand...
Click to collapse
The reason behind the bigger Data partition is that the cache is symlinked to a portion of the data partition rather then the standard cache partition on the nand. While testing I to ran it at 2048 without any issue, up until I added a crap load of apps that hogged up that partition. So maxing out the data partition was the recommendation. As far as adding swap space that is not necessary since the boot.img will not use it. There are scripts that can be made to add it, but it is pointless since Zram is far better and work. In a terminal Emulator app just type in (free) and you will see that swap is already recognizing the zram and using it.

Categories

Resources