Q: Moving or symlinking /cache to sd-card - General Questions and Answers

How does one either mount,move or symlinking /cache to sd-card - preferely sd-ext?
I have 24 MB /cache and when market downloads app to install (installs to sd-ext using DT a2sd) it caches to /cache first and then installs to sd-ext..
Apps larger than 24 MB causes market to stop downloading and tells theres not enough space.

I was able to umount -l /cache and remount it to sd-ext which works.
How do you make this constant with a startup script?

Related

[Q] Can't install large apps anymore

Suddenly I can't download from market any large apps ( about 25 MB), using logcat I see "... not enough free space in internal downlad storage".
90% of the installed apps are on the sd, and I have a lot of free space :
SD 3 GB free
Internal 1,36 free
Emmc 11 free
I tried to clear cache and vm cache from recovery, but no luck.
I am using a cyanogenmod rom.
Any advice,pls ?
Are you using the new market? If so that has been causing the same problems for me
natious said:
Are you using the new market? If so that has been causing the same problems for me
Click to expand...
Click to collapse
I tried both: at the beginning I had the old market, after I tried with the new one: same result!
I looked around and I found that the problem could be the /cache folder.
I have:
Filesystem------Size--Used--Free--MountPoint
/dev/block/stl1 30.7M 4.1M 26.7M /cache
If the system uses the /cache downloading I could never install an app like that (about 28MB).
Can I mount/link the /cache fs in another place ?
EDIT:
Funny situation, indeed!!
I switched from cyano to overcome (full wipe).
My /cache was 30 MB and with 4k used, so I could install one big application!
I started to install another one.... no space left!
Again... now I have /cache with 4MB used, so I can't install any other big application!!
Browsing with root file manager I really can't see anything of 4MB size (even hidden!!)
EDIT [SOLVED]
Using the script in this thread
http://forum.xda-developers.com/showthread.php?t=1188972&highlight=cache
Code:
stratosk - 27/07/2011
# Corgar - 28/07/2011 ( changed location of cache in dbdata for onenand i/o, decreased cache dimension to 50mb )
# Remount /cache partition with a larger one (54.5 MB / 50mb cache)
# create a file 54.4 MB
dd if=/dev/zero of=/data/cache.img bs=1024 count=55808
# create ext4 filesystem
mke2fs -F -T ext4 /data/cache.img
# unmounting old cache partition
umount /cache
# mount
losetup /dev/block/loop7 /dbdata/cache.img
mount -t ext4 /dev/block/loop7 /cache
chown system.cache /cache
chmod 770 /cache
All the applications can be installed!!
i have same problem

[Q] CyanogenMod 6.3.0 link2sd

