Related
I've seen a lot of people complaining about not being able to boot after using A2SD for a while and I think it's definitely necessary to make clear the danger in using A2SD and some ways to prevents them.
Do not move /data/data to SD.
You can safely move /data/app and /data/app-private to SD. Be cautions with /data/dalvik-cache. (See below)
Make sure the ext2 partition are mounted with noatime and nodiratime (rom maker's job)
Do regular file system checks (using Linux)
Back up your ext2 partition and redo them regularly
Here're the theories:
(NAND) Flash memory has two serious limitations when used to store frequently changing data: you cannot do random write unless you erase a whole page first and any bit can only be written a limited number of times (typically a couple millions). When one bit in a page is detected to be faulty, you lose the whole page. (More details: http://en.wikipedia.org/wiki/Flash_memory#Limitations )
Most mobile os vendors overcome this problem by using special file systems, namely yaffs and jffs, which arrange files according to page size and do write operations only when necessary. They also provide journals so hardware faults could be reliably detected and corrected.
EXT2, which is the file system used in A2SD, DO NOT have these features. It may stupidly allow several pages to be erased hundreds of times of just to write some small files into it. Things are made even worse because some fixed part of the file system (inode table and bitmap) has to be written EVERYTIME a file operation is done. The will accelerate the wearing of those pages and when they become inaccessible, you lose the whole file system.
A2SD would work fine if you only move /data/app to it, because the application files are never modified. It is a completely different story for /data/data because the sqlite databases in there are modified almost every other second!! (And I suspect the OS commit them to disk very often to ensure data integrity.)
In addition, android does not have system check tools for ext2, so it will not be able to detect any problem with the file system until it’s too late.
Edit:
I am not sure how frequent the system updates files in dalvik-cache, but I would say you only move it when you are running out of space in /data.
(Also changed title)
billc.cn said:
I've seen a lot of people complaining about not being able to boot after using A2SD for a while and I think it's definitely necessary to make clear the danger in using A2SD and some ways to prevents them.
Do not move /data/data to SD.
Do regular file system checks (using Linux)
Back up your ext2 parition and redo them regularly
Here're the theories:
(NAND) Flash memory has two serious limitations when used to store frequently changing data: you cannot do random write unless you erase a whole page first and any bit can only be written a limited number of times (typically a couple millions). When one bit in a page is detected to be faulty, you lose the whole page. (More details: http://en.wikipedia.org/wiki/Flash_memory#Limitations )
Most mobile os vendors overcome this problem by using special file systems, namely yaffs and jffs, which arrange files according to page size and do write operations only when necessary. They also provide journals so hardware faults could be reliably detected and corrected.
EXT2, which is the file system used in A2SD, DO NOT have these features. It may stupidly allow several pages to be erased hundreds of times of just to write some small files into it. Things are made even worse because some fixed part of the file system (inode table and bitmap) has to be written EVERYTIME a file operation is done. The will accelerate the wearing of those pages and when they become inaccessible, you lose the whole file system.
A2SD would work fine if you only move /data/app to it, because the application files are never modified. It is a completely different story for /data/data because the sqlite databases in there are modified almost every other second!! (And I suspect the OS commit them to disk very often to ensure data integrity.)
In addition, android does not have system check tools for ext2, so it will not be able to detect any problem with the file system until it’s too late.
Click to expand...
Click to collapse
these are very good points. Actually come to think of it we better mount the ext2 partition with noatime. Because right now every read will wear the flash down. flash storage is really not meant for ext2 filesystem.
knaries2000 said:
these are very good points. Actually come to think of it we better mount the ext2 partition with noatime. Because right now every read will wear the flash down. flash storage is really not meant for ext2 filesystem.
Click to expand...
Click to collapse
In JF1.5 build it is mounted with noatime, i believe:
#mount
/dev/mmcblk0p2 on /system/sd type ext2 (rw,noatime,nodiratime,errors=continue)
But I totally agree with the point of the thread /data/data should not be moved to sd. Not that it's only dangerous (as described), I even don't see any advantages of it.
Dimath said:
In JF1.5 build it is mounted with noatime, i believe:
#mount
/dev/mmcblk0p2 on /system/sd type ext2 (rw,noatime,nodiratime,errors=continue)
But I totally agree with the point of the thread /data/data should not be moved to sd. Not that it's only dangerous (as described), I even don't see any advantages of it.
Click to expand...
Click to collapse
really. that's good, but I am running haykuro's build right now and it is not mounted with noatime. I will have to change the init script.
I'm using JF's 1.5 A2SD build, and I'm pretty certain I moved over /data/data. I didn't really ask myself the question when doing it, but what exactly is stored in /data/data? Is there a command I can run to move it back off the SD card?
Are ext2 and fat the only supported file systems in the android kernel? If not maybe it would be best to move to a wiser file system.
Rekna said:
Are ext2 and fat the only supported file systems in the android kernel? If not maybe it would be best to move to a wiser file system.
Click to expand...
Click to collapse
Yeah, why can't we use yaffs etc?
Dimath said:
Yeah, why can't we use yaffs etc?
Click to expand...
Click to collapse
i don't think most partitioners support yaffs
i know the partition manager on ubuntu 8.10 doesn't
tubaking182 said:
i don't think most partitioners support yaffs
i know the partition manager on ubuntu 8.10 doesn't
Click to expand...
Click to collapse
Indeed, and I'm fairly sure that's why it hasn't been done. But keep in mind several million write cycles is a heck of a lot and apps only really write their data caches occasionally, so it'll likely be a while before anything bad happens(on the scale of years) so this is slight sensationalism. Actually the term "cache" is a slight misnomer here since it's really just storage the apps use for temporary data. If it were used as some kind of extended RAM or a real cache then I could see problems but with what it's used for it should be a non-issue.
billc.cn said:
Here're the theories:
Click to expand...
Click to collapse
SD cards are a form of removable flash that have their own write controllers. In most cases, the write controllers also perform wear levelling. This means even if a program writes to the same file on the sd repeatedly, each time it writes, it is not writing the same physical location on the flash. The reason for this is because due to the way flash works, entire blocks have to be erased before they can be rewritten. To make writing faster, the memory controller keeps a list of empty blocks that are ready to use. When a file is changed, the entire file with the new changes is written to a new memory block and then the old block with obsolete data is then reset to zeros (data deleted).
That said, I still think A2SD is a red herring that only contributes to newbies spamming these forums.
jashsu said:
SD cards are a form of removable flash that have their own write controllers. In most cases, the write controllers also perform wear levelling. This means even if a program writes to the same file on the sd repeatedly, each time it writes, it is not writing the same physical location on the flash. The reason for this is because due to the way flash works, entire blocks have to be erased before they can be rewritten. To make writing faster, the memory controller keeps a list of empty blocks that are ready to use. When a file is changed, the entire file with the new changes is written to a new memory block and then the old block with obsolete data is then reset to zeros (data deleted).
That said, I still think A2SD is a red herring that only contributes to newbies spamming these forums.
Click to expand...
Click to collapse
Which is exactly why I made my new method that's able to deal with a lot of user mistakes and can be incorporated into ROMs to make it take almost 0 user effort
Dimath said:
Yeah, why can't we use yaffs etc?
Click to expand...
Click to collapse
yaffs on SD cards can in some common cases invalidate the wear leveling in hardware that SD cards do, as they so the wear leveling in software.
You are simply understimating ROM makers, SD cards are different from the internal flash in that they do auto wear leveling, that's why you can put common filesystems like FAT which have statically placed allocation tables and writes to the same logical sector will always land on very different places in the card every time.
Yes, noatime will help a lot as it will _reduce_ writes to your SD card.
ext2 is not journalled so it will have less writes too than ext3 or any other journalled filesystem.
So ROM makers are already doing a good job, don't understimate them please.
I understand that this probably will get moved and placed elsewhere under some long post but I'd like to make an individual thread and catch the eyes of people who wouldn't go through those threads to find this.
Any who can we partition the Ram like we did the sd card for apps?
Why?
To set and limit core apps and fix force closings [possibly] and making space for third party apps to run smoothly.
I don't know if it is possible but I do think it is a beautiful idea.
No, there's no way to accomplish anything like that(at least nothing I've ever heard of and I'm a software engineer)
I'm glad that you feel your idea is more important than everyone elses.
No, you can't partition RAM.
i don't know about android OS but ram drives can be created in linux
ram drive is important for ssd users and is created with tmpfs in fstab
There already are memory usage limits set for different types of applications. You can see this in init.rc. But it's not practical to "partition" the memory or limit the memory used by backgroud apps. As you can see the default policy is actually biased towards background services, etc.
samygent said:
i don't know about android OS but ram drives can be created in linux
ram drive is important for ssd users and is created with tmpfs in fstab
Click to expand...
Click to collapse
Yes, they can be created in Android. That is what compcache uses. But from what I read in the OP, that isn't what he is looking for. Maybe I misunderstood him but it sounded like he wanted to limit certain applications from being able to use too much memory. A RAM drive is available to the OS to manage, right? I don't know of any way to stop a specific application from using a RAM drive.
could he be talking about like how the spl partitions data cache and system?
you mount the ram drive like a normal disk and copy whatever files you want on that partition but sadly everything is lost when you reboot
i would like to try it but i don't want to brick my phone by messing up with my fstab
I think i understand he's question. Would it be possible to use g1 internal memory only for hungry tasks and swap partition for the rest ?
I wish it was but sadly it not possible. I hate it too when some silly task take internal memory space with is way faster then sd swap speed
and now that i think about it , ram drive would'nt really help simply because android applications take very low space on drive
samygent said:
you mount the ram drive like a normal disk and copy whatever files you want on that partition but sadly everything is lost when you reboot
i would like to try it but i don't want to brick my phone by messing up with my fstab
Click to expand...
Click to collapse
I was trying to do it based on some stuff I googled. I can't get it to work. It may not have support for it by default. It could be that Compcache loads what it needs to so that it can create a Ramdisk.
Post the steps that you would use and I will try it. It won't brick my phone, I'll just have to wipe and reload which is no big deal.
not gonna mess with fstab for the moment but you can try this
create a dir somewhere, mkdir -p /system/ram
and then
mount -t tmpfs -o size=5M,mode=0744 tmpfs /system/ram
you now have a 5mb ram drive
copy something on it to test
samygent said:
not gonna mess with fstab for the moment but you can try this
create a dir somewhere, mkdir -p /system/ram
and then
mount -t tmpfs -o size=5M,mode=0744 tmpfs /system/ram
you now have a 5mb ram drive
copy something on it to test
Click to expand...
Click to collapse
It might have to wait until I get off Hero but I will try it.
i'm using hero
funny thing is , i created a 100 mb ram drive, copy something on it and umount it. swap is almost full and 35mb free on internal ram
then tried to start hero browser and it started in about less then 2 secs
samygent said:
i'm using hero
funny thing is , i created a 100 mb ram drive, copy something on it and umount it. swap is almost full and 35mb free on internal ram
then tried to start hero browser and it started in about less then 2 secs
Click to expand...
Click to collapse
Interesting. Try setting it as a swap device. Are you sure it created it from RAM? Is there really 100Mb of RAM free?
yup my hero is a lot faster now
create ram partition, copy big ass file ( 80 mb hero file ) phone is very slow
ram and swap are used up to 100%
umount the ram partition , 50 mb free on internal ram and 50 mb used on swap partition
internal ram goes down to 1-2 mb free space after a few seconds but phone is very damn fast and swap is still filled up to 50 mb
samygent said:
yup my hero is a lot faster now
create ram partition, copy big ass file ( 80 mb hero file ) phone is very slow
ram and swap are used up to 100%
umount the ram partition , 50 mb free on internal ram and 50 mb used on swap partition
internal ram goes down to 1-2 mb free space after a few seconds but phone is very damn fast and swap is still filled up to 50 mb
Click to expand...
Click to collapse
You are basically just forcing the phone to use all swap instead of RAM. Some people set their swapiness to 100, which makes the phone use swap whenver possible. It's strange that swap would perform better than internal RAM. I have some ideas for making Hero run better but I can't get Compcache running on JACxHEROski. Which Hero are you running?
miketaylor00 said:
You are basically just forcing the phone to use all swap instead of RAM. Some people set their swapiness to 100, which makes the phone use swap whenver possible. It's strange that swap would perform better than internal RAM. I have some ideas for making Hero run better but I can't get Compcache running on JACxHEROski. Which Hero are you running?
Click to expand...
Click to collapse
You need to do it via rzstool
And her I thought I was an idiot for not being able to get get compcache running thru the userinit....
I'm sorry to hear that this seams like it can't be done currently but I'm glad I at least created some good conversation amongst everyone.
My whole idea for this was to partition the core apps and limit them/section them to only a certain amount of space to avoid them from force closing since they could have an appropriate amount of dedicated ram to keep them going clean and strong then after all that was taken care of third party apps could have a little space left to run a lot better.
I guess I'm more so just thinking about sectioning off the ram to apps then third party apps.
First off, don't get compcache running through userint.sh edit the user.conf file.
I wanted to know if we can increase the ram of our little pico (htc Explorer)....also I wanted to know the advantages of swap partition.....Does it increase the ram size ?? And also I wanted to know that if there are any other advantages of Sd-ext partition other than increasing the Internal memory ??
ahmadmemon said:
I wanted to know if we can increase the ram of our little pico (htc Explorer)....also I wanted to know the advantages of swap partition.....Does it increase the ram size ?? And also I wanted to know that if there are any other advantages of Sd-ext partition other than increasing the Internal memory ??
Click to expand...
Click to collapse
No, you can't. Physical RAM is fixed.
Swap acts as pagefile on Windows, if you know pagefile. swap is virtual RAM. When the system needs more memory, a part of RAM will be written to the swap partition. Swap partition is part of SD card, so it would be painfully slow to use. Beside that, using swap also quickly wear out your SD card.
Sd-ext partition can be configured to accommodate swap, if you have the right app/script. Normally, you divide your SD card in to 3 partitions, 1st for media, 2nd for app storage, 3rd for swap. And our phone's recovery have option to do this too.
As I said, I strongly object against using swap partition. It will make your phone even slower than without it.
Your best bet here is zRAM, or compcache. You can find zRAM setting in most CM based ROM. zRAM relies on compression to increase the virtual size of your RAM. For example, an app that usually takes 10MB of RAM will now take only 9MB if you choose 10% compression.
There're 10%, 18%, and 26% options. But zRAM is not free. It uses your CPU to compress and decompress data, so our phone's weak CPU is not very happy with it. Your choice. But if you really need more app to cache more app (better multi-tasking), 10% zRAM will give you about 40MB RAM more (400MB*10%=40MB), at the cost of little CPU and battery. Using 18% and 26% seems too aggressive.
redguardsoldier said:
No, you can't. Physical RAM is fixed.
Swap acts as pagefile on Windows, if you know pagefile. swap is virtual RAM. When the system needs more memory, a part of RAM will be written to the swap partition. Swap partition is part of SD card, so it would be painfully slow to use. Beside that, using swap also quickly wear out your SD card.
Sd-ext partition can be configured to accommodate swap, if you have the right app/script. Normally, you divide your SD card in to 3 partitions, 1st for media, 2nd for app storage, 3rd for swap. And our phone's recovery have option to do this too.
As I said, I strongly object against using swap partition. It will make your phone even slower than without it.
Your best bet here is zRAM, or compcache. You can find zRAM setting in most CM based ROM. zRAM relies on compression to increase the virtual size of your RAM. For example, an app that usually takes 10MB of RAM will now take only 9MB if you choose 10% compression.
There're 10%, 18%, and 26% options. But zRAM is not free. It uses your CPU to compress and decompress data, so our phone's weak CPU is not very happy with it. Your choice. But if you really need more app to cache more app (better multi-tasking), 10% zRAM will give you about 40MB RAM more (400MB*10%=40MB), at the cost of little CPU and battery. Using 18% and 26% seems too aggressive.
Click to expand...
Click to collapse
Does zRAM works without swap partition ??
Yes, it's different, you can read @redguardsoldier's post again, to get exactly what he is saying, just to be on the safe side
Increase RAM In HTC Pico (I worked For ME ).
ahmadmemon said:
I wanted to know if we can increase the ram of our little pico (htc Explorer)....also I wanted to know the advantages of swap partition.....Does it increase the ram size ?? And also I wanted to know that if there are any other advantages of Sd-ext partition other than increasing the Internal memory ??
Click to expand...
Click to collapse
TRY THE LINK BELOW IT WOKED FOR ME :laugh: >>>>>>>>>>>>
http://forum.xda-developers.com/showthread.php?t=2735281
I hope It will work for u as WELL :good:
One of functionalities of the SDmaid app is to detect and remove empty directories from sdcards.
Well, so could anyone please tell me why almost all of the filtered search list of empty directories has none-zero size ?
Whats wrong if they are wheather empty or not?
Pardon bad Eng.
ahmad990 said:
One of functionalities of the SDmaid app is to detect and remove empty directories from sdcards.
Well, so could anyone please tell me why almost all of the filtered search list of empty directories has none-zero size ?
Whats wrong if they are wheather empty or not?
Pardon bad Eng.
Click to expand...
Click to collapse
Depending your filesystem an empty directory still takes up the space of one block, usually 4kb.
Dark3n said:
Depending your filesystem an empty directory still takes up the space of one block, usually 4kb.
Click to expand...
Click to collapse
Thanx,but look dude; if u ever have tried the Sd maid ,some of filtered empty directory results have incredibly huge size like 2Mbts!
As we ve learned in School ,Empty is used to be meant F...... none.
Hello I installed miui.eu and the flash back to global, but I both cases the memory on the phone said that 35 gb of space are being occupied by the system, does anyone know where can I search for the files, of how can I verify if something is eating up my space??
In general it's like that storage space used by the system = the sum of all system partitions. A partition has a fixed size and it doesn't matter what and how much is stored on the partition. The occupied space remains the same. On the other hand these partitions are all 'read-only' and you have no ability to store data on it. You are only allowed to use the last partition of your eMMC storage which is not a system one.
Nevertheless 35GB are still far too much! Even on an A/B device. I guess it's some system's stuff stored on /data and it's somewhere in a directory that's only accessible for the system. Android then treats it as space occupied by the system.
Root enabled? Then try the app 'disc usage' or much better would be the use of a terminal app e.g. Termux. It's able to show you the exact usage on /data + you could check the size of all your system partitions (if you want to).