Anyone get link2sd working with the latest CyanogenMod 6.3.0 from Moize yet?
Tried reformatting, keep running into the Mount script error.
"Mount script cannot be created.
mount: mounting/dev/block/vold/179:2 on /data/sdext2 failed: No such device"
For quick reference, it was working on Khalpower's EpicSteelBlue rom. I can't seem to get SU to run in adb shell either...
Any workarounds would be appreciated!
(I don't have enough posts to post in the main development thread yet.)
Can you run these commands (either in adb shell or terminal):
Code:
su
fdisk -l /dev/block/mmcblk0 > /sdcard/fdisk.txt
and then post the contents of /sdcard/fdisk.txt ?
I will try as soon as I get back home.
Restored my backup since I need to be heading out for now.
Back. Here are the contents of fdisk.txt.
Code:
Disk /dev/block/mmcblk0: 16.5 GB, 16574840832 bytes
255 heads, 63 sectors/track, 2015 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 1689 13566861 b Win95 FAT32
/dev/block/mmcblk0p2 1690 1885 1574370 83 Linux
/dev/block/mmcblk0p3 1886 2015 1044225 82 Linux swap
The native app2ext works, but I can't enable link2sd for some reason.
Raydonn said:
Back. Here are the contents of fdisk.txt.
Code:
Disk /dev/block/mmcblk0: 16.5 GB, 16574840832 bytes
255 heads, 63 sectors/track, 2015 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 1689 13566861 b Win95 FAT32
/dev/block/mmcblk0p2 1690 1885 1574370 83 Linux
/dev/block/mmcblk0p3 1886 2015 1044225 82 Linux swap
The native app2ext works, but I can't enable link2sd for some reason.
Click to expand...
Click to collapse
Can you try making an empty /sd-ext/link2sd directory and reboot? Or have you done that already?
Mioze7Ae said:
Can you try making an empty /sd-ext/link2sd directory and reboot? Or have you done that already?
Click to expand...
Click to collapse
I've tried that.
Link2sd won't recognize it for some reason on this rom.
I found some bugs in the link2sd init.d script. A hotfix can be found here:
http://forum.xda-developers.com/showpost.php?p=16757523&postcount=408
Thanks, link2sd is working now.
But there seems to be another problem I'm running into. I can't seem to get the system to mount anything but ext2.
So ext2? Link2sd and root explorer sees the sd-ext fine and reports the size, etc.
ext3 and ext 4? Unable to mount.
Perhaps there's something I'm overlooking, but I've reformatted the SD card several times now to no avail.
Try to manualy mount like:
mount /dev/block/mmcblk0p2 /sd-ext -t ext4(3) and reboot.
fjfalcon said:
Try to manualy mount like:
mount /dev/block/mmcblk0p2 /sd-ext -t ext4(3) and reboot.
Click to expand...
Click to collapse
Hmm, tried that.
Getting the error message
"mounting /dev/block/mmcblk0p2 on /sd-ext failed: No such device" for ext3.
"mounting /dev/block/mmcblk0p2 on /sd-ext failed: Invalid argument" for ext4.
ls /system/lib | grep ext
show input...
fjfalcon said:
ls /system/lib | grep ext
show input...
Click to expand...
Click to collapse
Code:
libext2_blkid.so
libext2_com_err.so
libext2_e2p.so
libext2_profile.so
libext2_uuid.so
libext2fs.so
Are you sure that u usyng cm 6.3.0?
Cause it has already build-in modules for ext4.
http://www.multiupload.com/VHPFIMOJTR
apply that update again, you don't need to make any wipes.(or just wipe cache...)
Hmm, tried updating/installing again.
Still no luck. Same results.
Does it matter that I skipped 6.1.2 and went straight to 6.3.0? Although that doesn't make much sense since you said 6.3.0 included the modules for ext4.
I also see ext2.ko, ext3.ko, ext4.ko in system/lib/modules so I assume it's all there.
Small update.
I don't know why, but link2sd is working now and apparently with ext4.
Maybe it's because I installed cm6.1.2 and then applied cm6.3.0 overtop it? I didn't factory wipe though, but it still works.
Or maybe it's because I used the new OR to update my ext2 to ext4 instead of fresh formatting it to ext4?
Or maybe the latest version of link2sd fixed ext4 support? I don't know.
But anyhow, thanks for all the help and the great ROM.
Raydonn said:
Or maybe it's because I used the new OR to update my ext2 to ext4 instead of fresh formatting it to ext4?
Click to expand...
Click to collapse
Probably this one. The ext4 update in the OR uses known-working ext4 options. I think there are some features that desktops turn on by default when formatting ext4 that don't work with our kernel. My guess is it's largefile support, but I haven't tested tested that hunch.

[Q] Android disk usage inconsistency??

I have been rolling my own /system partitions on Jelly Bean, and noticed something a bit strange... After increasing the ext2 /system partition size, Android seems to report inconsistent partition sizes depending on what source I'm getting the partition size info from.
When I use an app such as Link2SD to show me the partition usage details, the information is DIFFERENT from what the shell command "df" tells me.
From the "df" command, the /system partition supposedly has 137.6MB free...
/system 1008.9M 871.3M 137.6M 4096 <---- inconsistent info
/data 3.0 G 300.3M 2.7 G 4096
/cache 126.0M 4.0 M 121.9M 4096
However, from apps such as Link2SD, the /system partition size shown is the original smaller size and there is correspondingly less free space. (0.98GB with 85MB free).

Journal Disabler For Pico! :D

----------------------- Journaling Disabler For Pico ----------------------
This is just a simple Zip to Disable Journaling on pico! as we use 2 or 3 extra ext4 partitions for OC!
It even clear's /sd-data,/sd-cache - for aosp
and /sd-ext,/sd-data,/sd-cache - for sense 4
Which means you need not always format your sd-card to switch between roms! .. But if you are switching from aosp rom to sense 4 you need to partition the sd-card appropriately!
Steps to USE:
******* Use this Zip Only when installing a Rom from scratch!... cause it wipes everything! ******
-- clear almost everything you can from recovery e.g factory-reset,/system,/boot,/cache etc
-- install this Zip! as like you do with any other zip (Prefered Recovery TWRP 2.4.X)
-- Flash Your Favourite Rom Now!!
I can use this even if i am not oc'ing?? Just like superwipe?
Disabling journal wont harm anything! Right?
Parth_14 said:
I can use this even if i am not oc'ing?? Just like superwipe?
Disabling journal wont harm anything! Right?
Click to expand...
Click to collapse
From the wikipedia's article:
A journaling file system is a file system that keeps track of the changes that will be made in a journal (usually a circular log in a dedicated area of the file system) before committing them to the main file system. In the event of a system crash or power failure, such file systems are quicker to bring back online and less likely to become corrupted.[1]
Click to expand...
Click to collapse
For overclocking, the SD Card is used for the /data and /cache partition. In that case, the SD Card would be read more frequently as the /data and /cache partitions are the most frequently accessed and modified partitions while running the Android system. In that case, using a Journal would slow down the memory access times if the SD Card is not fast enough. Also, as many modifications are made to the /data and /cache partition, the SD Card would be going through the read/write cycle twice the number of times, once for the journaling and once for the "commiting them to the main file system". So, it is likely that the SD Card might get corrupted faster than it normally should. That is the reason why Class 4 and below SD Cards are likely to "go dead" soon when overclocking with cute_prince's new PLL2 overclocking method. And, this is why ateeq72 has made this flashable zip to disable journaling. It would reduce the possibility/risk of losing your SD Card and at the same time allow you to OC your phone.
Using this when you are not OC'ing your phone? I wouldn't recommend that you flash this zip, but you would need a slightly modified zip. Also, journaling, I presume you want to disable in your phone's sd-ext memory. It would increase your phone's performance in case you are using any memory increasing scripts like int2ext which mount the sd-ext partition in the /data folder.
vineethraj49 said:
Using this when you are not OC'ing your phone? I wouldn't recommend that you flash this zip, but you would need a slightly modified zip. Also, journaling, I presume you want to disable in your phone's sd-ext memory. It would increase your phone's performance in case you are using any memory increasing scripts like int2ext which mount the sd-ext partition in the /data folder.
Click to expand...
Click to collapse
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Parth_14 said:
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Click to expand...
Click to collapse
No need to mod dude, u can use it if u dont OC.
Helped? Thanks maybe!
Parth_14 said:
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Click to expand...
Click to collapse
Edit the file named "ateeqscript" using Notepad++.
Make sure the file looks like the one below.
Code:
#!/bin/sh
echo ***************Begin Disable Journaling Partition***************
/sbin/busybox mount -t auto /dev/block/mmcblk0p2 /sd-ext
rm -rf /sd-ext/*
/sbin/busybox umount -l /sd-ext
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
sync
echo ***************Data Partion Done***************
echo ***************Finished No Journaling Partions***************
What I have done? Simple. Removed all code related to /sd-data and sd-cache, and kept only commands necessary for the sd-ext partition.
---------------------------------------------------
@OP, I suggest a few changes in your script. First, the mounting commands are run, so, if the sd-ext is already mounted by the recovery (just in case, accidentally it happened), then, you wouldn't (or rather shouldn't) be able to mount it in another folder, namely /sd-data. I would suggest the following change in your flashable zip. Try to make it look something like the one below.
Code:
#!/bin/sh
echo "\"Disabling Journaling\" Script"
echo "Initializing script..."
/sbin/busybox umount -l /sd-ext
/sbin/busybox mkdir /sd-data
/sbin/busybox mount /dev/block/mmcblk0p2 /sd-data
/sbin/busybox mkdir /sd-cache
/sbin/busybox mount /dev/block/mmcblk0p3 /sd-cache
/sbin/busybox mkdir /sd-ext2
/sbin/busybox mount /dev/block/mmcblk0p4 /sd-ext
rm -rf /sd-cache/*
rm -rf /sd-data/*
rm -rf /sd-ext/*
/sbin/busybox umount -l /sd-data
/sbin/busybox umount -l /sd-cache
/sbin/busybox umount -l /sd-ext
echo "Disabling Journal in sd-data"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
echo "Disabling Journal in sd-cache"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p3
fsck.ext4 -Dfy /dev/block/mmcblk0p3
echo "Disabling Journal in sd-ext"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p4
fsck.ext4 -Dfy /dev/block/mmcblk0p4
sync
echo "Partitions Journaling Disabled..."
echo "Finished no journaling partitions"
Do we need to flash this zip for every new rom or just once is enough?
Sent from my HTC Explorer A310e using xda app-developers app
faiPICO said:
Do we need to flash this zip for every new rom or just once is enough?
Sent from my HTC Explorer A310e using xda app-developers app
Click to expand...
Click to collapse
i guess one time is enough no need to flash again and again
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Parth_14 said:
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Click to expand...
Click to collapse
Its already there I guess
vineethraj49 said:
Its already there I guess
Click to expand...
Click to collapse
I've read that it formats through ext2/4 ! What i want is the parition to be remain untouched..
Parth_14 said:
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Click to expand...
Click to collapse
vineethraj49 said:
Its already there I guess
Click to expand...
Click to collapse
journal disabling is required for only ext4 partition for max performace
if u dont use ext4 use any wiping script
the script keval gave format partitions to ext2 only not ext4
sakshamx said:
journal disabling is required for only ext4 partition for max performace
if u dont use ext4 use any wiping script
the script keval gave format partitions to ext2 only not ext4
Click to expand...
Click to collapse
NOTE:------------>Do remember the script of sense will format partitions as EXT2 and script for aosp roms will format partitions as EXT4 and sense 4.1 sctript will also format as EXT4
Click to expand...
Click to collapse
vineethraj49 said:
Click to expand...
Click to collapse
u can check the script it formats as ext2 i had also checked from sd card its ext2
i also had thought that as it was given in thread but its not
is it updated script which u posted in facebook
bloodhound42 said:
is it updated script which u posted in facebook
Click to expand...
Click to collapse
yup! it is!
vineethraj49 said:
@OP, I suggest a few changes in your script. First, the mounting commands are run, so, if the sd-ext is already mounted by the recovery (just in case, accidentally it happened), then, you wouldn't (or rather shouldn't) be able to mount it in another folder, namely /sd-data. I would suggest the following change in your flashable zip. Try to make it look something like the one below.
Code:
#!/bin/sh
echo "\"Disabling Journaling\" Script"
echo "Initializing script..."
/sbin/busybox umount -l /sd-ext
/sbin/busybox mkdir /sd-data
/sbin/busybox mount /dev/block/mmcblk0p2 /sd-data
/sbin/busybox mkdir /sd-cache
/sbin/busybox mount /dev/block/mmcblk0p3 /sd-cache
/sbin/busybox mkdir /sd-ext2
/sbin/busybox mount /dev/block/mmcblk0p4 /sd-ext
rm -rf /sd-cache/*
rm -rf /sd-data/*
rm -rf /sd-ext/*
Click to expand...
Click to collapse
Bro thats why i have mounted sd-ext as "sd-ext2" ! to make sure every recovery doesnt have any issue mounting it!
what is journal?
in many posts i found this about this journal what is this actually..

Ascend G6 L11 -- use whole internal memory for apps+data

Note: This is probably only helpful for people with a computer science or linux hacking background!
We all know the single biggest issue with this phone is the lack of internal memory for apps and app data. The internal partitioning looks like this:
/system 1 GB
/data 2 GB
sdcard0 4 GB -- lots of space that competes with external SD! Let's use it!
other stuff (tmp, boot, etc.) 1 GB
persona78 provided an excellent mod of the (most recent) stock ROM that gives you root and a working init.d:
https://forum.xda-developers.com/ascend-g6/general/root-upadtekinguser-zip-modded-extras-t3349679
This mod also enables to move apps to a new ext4 partition on the external SD card. My experience however is:
dalvik cache and app data (e.g. some social media apps caching videos etc.) will still fill up the /data partition
access to external SD, even a fast one, is much slower
if you also move app data to external SD, the phone becomes unusable (slow)
So I propose the following solution, successfully tested on my phone, that will use just short of 6 GB on the internal SD card for dalvik cache, apps and their data!
This is how to do it:
backup everything important from the phone
unlock bootloader and install the ROM from persona78, linked above. Make sure root works, adb works.
connect to a Linux machine via USB that has adb installed
select mass storage mode on the phone in the USB settings
Now in mass storage mode do the following:
the phone exposes a block device without partitioning (e.g. /dev/sdb) and a block device with partitioning (e.g. /dev/sdc, /dev/sdc1). the former is the internal storage (sdcard0), the latter external storage (sdcard1).
mount /dev/sdb to /mnt/internal and /dev/sdc1 to /mnt/external
rsync -a /mnt/internal/ /mnt/external/
umount /dev/sdb
mkfs.vfat -C /var/tmp/vfat 256000
dd if=/var/tmp/vfat of=/dev/sdb bs=1M (you can delete /var/tmp/vfat after this)
losetup /dev/loop0 /dev/sdb -o 262144000
mkfs.ext4 /dev/loop0
On the phone you can now change back the USB mode to MTP (but not to charge only -- a data mode is needed for adb to work).
Now run adb shell and obtain root in the shell via 'su'. In the adb root shell:
mkdir -p /data/sdext4
losetup -o 262144000 /dev/block/loop7 /dev/block/mmcblk0p25
mount -t ext4 /dev/block/loop7 /data/sdext4
in /data/sdext4, create two directories called 'data-app' and 'data-data'. Give them the respective permissions and group,ownership as with the current /data/app and /data/data directories.
cp -a /data/app/* /data/sdext4/data-app
cp -a /data/data/* /data/sdext4/data-data
rm -r /data/app/* /data/data/*
mount -o remount,rw /system
edit /etc/init.d/01AOBoot as follows
Content of /etc/init.d/01AOBoot:
#!/system/bin/sh
CONCURRENCY=makefile
# mount sdext4
losetup -o 262144000 /dev/block/loop7 /dev/block/mmcblk0p25
mount -t ext4 /dev/block/loop7 /data/sdext4
mount -o bind /data/sdext4/data-app /data/app
mount -o bind /data/sdext4/data-data /data/data
# change dalvik permissions
chmod 773 /data/dalvik-cache
# change scaling_min_freq to 300000
echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Click to expand...
Click to collapse
Now run adb reboot. It is done.
Explanation: Apps and their data need to reside on an ext4 partition. sdcard0 however has to be vfat, otherwise the phone will always complain and ask to format it. We can also not change the internal storage partitioning. Therefore we simply hide a large ext4 filesystem behind a small vfat filesystem on the same partition. Apps will startup fast and run fast, and all media files can be put on the external sd card.
I know this is very exotic to most, but maybe there are a few people like me with the necessary background who would like to follow my example. Happy hacking!
Are you kidding me?
This is a great work that you did. My phone keeps complaining about low disk space but I was gonna use parted to resize the data partition.

Categories

Resources